[New-bugs-announce] [issue9183] Intern UTC timezone

Alexander Belopolsky report at bugs.python.org
Tue Jul 6 23:55:53 CEST 2010


New submission from Alexander Belopolsky <belopolsky at users.sourceforge.net>:

Attached patch makes timezone(timedelta(0)) always return the same instance as timezone.utc.  See issue9051 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

----------
assignee: belopolsky
components: Extension Modules
files: intern-utc.diff
keywords: easy, patch
messages: 109432
nosy: belopolsky, mark.dickinson
priority: normal
severity: normal
stage: commit review
status: open
title: Intern UTC timezone
type: resource usage
versions: Python 3.2
Added file: http://bugs.python.org/file17885/intern-utc.diff

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


More information about the New-bugs-announce mailing list