On Mon, Jan 28, 2013 at 11:26 AM, Antoine Pitrou <solip...@pitrou.net> wrote:
> Will non-ambiguous shorthands such as "Warsaw" and "GMT" be accepted?

pytz accepts GMT, so that will work. Otherwise no.

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

No, it will only be raised when is_dst=None. The flag is there to say
what timezone the resulting time should be if it is ambiguous or
missing.

It is true that the times that don't exist will also not exist even if
you set the flag. 2012-03-25 02:30 is a time that don't exist in
Europe/Warsaw, flag or not. But it will not raise an error if you set
the flag to False or True, for reasons of backwards compatibility as
well as ease of handling. People don't expect that certain times don't
exist, and will generally not check for those exceptions. Therefore,
the normal behavior is to not raise an error, but happily keep dealing
with the time as if it does exist. Only of you explicitly set it to
"None" will you get an error.

//Lennart
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to