__eq__ and __ne__
Raymond Hettinger
vze4rx4y at verizon.net
Wed Jul 16 15:44:29 EDT 2003
> [Tim]
> >>>> Since the richcmp operators aren't constrained to return scalars,
> >>>> an attempt to define one in terms of the others seemed futile.
> >>>> Instead they're 6 independent methods.
>
> [Shane Hathaway]
> >>> Ok. Thanks for finding the docs. I guess I'll stick to my
> >>> boilerplate code. I think some guidance should be added to the
> >>> Python docs, though, explaining that whenever you define __eq__,
> >>> you very likely ought to define __ne__ also.
Okay, I added it to the docs.
Raymond Hettinger
More information about the Python-list
mailing list