Guido van Rossum wrote: > > > Would it be good to allow adding/subtracting scalars (int, long, float) > > to/from date/times? The scalar value would be # of seconds. > > > > So: > > dt = datetime() # some date/time > > dt + 5 # would add 5 seconds > > dt + 5.3 # would add 5 seconds 300000 usecs > > Yes, I think so. Timedelta should also support this, I believe. > Thanks for the patch! Of course, the test suite needs to be augmented > too. > > BTW, we prefer comments and edits to the Wiki over the mailing list: > > http://www.zope.org/Members/fdrake/DateTimeWiki/FrontPage > > I've added this already. Hope you don't mind ;-) ... You should name the type timestamp if you want to imply dt + n == dt + n seconds. datetime + n is commonly understood as dt + n *days*. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Company & Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4