[issue9000] Provide parseable repr to datetime.timezone

Alexander Belopolsky report at bugs.python.org
Tue Jul 6 17:21:40 CEST 2010


Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:

I am attaching a python prototype.  I am following the convention in place for the other datetime classes of prepending the repr with 'datetime.'.  This may not be ideal, but better than to introduce an inconsistency.  The only question I think is worth considering is the representation of timezone.utc.  I would like to have repr(timezone(timedelta(0))) == 'datetime.timezone.utc' even though currently timezone(timedelta(0)) and timezone.utc are different but equal objects.  This is going to change, however.  See issue9051.

[1] http://bugs.python.org/issue5094#msg106411

----------
keywords: +patch
Added file: http://bugs.python.org/file17882/issue9000-proto.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9000>
_______________________________________


More information about the Python-bugs-list mailing list