Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!news2.arglkargh.de!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'skip:/ 10': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'throw': 0.09; '16:10,': 0.16; 'message-id:@dough.gmane.org': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'wrote:': 0.17; 'app': 0.19; 'skip:p 30': 0.20; 'import': 0.21; "python's": 0.23; 'this:': 0.23; "i've": 0.23; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'subject:skip:d 10': 0.27; 'header:X-Complaints-To:1': 0.28; 'assert': 0.29; 'behaviour': 0.29; 'to:addr:python-list': 0.33; 'received:org': 0.36; 'does': 0.37; 'uses': 0.37; 'why': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'confusing': 0.84; 'received:89': 0.86 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Damjan Subject: Re: Confusing datetime.datetime Date: Fri, 06 Jul 2012 00:55:48 +0200 References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 89.205.110.217 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120616 Thunderbird/13.0.1 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1341528901 news.xs4all.nl 6943 [2001:888:2000:d::a6]:58434 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:24948 On 05.07.2012 16:10, Damjan wrote: > I've been struggling with an app that uses > Postgresql/Psycopg2/SQLAlchemy and I've come to this confusing > behaviour of datetime.datetime. Also this: #! /usr/bin/python2 # retardations in python's datetime import pytz TZ = pytz.timezone('Europe/Skopje') from datetime import datetime x1 = datetime.now(tz=TZ) x2 = datetime(x1.year, x1.month, x1.day, tzinfo=TZ) assert x1.tzinfo == x2.tzinfo WHY does the assert throw an error???