[issue28386] Improve documentation about tzinfo.dst(None)

Alexander Belopolsky report at bugs.python.org
Fri Oct 7 13:55:11 EDT 2016


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 <report at bugs.python.org>
<http://bugs.python.org/issue28386>
_______________________________________


More information about the Python-bugs-list mailing list