Skip to content

Include the "object" type in the lists of documented types #60712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cjerdonek opened this issue Nov 19, 2012 · 8 comments
Closed

Include the "object" type in the lists of documented types #60712

cjerdonek opened this issue Nov 19, 2012 · 8 comments
Assignees
Labels
docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@cjerdonek
Copy link
Member

cjerdonek commented Nov 19, 2012

BPO 16508
Nosy @birkenfeld, @terryjreedy, @ezio-melotti, @merwok, @bitdancer, @cjerdonek, @vadmium
Files
  • object-type.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/cjerdonek'
    closed_at = None
    created_at = <Date 2012-11-19.00:14:41.072>
    labels = ['type-feature', 'docs']
    title = 'include the "object" type in the lists of documented types'
    updated_at = <Date 2015-07-30.12:43:07.495>
    user = 'https://github.com/cjerdonek'

    bugs.python.org fields:

    activity = <Date 2015-07-30.12:43:07.495>
    actor = 'martin.panter'
    assignee = 'chris.jerdonek'
    closed = False
    closed_date = None
    closer = None
    components = ['Documentation']
    creation = <Date 2012-11-19.00:14:41.072>
    creator = 'chris.jerdonek'
    dependencies = []
    files = ['40066']
    hgrepos = []
    issue_num = 16508
    keywords = ['patch']
    message_count = 6.0
    messages = ['175938', '176235', '213058', '213267', '213335', '247663']
    nosy_count = 9.0
    nosy_names = ['georg.brandl', 'terry.reedy', 'ezio.melotti', 'eric.araujo', 'r.david.murray', 'chris.jerdonek', 'docs@python', 'martin.panter', 'mvolz']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue16508'
    versions = ['Python 3.4', 'Python 3.5', 'Python 3.6']

    Linked PRs

    @cjerdonek
    Copy link
    Member Author

    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.

    @cjerdonek cjerdonek added docs Documentation in the Doc dir type-feature A feature request or enhancement labels Nov 19, 2012
    @cjerdonek cjerdonek assigned cjerdonek and unassigned docspython Nov 20, 2012
    @terryjreedy
    Copy link
    Member

    good idea

    @merwok
    Copy link
    Member

    merwok commented Mar 10, 2014

    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.

    @bitdancer
    Copy link
    Member

    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.

    @terryjreedy
    Copy link
    Member

    terryjreedy commented Mar 12, 2014

    What does not help is that help(ob) omits all the methods inherited from object, *even when ob is object*. See #64484.

    @vadmium
    Copy link
    Member

    vadmium commented Jul 30, 2015

    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.

    @furkanonder
    Copy link
    Contributor

    The PR is ready for review.

    @terryjreedy terryjreedy changed the title include the "object" type in the lists of documented types Include the "object" type in the lists of documented types Mar 29, 2023
    willingc added a commit that referenced this issue Oct 30, 2024
    …H-103036)
    
    * add test for the predefined object's attributes
    
    * Include the "object" type in the lists of documented types
    
    * remove 'or' from augment tuple
    
    * 📜🤖 Added by blurb_it.
    
    * Add cross-reference to news
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * Fix format for the function parameter
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * Add space
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * add reference for the 'object'
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * add reference for NotImplemented
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * Change ref:`string <textseq>`  as class:`str`
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * remove hyphen from `newly-created`
    
    * Update Doc/reference/datamodel.rst
    
    'dictionaries' to 'dict'
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * Update predefined attribute types in testPredefinedAttrs
    
    * Change `universal type` as `top type`
    
    * Don't mention about the top type
    
    * Update the description of richcmpfuncs
    
    * Update Doc/library/stdtypes.rst
    
    Co-authored-by: Éric <[email protected]>
    
    * Revert: Hierarchy Section in Data Model Documentation
    
    * Revert to original explanations of __new__ and __init__ methods in datamodel.rst for improved clarity.
    
    * Update Doc/reference/datamodel.rst
    
    Co-authored-by: Éric <[email protected]>
    
    * Remove blank line
    
    Co-authored-by: Éric <[email protected]>
    
    * Use ref:`str <textseq>` instead of :class:`str
    
    Co-authored-by: Éric <[email protected]>
    
    * Revert changes the description of Other Built-in Types in stdtypes.rst
    
    * Update Doc/reference/datamodel.rst
    
    Co-authored-by: Éric <[email protected]>
    
    ---------
    
    Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    Co-authored-by: Terry Jan Reedy <[email protected]>
    Co-authored-by: Éric <[email protected]>
    Co-authored-by: Carol Willing <[email protected]>
    miss-islington pushed a commit to miss-islington/cpython that referenced this issue Oct 30, 2024
    …types (pythonGH-103036)
    
    * add test for the predefined object's attributes
    
    * Include the "object" type in the lists of documented types
    
    * remove 'or' from augment tuple
    
    * 📜🤖 Added by blurb_it.
    
    * Add cross-reference to news
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * Fix format for the function parameter
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * Add space
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * add reference for the 'object'
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * add reference for NotImplemented
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * Change ref:`string <textseq>`  as class:`str`
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * remove hyphen from `newly-created`
    
    * Update Doc/reference/datamodel.rst
    
    'dictionaries' to 'dict'
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * Update predefined attribute types in testPredefinedAttrs
    
    * Change `universal type` as `top type`
    
    * Don't mention about the top type
    
    * Update the description of richcmpfuncs
    
    * Update Doc/library/stdtypes.rst
    
    Co-authored-by: Éric <[email protected]>
    
    * Revert: Hierarchy Section in Data Model Documentation
    
    * Revert to original explanations of __new__ and __init__ methods in datamodel.rst for improved clarity.
    
    * Update Doc/reference/datamodel.rst
    
    Co-authored-by: Éric <[email protected]>
    
    * Remove blank line
    
    Co-authored-by: Éric <[email protected]>
    
    * Use ref:`str <textseq>` instead of :class:`str
    
    Co-authored-by: Éric <[email protected]>
    
    * Revert changes the description of Other Built-in Types in stdtypes.rst
    
    * Update Doc/reference/datamodel.rst
    
    Co-authored-by: Éric <[email protected]>
    
    ---------
    
    (cherry picked from commit 4f82621)
    
    Co-authored-by: Furkan Onder <[email protected]>
    Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    Co-authored-by: Terry Jan Reedy <[email protected]>
    Co-authored-by: Éric <[email protected]>
    Co-authored-by: Carol Willing <[email protected]>
    miss-islington pushed a commit to miss-islington/cpython that referenced this issue Oct 30, 2024
    …types (pythonGH-103036)
    
    * add test for the predefined object's attributes
    
    * Include the "object" type in the lists of documented types
    
    * remove 'or' from augment tuple
    
    * 📜🤖 Added by blurb_it.
    
    * Add cross-reference to news
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * Fix format for the function parameter
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * Add space
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * add reference for the 'object'
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * add reference for NotImplemented
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * Change ref:`string <textseq>`  as class:`str`
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * remove hyphen from `newly-created`
    
    * Update Doc/reference/datamodel.rst
    
    'dictionaries' to 'dict'
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * Update predefined attribute types in testPredefinedAttrs
    
    * Change `universal type` as `top type`
    
    * Don't mention about the top type
    
    * Update the description of richcmpfuncs
    
    * Update Doc/library/stdtypes.rst
    
    Co-authored-by: Éric <[email protected]>
    
    * Revert: Hierarchy Section in Data Model Documentation
    
    * Revert to original explanations of __new__ and __init__ methods in datamodel.rst for improved clarity.
    
    * Update Doc/reference/datamodel.rst
    
    Co-authored-by: Éric <[email protected]>
    
    * Remove blank line
    
    Co-authored-by: Éric <[email protected]>
    
    * Use ref:`str <textseq>` instead of :class:`str
    
    Co-authored-by: Éric <[email protected]>
    
    * Revert changes the description of Other Built-in Types in stdtypes.rst
    
    * Update Doc/reference/datamodel.rst
    
    Co-authored-by: Éric <[email protected]>
    
    ---------
    
    (cherry picked from commit 4f82621)
    
    Co-authored-by: Furkan Onder <[email protected]>
    Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    Co-authored-by: Terry Jan Reedy <[email protected]>
    Co-authored-by: Éric <[email protected]>
    Co-authored-by: Carol Willing <[email protected]>
    willingc added a commit that referenced this issue Oct 30, 2024
    … types (GH-103036) (GH-126198)
    
    gh-60712: Include the "object" type in the lists of documented types (GH-103036)
    
    * add test for the predefined object's attributes
    
    * Include the "object" type in the lists of documented types
    
    * remove 'or' from augment tuple
    
    * 📜🤖 Added by blurb_it.
    
    * Add cross-reference to news
    
    
    
    * Fix format for the function parameter
    
    
    
    * Add space
    
    
    
    * add reference for the 'object'
    
    
    
    * add reference for NotImplemented
    
    
    
    * Change ref:`string <textseq>`  as class:`str`
    
    
    
    * remove hyphen from `newly-created`
    
    * Update Doc/reference/datamodel.rst
    
    'dictionaries' to 'dict'
    
    
    
    * Update predefined attribute types in testPredefinedAttrs
    
    * Change `universal type` as `top type`
    
    * Don't mention about the top type
    
    * Update the description of richcmpfuncs
    
    * Update Doc/library/stdtypes.rst
    
    
    
    * Revert: Hierarchy Section in Data Model Documentation
    
    * Revert to original explanations of __new__ and __init__ methods in datamodel.rst for improved clarity.
    
    * Update Doc/reference/datamodel.rst
    
    
    
    * Remove blank line
    
    
    
    * Use ref:`str <textseq>` instead of :class:`str
    
    
    
    * Revert changes the description of Other Built-in Types in stdtypes.rst
    
    * Update Doc/reference/datamodel.rst
    
    
    
    ---------
    
    (cherry picked from commit 4f82621)
    
    Co-authored-by: Furkan Onder <[email protected]>
    Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    Co-authored-by: Terry Jan Reedy <[email protected]>
    Co-authored-by: Éric <[email protected]>
    Co-authored-by: Carol Willing <[email protected]>
    willingc added a commit that referenced this issue Oct 30, 2024
    … types (GH-103036) (GH-126197)
    
    gh-60712: Include the "object" type in the lists of documented types (GH-103036)
    
    * add test for the predefined object's attributes
    
    * Include the "object" type in the lists of documented types
    
    * remove 'or' from augment tuple
    
    * 📜🤖 Added by blurb_it.
    
    * Add cross-reference to news
    
    
    
    * Fix format for the function parameter
    
    
    
    * Add space
    
    
    
    * add reference for the 'object'
    
    
    
    * add reference for NotImplemented
    
    
    
    * Change ref:`string <textseq>`  as class:`str`
    
    
    
    * remove hyphen from `newly-created`
    
    * Update Doc/reference/datamodel.rst
    
    'dictionaries' to 'dict'
    
    
    
    * Update predefined attribute types in testPredefinedAttrs
    
    * Change `universal type` as `top type`
    
    * Don't mention about the top type
    
    * Update the description of richcmpfuncs
    
    * Update Doc/library/stdtypes.rst
    
    
    
    * Revert: Hierarchy Section in Data Model Documentation
    
    * Revert to original explanations of __new__ and __init__ methods in datamodel.rst for improved clarity.
    
    * Update Doc/reference/datamodel.rst
    
    
    
    * Remove blank line
    
    
    
    * Use ref:`str <textseq>` instead of :class:`str
    
    
    
    * Revert changes the description of Other Built-in Types in stdtypes.rst
    
    * Update Doc/reference/datamodel.rst
    
    
    
    ---------
    
    (cherry picked from commit 4f82621)
    
    Co-authored-by: Furkan Onder <[email protected]>
    Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    Co-authored-by: Terry Jan Reedy <[email protected]>
    Co-authored-by: Éric <[email protected]>
    Co-authored-by: Carol Willing <[email protected]>
    picnixz pushed a commit to picnixz/cpython that referenced this issue Dec 8, 2024
    …types (pythonGH-103036)
    
    * add test for the predefined object's attributes
    
    * Include the "object" type in the lists of documented types
    
    * remove 'or' from augment tuple
    
    * 📜🤖 Added by blurb_it.
    
    * Add cross-reference to news
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * Fix format for the function parameter
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * Add space
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * add reference for the 'object'
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * add reference for NotImplemented
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * Change ref:`string <textseq>`  as class:`str`
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * remove hyphen from `newly-created`
    
    * Update Doc/reference/datamodel.rst
    
    'dictionaries' to 'dict'
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * Update predefined attribute types in testPredefinedAttrs
    
    * Change `universal type` as `top type`
    
    * Don't mention about the top type
    
    * Update the description of richcmpfuncs
    
    * Update Doc/library/stdtypes.rst
    
    Co-authored-by: Éric <[email protected]>
    
    * Revert: Hierarchy Section in Data Model Documentation
    
    * Revert to original explanations of __new__ and __init__ methods in datamodel.rst for improved clarity.
    
    * Update Doc/reference/datamodel.rst
    
    Co-authored-by: Éric <[email protected]>
    
    * Remove blank line
    
    Co-authored-by: Éric <[email protected]>
    
    * Use ref:`str <textseq>` instead of :class:`str
    
    Co-authored-by: Éric <[email protected]>
    
    * Revert changes the description of Other Built-in Types in stdtypes.rst
    
    * Update Doc/reference/datamodel.rst
    
    Co-authored-by: Éric <[email protected]>
    
    ---------
    
    Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    Co-authored-by: Terry Jan Reedy <[email protected]>
    Co-authored-by: Éric <[email protected]>
    Co-authored-by: Carol Willing <[email protected]>
    ebonnal pushed a commit to ebonnal/cpython that referenced this issue Jan 12, 2025
    …types (pythonGH-103036)
    
    * add test for the predefined object's attributes
    
    * Include the "object" type in the lists of documented types
    
    * remove 'or' from augment tuple
    
    * 📜🤖 Added by blurb_it.
    
    * Add cross-reference to news
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * Fix format for the function parameter
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * Add space
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * add reference for the 'object'
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * add reference for NotImplemented
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * Change ref:`string <textseq>`  as class:`str`
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * remove hyphen from `newly-created`
    
    * Update Doc/reference/datamodel.rst
    
    'dictionaries' to 'dict'
    
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    
    * Update predefined attribute types in testPredefinedAttrs
    
    * Change `universal type` as `top type`
    
    * Don't mention about the top type
    
    * Update the description of richcmpfuncs
    
    * Update Doc/library/stdtypes.rst
    
    Co-authored-by: Éric <[email protected]>
    
    * Revert: Hierarchy Section in Data Model Documentation
    
    * Revert to original explanations of __new__ and __init__ methods in datamodel.rst for improved clarity.
    
    * Update Doc/reference/datamodel.rst
    
    Co-authored-by: Éric <[email protected]>
    
    * Remove blank line
    
    Co-authored-by: Éric <[email protected]>
    
    * Use ref:`str <textseq>` instead of :class:`str
    
    Co-authored-by: Éric <[email protected]>
    
    * Revert changes the description of Other Built-in Types in stdtypes.rst
    
    * Update Doc/reference/datamodel.rst
    
    Co-authored-by: Éric <[email protected]>
    
    ---------
    
    Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
    Co-authored-by: C.A.M. Gerlach <[email protected]>
    Co-authored-by: Terry Jan Reedy <[email protected]>
    Co-authored-by: Éric <[email protected]>
    Co-authored-by: Carol Willing <[email protected]>
    @hugovk
    Copy link
    Member

    hugovk commented Feb 5, 2025

    Triage: PR merged and backported. Please re-open if there's more to do.

    @hugovk hugovk closed this as completed Feb 5, 2025
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    docs Documentation in the Doc dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    7 participants