We're now thoroughly in python-ideas land. On Mon, Dec 21, 2015 at 7:39 AM, Random832 <random832 at fastmail.com> wrote: > Guido van Rossum <guido at python.org> writes: > > I'm sure that one often catches people by surprise. However, I don't > > think we can fix that one without also fixing the values of the > > attributes -- in that example days is -1 and seconds is 86340 (which > > will *also* catch people by surprise). And changing that would be > > much, much harder for backwards compatibility reasons-- we'd have to > > set days to 0 and seconds to -60, and suddenly we have a much murkier > > invariant, instead of the crisp > > > > 0 <= microseconds < 1000000 > > 0 <= seconds < 60 > > I don't really see it as murky: > > 0 <= abs(microseconds) < 1000000 > 0 <= abs(seconds) < 60 > (days <= 0) == (seconds <= 0) == (microseconds <= 0) > (days >= 0) == (seconds >= 0) == (microseconds >= 0) > > The latter are more easily phrased in english as "all nonzero > attributes have the same sign". I think the current behavior is > rather as if -1.1 were represented as "-2+.9". The attributes > probably can't be fixed without breaking backwards > compatibility, though. How about "-timedelta(0, 60)"? > > _______________________________________________ > Python-Dev mailing list > Python-Dev at python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > https://mail.python.org/mailman/options/python-dev/guido%40python.org > -- --Guido van Rossum (python.org/~guido) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20151221/2e75f815/attachment.html>
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