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


Groups > comp.lang.python > #64643

Re: datetime as subclass of date

Path csiph.com!usenet.pasdenom.info!goblin2!goblin3!goblin.stu.neva.ru!panix!roy
From Roy Smith <roy@panix.com>
Newsgroups comp.lang.python
Subject Re: datetime as subclass of date
Date Thu, 23 Jan 2014 19:10:23 -0500
Organization PANIX Public Access Internet and UNIX, NYC
Lines 14
Message-ID <roy-29B820.19102323012014@news.panix.com> (permalink)
References <CANc-5Uw5z84=vAMVJaCH-KCSR=1q8_zTKuspaF2zzOG9qtVu4Q@mail.gmail.com> <mailman.5913.1390515296.18130.python-list@python.org>
NNTP-Posting-Host localhost
X-Trace reader1.panix.com 1390522223 24346 127.0.0.1 (24 Jan 2014 00:10:23 GMT)
X-Complaints-To abuse@panix.com
NNTP-Posting-Date Fri, 24 Jan 2014 00:10:23 +0000 (UTC)
User-Agent MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)
Xref csiph.com comp.lang.python:64643

Show key headers only | View raw


In article <mailman.5913.1390515296.18130.python-list@python.org>,
 Ben Finney <ben+python@benfinney.id.au> wrote:

> Skip Montanaro <skip@pobox.com> writes:
> 
> > […] I was asking [Python] if a datetime instance was an instance of a
> > date. Which, it turns out, it is.
> 
> Yep. 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.

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