Message309717
I think if we're going to use `timedelta` then `__mod__` is the more appropriate option here, since it would be hard to interpret what `round(dt, timedelta(hours=2, microseconds=31))` would do.
Either __mod__ or __round__ with `timedelta` is a bit of a stretch in my opinion, and also is limited to well-defined units (and as such you can't round to the nearest month or year). I think a `round` taking either a string or an enum is the simplest, easiest to understand implementation (and/or adding a precision argument to `now` that is equivalent to `round(datetime.now(), precision)`). |
|
Date |
User |
Action |
Args |
2018-01-09 16:56:48 | p-ganssle | set | recipients:
+ p-ganssle, tim.peters, barry, belopolsky, vstinner |
2018-01-09 16:56:48 | p-ganssle | set | messageid: <1515517008.73.0.467229070634.issue32522@psf.upfronthosting.co.za> |
2018-01-09 16:56:48 | p-ganssle | link | issue32522 messages |
2018-01-09 16:56:48 | p-ganssle | create | |
|