This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Robert.Tasarz
Recipients Robert.Tasarz, docs@python
Date 2017-06-18.22:15:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1497824156.09.0.152108719585.issue30699@psf.upfronthosting.co.za>
In-reply-to
Content
https://docs.python.org/3/library/datetime.html#datetime-objects
gives in an example two classes named GMT1 and GMT2 subclassing tzinfo, defined with dst(…) methods returning one hour timedelta for summer periods. This is in conflict with naming, as GMT timezone is not defined with any daylight saving time, so any timezone offsetted from it shouldn't be as well. I would suggest renaming them to something like BrusselsTZ and HelsinkiTZ (with a comment that this is simplified implementation, that doesn't account for exact hour when dst switch is made, and maybe mentioning pytz) and tzname(…) to return ('CET', 'CEST')[bool(self.dst(dt))] and ('EET', 'EEST')[bool(self.dst(dt))] accordingly.

Also https://docs.python.org/3/library/datetime.html#time-objects
has an example with GMT1 class, though this time dst(…) unconditionally returns offset 0 properly, tzname(…) gives 'Europe/Prague' – region that uses dst. IMHO returning any of: "CET", "GMT+1", "Africa/Tunis" would be better here.
History
Date User Action Args
2017-06-18 22:15:56Robert.Tasarzsetrecipients: + Robert.Tasarz, docs@python
2017-06-18 22:15:56Robert.Tasarzsetmessageid: <1497824156.09.0.152108719585.issue30699@psf.upfronthosting.co.za>
2017-06-18 22:15:56Robert.Tasarzlinkissue30699 messages
2017-06-18 22:15:55Robert.Tasarzcreate