[issue9538] Replace confusing pseudoname 'object' in special methods section.
New submission from Terry J. Reedy
Terry J. Reedy
Terry J. Reedy
Éric Araujo
peter recore added the comment:
Here is a patch that implements Eric's suggestion. I am a new contributor and would welcome feedback on if this is correct or not.
----------
keywords: +patch
nosy: +peterrecore
Added file: http://bugs.python.org/file29815/issue9538.patch
_______________________________________
Python tracker
Georg Brandl added the comment:
Note that Sphinx searches for "object.__foo__" when :meth:`__foo__` is used; this change will break all those links.
For that reason I'm -1 to this change: I don't see the perceived issue as problematic anyway.
----------
_______________________________________
Python tracker
peter recore added the comment:
George,
When I build the docs with my changes, the links from the method names seem to work the same way as they do in the existing docs.
----------
_______________________________________
Python tracker
Terry J. Reedy added the comment:
The problem, for me, is that in 3.3 Data Model, 'object' is being used with a 3rd meaning, 'generic class' (or possibly 'subclass of object', if indeed every 'class' must be 'object' subclass, in the strict sense of 'object'). This is in addition to 'object' the specific class and generic Python object (which in CPython is a PyObject structure instance). The normal two meanings are often differentiated by typography: normal type for plain old object, something else for *object*.
To add a bit to the confusion, 3.3.4. Customizing instance and subclass checks changes the prefix to 'class' instead of 'object' (which is what I would do in the whole section...)
class.__instancecheck__(self, instance)
class.__subclasscheck__(self, subclass)
It then goes on to explain that it does not really mean 'generic class' but 'type/metaclass'. So, to me, the prefix here should really be 'metaclass'.
Peter, the patch applied fine to my copy of default. It is incomplete in that the replacement should be made everywhere or nowhere in 3.3, not just in 3.3.2(.0) and 3.3.2.1. However, do not bother making a new patch until there is more agreement on a change than there is now.
A possible alternative to the given proposal is an explanation in the short 3.3 header of the special use of 'object' within the section.
----------
versions: +Python 3.3, Python 3.4 -Python 3.2
_______________________________________
Python tracker
Change by Irit Katriel
participants (5)
-
Georg Brandl
-
Irit Katriel
-
peter recore
-
Terry J. Reedy
-
Éric Araujo