Recently added datetime.timezone class does not have a custom repr, so one gets >>> timezone.utc <datetime.timezone object at 0x100681ef0> instead of parseable datetime.timezone(datetime.timedelta(0)) This is inconsistent with the way other classes in datetime module behave.
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 . [1] http://bugs.python.org/issue5094#msg106411