Skip to content

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

Description

@cjerdonek
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

    Activity

    1. cjerdonek commented on Nov 19, 2012

      @cjerdonek
      MemberAuthor

      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.

    2. added
      docsDocumentation in the Doc dir
      type-featureA feature request or enhancement
      on Nov 19, 2012
    3. terryjreedy commented on Nov 23, 2012

      @terryjreedy
      Member

      good idea

    4. merwok commented on Mar 10, 2014

      @merwok
      Member

      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.

    5. bitdancer commented on Mar 12, 2014

      @bitdancer
      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.

    6. terryjreedy commented on Mar 12, 2014

      @terryjreedy
      Member

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

    7. vadmium commented on Jul 30, 2015

      @vadmium
      Member

      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.

    8. transferred this issue fromon Apr 10, 2022
    9. furkanonder commented on Mar 29, 2023

      @furkanonder
      Contributor

      The PR is ready for review.

    10. changed the title [-]include the "object" type in the lists of documented types[/-] [+]Include the "object" type in the lists of documented types[/+] on Mar 29, 2023
    11. added a commit that references this issue on Oct 30, 2024
    12. added 2 commits that reference this issue on Oct 30, 2024
    13. added 2 commits that reference this issue on Oct 30, 2024
    14. added a commit that references this issue on Dec 8, 2024
    15. added a commit that references this issue on Jan 12, 2025
    16. hugovk commented on Feb 5, 2025

      @hugovk
      Member

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

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    docsDocumentation in the Doc dirtype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions