Skip to content

Instantly share code, notes, and snippets.

@velppa
Created March 11, 2014 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velppa/9493244 to your computer and use it in GitHub Desktop.
Save velppa/9493244 to your computer and use it in GitHub Desktop.
# rbd at mac-mini in ~/Sites/iseetheline.ru on git:master x [23:27:40]
$ python
Python 2.7.5 (default, Jun 8 2013, 12:45:21)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from datetime import timedelta as t
>>> x = t(days=3)
>>> y = t(days=2)
>>> (x-y)*0.5
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for *: 'datetime.timedelta' and 'float'
>>> exit()
# rbd at mac-mini in ~/Sites/iseetheline.ru on git:master x [23:28:22]
$ python3
Python 3.3.3 (default, Jan 28 2014, 21:04:16)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from datetime import timedelta as t
>>> x = t(days=3)
>>> y = t(days=2)
>>> (x-y)*0.5
datetime.timedelta(0, 43200)
>>> exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment