Issue 16508: include the "object" type in the lists of documented types
Created on 2012-11-19 00:14 by chris.jerdonek, last changed 2022-04-11 14:57 by admin.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| object-type.patch | martin.panter, 2015-07-30 12:43 | review | ||
| Messages (6) | |||
|---|---|---|---|
| msg175938 - (view) | Author: Chris Jerdonek (chris.jerdonek) * ![]() |
Date: 2012-11-19 00:14 | |
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-hierarchy 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. |
|||
| msg176235 - (view) | Author: Terry J. Reedy (terry.reedy) * ![]() |
Date: 2012-11-23 20:11 | |
good idea |
|||
| msg213058 - (view) | Author: Éric Araujo (eric.araujo) * ![]() |
Date: 2014-03-10 18:26 | |
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. |
|||
| msg213267 - (view) | Author: R. David Murray (r.david.murray) * ![]() |
Date: 2014-03-12 15:54 | |
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. |
|||
| msg213335 - (view) | Author: Terry J. Reedy (terry.reedy) * ![]() |
Date: 2014-03-12 23:45 | |
What does not help is that help(ob) omits all the methods inherited from object, *even when ob is object*. See #20285. |
|||
| msg247663 - (view) | Author: Martin Panter (martin.panter) * ![]() |
Date: 2015-07-30 12:43 | |
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. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:57:38 | admin | set | github: 60712 |
| 2015-07-30 12:43:07 | martin.panter | set | files:
+ object-type.patch versions:
+ Python 3.5, Python 3.6, - Python 3.3 messages:
+ msg247663 |
| 2015-07-21 08:05:49 | ethan.furman | set | nosy:
- ethan.furman |
| 2014-03-12 23:45:24 | terry.reedy | set | messages:
+ msg213335 versions: - Python 3.2 |
| 2014-03-12 15:54:26 | r.david.murray | set | nosy:
+ r.david.murray messages: + msg213267 |
| 2014-03-10 18:26:10 | eric.araujo | set | messages: + msg213058 |
| 2014-03-09 23:33:43 | mvolz | set | nosy:
+ mvolz |
| 2014-01-11 23:23:32 | ethan.furman | set | nosy:
+ ethan.furman |
| 2012-11-23 20:11:17 | terry.reedy | set | nosy:
+ terry.reedy messages: + msg176235 |
| 2012-11-23 17:16:43 | ezio.melotti | set | stage: needs patch |
| 2012-11-20 07:39:47 | chris.jerdonek | set | assignee: docs@python -> chris.jerdonek |
| 2012-11-19 00:14:41 | chris.jerdonek | create | |
