Test None for an object that does not implement ==

Ethan Furman ethan at stoneleaf.us
Sun Dec 25 23:26:06 EST 2011


Nobody wrote:
> nothing should compare
> equal to None except for None itself, so "x is None" and "x == None"
> shouldn't produce different results unless there's a bug in the comparison
> method.
> 

Why wouldn't you want other types that can compare equal to None?  It 
could be useful for a Null type to == None.

~Ethan~



More information about the Python-list mailing list