[Datetime-SIG] pytz vs. PEP 495 Was: PEP-431/495

Ethan Furman ethan at stoneleaf.us
Mon Aug 24 22:55:31 CEST 2015

On 08/24/2015 01:44 PM, Alexander Belopolsky wrote:
> On Mon, Aug 24, 2015 at 4:28 PM, ISAAC J SCHWABACHER wrote:
>> [ijs]
>> I *really* hope the answer to this one is, "don't do that".
> That's not an option because people already *do* [1] that and they won't stop.
> Neither they will stop using datetime.combine() [2] or datetime.replace() [3]
> or tolerate if those methods start raising exceptions.

If the default is True (or False), then this won't be a problem.  It will only be None when explicitly asked for.

`time` can just store the flag, and when it is combined with a date the flag should be checked and if None and the resulting datetime doesn't exist or is ambiguous an exception can be raised.


More information about the Datetime-SIG mailing list