[Datetime-SIG] Calendar vs timespan calculations...

Ethan Furman ethan at stoneleaf.us
Sat Aug 1 08:57:08 CEST 2015


On 07/31/2015 10:16 PM, Tim Peters wrote:

> [Alexander Belopolsky]
>> (I really don't want  tz.utcoffset(t) to ever raise an exception)

> [Tim]
> Me neither.

Why not?  If the programmer is using strict tzinfos how would they end up with an invalid t?

I only see two ways:

   - constructing from a literal (in which case an exception should be raised)

   - t is using a non-strict or missing tzinfo, possibly from an addition or subtraction
     (in which case we can't know which direction they were going and should not guess
     -- so raise an exception)

--
~Ethan~


More information about the Datetime-SIG mailing list