[Python-ideas] [[Python-Dev] PyObject_RichCompareBool identity shortcut] About specializing comparing objects in collections

ZS szport at gmail.com
Fri Apr 29 09:16:43 CEST 2011


It was necessary to clarify the reason for the possible introduction
of a special method __equals__. The fact that the objects in python
are often interpreted as values. Method __eq__, IMHO is used more for
comparing objects as values​​. Introduction of method __equals__ can
explicitly indicate the method of comparison of the objects as objects
and __eq__ objects as values​​. If method __equals__ is not defined
then __eq__ will be used.

-- 
Zaur



More information about the Python-ideas mailing list