This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients barry, belopolsky, p-ganssle, tim.peters, vstinner
Date 2018-01-09.19:41:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1515526918.2.0.467229070634.issue32522@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2018-01-09 19:41:58belopolskysetrecipients: + belopolsky, tim.peters, barry, vstinner, p-ganssle
2018-01-09 19:41:58belopolskysetmessageid: <1515526918.2.0.467229070634.issue32522@psf.upfronthosting.co.za>
2018-01-09 19:41:58belopolskylinkissue32522 messages
2018-01-09 19:41:58belopolskycreate