Alexander Belopolsky added the comment:

None is passed to tzinfo.dst() when it is called from time.dst() method.  This 
is documented in the relevant section: 
<https://docs.python.org/3.5/library/datetime.html#datetime.time.dst>.

I am not sure whether if it is worth repeating in the abstract tzinfo class 
documentation, but if we do, the same should be done for the utcoffset() and 
tzname() methods which also get None when called from namesake time methods.

While we are at it, we should also do something about "If utcoffset() does not 
return None, dst() should not return None either." mandate in the 
tzinfo.utcoffset() documentation. See 
<https://docs.python.org/3.5/library/datetime.html#datetime.tzinfo.utcoffset>.  
This mandate is violated by the datetime.timezone class.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28386>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to