Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #64663

Re: datetime as subclass of date

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 <python-python-list@m.gmane.org>
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 <ben+python@benfinney.id.au>
Subject Re: datetime as subclass of date
Date Fri, 24 Jan 2014 17:54:26 +1100
References <CANc-5Uw5z84=vAMVJaCH-KCSR=1q8_zTKuspaF2zzOG9qtVu4Q@mail.gmail.com> <mailman.5913.1390515296.18130.python-list@python.org> <roy-29B820.19102323012014@news.panix.com>
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 <bignose+hates-spam@benfinney.id.au>
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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5930.1390546479.18130.python-list@python.org> (permalink)
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

Show key headers only | View raw


Roy Smith <roy@panix.com> writes:

> Ben Finney <ben+python@benfinney.id.au> 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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: datetime as subclass of date Ben Finney <ben+python@benfinney.id.au> - 2014-01-24 09:14 +1100
  Re: datetime as subclass of date Roy Smith <roy@panix.com> - 2014-01-23 19:10 -0500
    Re: datetime as subclass of date Ben Finney <ben+python@benfinney.id.au> - 2014-01-24 17:54 +1100
    Re: datetime as subclass of date Skip Montanaro <skip@pobox.com> - 2014-01-24 10:03 -0600

csiph-web