[issue40136] add warning to datetime.replace documentation to not use it for setting tzinfo unless UTC or None

2020-04-01 Thread Benedikt Bleimhofer
Benedikt Bleimhofer added the comment: Thx for this really helpful info. After reading the article i switched all my code from using pytz to dateutil.tz. -- ___ Python tracker

[issue40136] add warning to datetime.replace documentation to not use it for setting tzinfo unless UTC or None

2020-04-01 Thread Paul Ganssle
Paul Ganssle added the comment: That is a specific problem with the third-party library `pytz`, not a standard feature of the datetime module. Using `datetime.replace` is the intended way to set a time zone, see: https://blog.ganssle.io/articles/2018/03/pytz-fastest-footgun.html As of

[issue40136] add warning to datetime.replace documentation to not use it for setting tzinfo unless UTC or None

2020-04-01 Thread Benedikt Bleimhofer
New submission from Benedikt Bleimhofer : It would probably save some people a lot of time if the documentation of datetime.replace (https://docs.python.org/3/library/datetime.html#datetime.datetime.replace) showed a warning not to use it for setting the timezone on a datetime object or at