You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because add can accept DateDelta / TimeDelta, I think it would be nice it has add_py_delta to accept std timedelta object. Otherwise, we have to convert it to whenever types before passing to add, which makes code verbose.
The text was updated successfully, but these errors were encountered:
Hi @hongquan, thanks for posting this issue. Interesting idea. Although, instead of a new method, it'd be cleaner to simply make add() support timedelta. I don't have many issues with this, as timedelta and TimeDelta are very similar and this could ease migration from the standard library.
Out of curiousity—do you need this because you're migrating away from datetime, or do you have a different use case?
One concern I do have is that dt.add(days=1) is in some cases not the same as dt.add(timedelta(days=1)), because the latter always assumes days are exactly 24 hours (which is not the case during DST transitions).
Because
add
can acceptDateDelta
/TimeDelta
, I think it would be nice it hasadd_py_delta
to accept stdtimedelta
object. Otherwise, we have to convert it towhenever
types before passing toadd
, which makes code verbose.The text was updated successfully, but these errors were encountered: