A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-June/045112.html below:

[Python-Dev] RE: Comparing heterogeneous types

[Python-Dev] RE: Comparing heterogeneous types [Python-Dev] RE: Comparing heterogeneous typesRobert Brewer fumanchu at amor.org
Tue Jun 1 22:42:17 EDT 2004
Aahz wrote:
> On Mon, May 31, 2004, Robert Brewer wrote:
> >
> > Quite similar to my current "pet peeve":
> > 
> > >>> None > 3
> > False
> > >>> None > 'hoopy'
> > False
> > >>> None > True
> > False
> > >>> None > datetime.date(2004, 5, 31)
> > Traceback (most recent call last):
> >   File "<interactive input>", line 1, in ?
> > TypeError: can't compare datetime.date to NoneType
> > 
> > ...writing an O-R mapper, this particular hobgoblin bites 
> me rather often ;)
> 
> Time for you to bite the bullet.  Guido has all-but-decreed that the
> future of comparisons is that TypeError will be raised for 
> all operators
> other than == and <> for types that have no appropriate relationship
> system.

...which is fine. I'll end up either disallowing None as a legal value,
or making a NO_VALUE singleton for which I can customize comparisons.
Either is a better design choice IMO; I just haven't been forced into
the choice yet. ;)


Robert Brewer
MIS
Amor Ministries
fumanchu at amor.org

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4