Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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; 'true,': 0.05; 'false.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subset': 0.09; 'bug,': 0.16; 'conflicted': 0.16; 'finney': 0.16; 'hmm.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'roy': 0.16; 'sense,': 0.16; 'weird': 0.16; ':-)': 0.16; 'do,': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'header:X -Complaints-To:1': 0.27; "i'm": 0.30; 'though.': 0.31; 'writes:': 0.31; 'sense': 0.34; 'skip:_ 10': 0.34; 'skip:d 20': 0.34; 'but': 0.35; 'received:com.au': 0.36; 'should': 0.36; 'ben': 0.38; 'to:addr:python-list': 0.38; 'that,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'skip:\xe2 10': 0.65; 'smith': 0.68; '8bit%:43': 0.74; 'concept.': 0.84; 'received:125': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ben Finney Subject: Re: datetime as subclass of date Date: Fri, 24 Jan 2014 17:54:26 +1100 References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: vmx15867.hosting24.com.au X-Public-Key-ID: 0xBD41714B X-Public-Key-Fingerprint: 9CFE 12B0 791A 4267 887F 520C B7AC 2E51 BD41 714B X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-gpg.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:tylRTejtqAHrwzeXxqTujYUNFdE= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1390546479 news.xs4all.nl 2949 [2001:888:2000:d::a6]:42606 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:64663 Roy Smith writes: > Ben Finney wrote: > > > Makes sense, since ‘datetime’ can do everything ‘date’ can do, and > > is conceptually a subset of the same concept. > > That's reasonable, but given that, it's weird that date(2014, 1, 23) == > datetime(2014, 1, 23) is False. You would think it should be True, in > the same way that 1 + 0j == 1 is True. Hmm. It does make sense to me that ‘datetime.date(2014, 1, 23) == datetime.datetime(2014, 1, 23)’. I can come up with rationalisations for why it isn't, but they're not satisfactory. I also don't consider it a bug, though. I'm conflicted :-) -- \ “Those who write software only for pay should go hurt some | `\ other field.” —Erik Naggum, in _gnu.misc.discuss_ | _o__) | Ben Finney