[Python-Dev] PEP 431 Updates (original) (raw)

Antoine Pitrou solipsis at pitrou.net
Mon Jan 28 11:26:25 CET 2013


Hi,

Le Mon, 28 Jan 2013 11:01:05 +0100, Lennart Regebro <regebro at gmail.com> a écrit :

This function takes a name string that must be a string specifying a valid zoneinfo time zone, i.e. "US/Eastern", "Europe/Warsaw" or "Etc/GMT".

Will non-ambiguous shorthands such as "Warsaw" and "GMT" be accepted?

The isdst parameter can be False (default), True, or None.

False will specify that the given datetime should be interpreted as not happening during daylight savings time, i.e. that the time specified is after the change from DST. True will specify that the given datetime should be interpreted as happening during daylight savings time, i.e. that the time specified is before the change from DST. None will raise an AmbiguousTimeError exception if the time specified was during a DST change over. It will also raise a NonExistentTimeError if a time is specified during the "missing time" in a change to DST.

NonExistentTimeError can also be raised for is_dst=True and is_dst=False, no? Or am I misunderstanding the semantics?

Regards

Antoine.



More information about the Python-Dev mailing list