Annoying behaviour of the != operator

Dan Bishop danb_83 at yahoo.com
Wed Jun 8 14:11:50 EDT 2005


Mahesh wrote:
> No, why should Python assume that if you use != without supplying a
> __ne__ that this is what you want?

Because every single time I've used __ne__, that *is* what I want.

> Without direction it will compare
> the two objects which is the default behavior.

It's also the default behavior that x == y and x != y are mutally
exclusive.




More information about the Python-list mailing list