You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attached patch makes timezone(timedelta(0)) always return the same instance as timezone.utc. See bpo-9051 for pure python implementation.
With this patch, manipulation of aware datetime objects will be as efficient as that of naive datetime objects. Note that having timezone.utc is not enough to assure that the same tzinfo object is used because aware objects can be produced by datetime.strptime(). With this patch,
>>> datetime.strptime('2010-07-06 21:39:55 +0000', "%Y-%m-%d %H:%M:%S %z").tzinfo is timezone.utc
True
Activity
abalkin commentedon Jul 6, 2010
Attached patch makes timezone(timedelta(0)) always return the same instance as timezone.utc. See bpo-9051 for pure python implementation.
With this patch, manipulation of aware datetime objects will be as efficient as that of naive datetime objects. Note that having timezone.utc is not enough to assure that the same tzinfo object is used because aware objects can be produced by datetime.strptime(). With this patch,
abalkin commentedon Jul 7, 2010
Python implementation of UTC interning can be done better than the one in bpo-9051. See attached bpo-9183-proto.diff.
abalkin commentedon Jul 28, 2010
Updated issue9183a.diff patch combines C and Python code changes since datetime.py is now in stdlib. Does anyone want to review before it goes in?
abalkin commentedon Oct 14, 2010
Committed in r85485.