[issue16508] include the "object" type in the lists of documented types
New submission from Chris Jerdonek: This issue is to add the "object" type to the list of types documented in the language reference's standard type hierarchy and the library reference's list of built-in types: http://docs.python.org/dev/reference/datamodel.html#the-standard-type-hierar... http://docs.python.org/dev/library/stdtypes.html#other-built-in-types The constructor is documented here: http://docs.python.org/dev/library/functions.html#object In the documentation, it might also be worth stating explicitly which of the special methods the object type defines: http://docs.python.org/dev/reference/datamodel.html#special-method-names For example, object.__str__ is defined, but object.__bytes__ is not. By doing this, users will know which special methods user-defined classes will automatically inherit. ---------- assignee: docs@python components: Documentation messages: 175938 nosy: chris.jerdonek, docs@python, eric.araujo, ezio.melotti, georg.brandl priority: normal severity: normal status: open title: include the "object" type in the lists of documented types type: enhancement versions: Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16508> _______________________________________
Changes by Chris Jerdonek <chris.jerdonek@gmail.com>: ---------- assignee: docs@python -> chris.jerdonek _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16508> _______________________________________
Changes by Ezio Melotti <ezio.melotti@gmail.com>: ---------- stage: -> needs patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16508> _______________________________________
Terry J. Reedy added the comment: good idea ---------- nosy: +terry.reedy _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16508> _______________________________________
Changes by Ethan Furman <ethan@stoneleaf.us>: ---------- nosy: +ethan.furman _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16508> _______________________________________
Changes by M. Volz <marielle@gmail.com>: ---------- nosy: +mvolz _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16508> _______________________________________
Éric Araujo added the comment: I think there was another issue discussing a separation between object.__str__ and someobject.__bytes__, to make it clear which are existing methods of the object class and which are methods that one may implement in their classes. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16508> _______________________________________
R. David Murray added the comment: Doing this is going to be a bit tricky, since currently links like :meth:`object.__format__` go to the special methods section. So I think making the distinction between available special methods and ones that object implements will need to be done at the same time as this, and there may be quite a few places in the documentation where reference will need to be changed. ---------- nosy: +r.david.murray _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16508> _______________________________________
Terry J. Reedy added the comment: What does not help is that help(ob) omits all the methods inherited from object, *even when ob is object*. See #20285. ---------- versions: -Python 3.2 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16508> _______________________________________
Changes by Ethan Furman <ethan@stoneleaf.us>: ---------- nosy: -ethan.furman _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16508> _______________________________________
Martin Panter added the comment: Here is a patch. Perhaps it is what you had in mind. I added quick mentions of the “object” class to The Standard Type Hierarchy and Other Built-in Types. I added documentation of what the object class’s own implementations do where it provides them. I added sentences pointing out that other methods are not provided by the object class, where I thought it may not already be clear. I also added a test case to check that various methods exist or not, to match the documentation. ---------- keywords: +patch nosy: +vadmium stage: needs patch -> patch review versions: +Python 3.5, Python 3.6 -Python 3.3 Added file: http://bugs.python.org/file40066/object-type.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16508> _______________________________________
participants (8)
-
Chris Jerdonek
-
Ethan Furman
-
Ezio Melotti
-
M. Volz
-
Martin Panter
-
R. David Murray
-
Terry J. Reedy
-
Éric Araujo