This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients brett.cannon, docs@python, terry.reedy
Date 2020-10-03.01:13:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1601687636.17.0.0883480334158.issue41910@roundup.psfhosted.org>
In-reply-to
Content
The word 'object' in this section is a bit confusing because it refers to any Python object, not to base class 'object' or an instance thereof.  I suspect that this usage predates the introduction of the latter in 2.2.

This interpretation is required for sentences like "By default, __ne__() delegates to __eq__() and inverts the result unless it is NotImplemented." and "If a class does not define an __eq__() method ..." (in the __hash__ entry) to make sense.  I think that the meaning of 'object' should be stipulated at the top of the section and mention the existence of base class 'object', and maybe list which of the following methods it has, and that they are inherited by subclasses.

The base class __eq__ implementation is implied in this paragraph in the __hash__ entry.

"User-defined classes have __eq__() and __hash__() methods by default; with them, all objects compare unequal (except with themselves) and x.__hash__() returns an appropriate value such that x == y implies both that x is y and hash(x) == hash(y)."

I think it worthwhile explaining that user classes get these defaults by inheriting them (and others) from 'object', and that the implication follows from inheriting a particular base class implementation of __eq__.  To put it another way, I believe the quoted paragraph makes the  definition a Python requirement rather than just a CPython implementation detail.
History
Date User Action Args
2020-10-03 01:13:56terry.reedysetrecipients: + terry.reedy, brett.cannon, docs@python
2020-10-03 01:13:56terry.reedysetmessageid: <1601687636.17.0.0883480334158.issue41910@roundup.psfhosted.org>
2020-10-03 01:13:56terry.reedylinkissue41910 messages
2020-10-03 01:13:55terry.reedycreate