comparison with None

Steven D'Aprano steve at REMOVE.THIS.cybersource.com.au
Thu Apr 19 19:25:16 EDT 2007


On Thu, 19 Apr 2007 17:00:29 +0000, Alan Isaac wrote:

> 
> "Steven D'Aprano" <steve at REMOVE.THIS.cybersource.com.au> wrote in message
> news:pan.2007.04.19.07.04.43.363933 at REMOVE.THIS.cybersource.com.au...
>> You shouldn't expect comparisons between types to
>> sort the same from one version of Python to another, although they may,
>> and in the future (Python 3) it is likely to become an error to compare
>> incomparable objects.
> 
> Indeed, that was the basis of my original question.
> I wondered why no exception was raised.
> 
> Thanks,
> Alan Isaac
> 
> PS Note that the change you mention will conflict with
> currently documented behavior:
> "objects of different types always compare unequal".
> So this seems like a large change.


Absolutely -- that's why it is scheduled for Python 3, which is the
release which is allowed to make backwards incompatible changes.


-- 
Steven.




More information about the Python-list mailing list