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/2014-February/132446.html below:

[Python-Dev] python 3 niggle: None < 1 raises TypeError

[Python-Dev] python 3 niggle: None < 1 raises TypeError [Python-Dev] python 3 niggle: None < 1 raises TypeErrorGreg Ewing greg.ewing at canterbury.ac.nz
Tue Feb 18 06:32:19 CET 2014
Terry Reedy wrote:
> To make None a true bottom object, the rich comparison 
> methods would have to special-case None as either argument before 
> looking at the __rc__ special methods of either.

I don't think it would be necessary to go that far.
It would be sufficient to put the special case *after*
giving both operations a chance to handle the operation
via the type slots.

Well-behaved objects generally wouldn't go out of their
way to defeat that, but they could do so if necessary,
e.g. to create a Bottom() that compares less than None.
Although once None becomes usable as a bottom in most
cases, there shouldn't be much need for people to
introduce their own bottoms.

-- 
Greg
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