Annoying behaviour of the != operator

Mahesh sutram at gmail.com
Wed Jun 8 17:27:51 EDT 2005


I understand that what makes perfect sense to me might not make perfect
sense to you but it seems a sane default. When you compare two objects,
what is that comparision based on? In the explicit is better than
implicit world, Python can only assume that you *really* do want to
compare objects unless you tell it otherwise. The only way it knows how
to compare two objects is to compare object identities.

I am against making exceptions for corner cases and I do think making
__ne__ implicitly assume not __eq__ is a corner case.

Maybe you think that it takes this explicit is better than implicit
philosophy too far and acts dumb but I think it is acting consistently.

Cheers,
Mahesh




More information about the Python-list mailing list