]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-30699: Improve example on datetime tzinfo instances (GH-4290)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 4 Jun 2019 15:25:16 +0000 (08:25 -0700)
committerGitHub <noreply@github.com>
Tue, 4 Jun 2019 15:25:16 +0000 (08:25 -0700)
commit12c178799a23b47c5f8ebc072cbdf09a370649ae
treeb7eb2fa1e802b47c1501e95e5bd3d6606fcb5b7e
parentcad4ff65eb12649cd650059b15d8e12f2ae951ef
bpo-30699: Improve example on datetime tzinfo instances (GH-4290)

* Improve example on tzinfo instances

Move from GMTX to TZX when naming the classes, as GMT1 might be rather
confusing as seen in the reported issue.
In addition, move to UTC over GMT and improve the tzname implementation.

* Simplify datetime with tzinfo example

Move the example in the documentation to just use timezone.utc and a
user defined Kabul timezone rather than having two user defined
timezones with DST.

Kabul timezone is still interesting as it changes its offset but not
based on DST. This is more accurate as the previous example was missing
information about the fold attribute. Additionally, implementing the fold
attribute was rather complex and probably not relevant enough for the
section "datetime with tzinfo".
(cherry picked from commit f0b5ae4567637b24035ecda93a3240efc96b6dd9)

Co-authored-by: Mario Corchero <mcorcherojim@bloomberg.net>
Doc/library/datetime.rst