New submission from Alexander Belopolsky <belopol...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue9183>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to