Message309730
> I think that a "truncate to rrule" function is *way* beyond the scope of the standard library
I agree and I did not propose that. What I said was that in the process of implementing truncate to rrule in dateutil you may encounter some common pattern that may benefit from a new stdlib datetime feature.
The operation that I often need is
def truncate_datetime(t:datetime, interval:timedelta, start=datetime.min) -> datetime
"""Return the largest datetime of the form start + interval * i not greater than t"""
but it is exactly the kind of one-liner that does not belong to stdlib. |
|
Date |
User |
Action |
Args |
2018-01-09 19:41:58 | belopolsky | set | recipients:
+ belopolsky, tim.peters, barry, vstinner, p-ganssle |
2018-01-09 19:41:58 | belopolsky | set | messageid: <1515526918.2.0.467229070634.issue32522@psf.upfronthosting.co.za> |
2018-01-09 19:41:58 | belopolsky | link | issue32522 messages |
2018-01-09 19:41:58 | belopolsky | create | |
|