Skip to content

Bad usage example in id() DocString #77481

Closed

Description

@gneff
mannequin
BPO 33300
Nosy @vadmium
Superseder
  • bpo-21314: Document '/' in signatures
  • 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 = None
    closed_at = <Date 2020-10-31.15:16:34.171>
    created_at = <Date 2018-04-17.20:02:15.239>
    labels = ['docs']
    title = 'Bad usage example in id() DocString'
    updated_at = <Date 2020-10-31.15:16:34.171>
    user = 'https://bugs.python.org/gneff'

    bugs.python.org fields:

    activity = <Date 2020-10-31.15:16:34.171>
    actor = 'iritkatriel'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2020-10-31.15:16:34.171>
    closer = 'iritkatriel'
    components = ['Documentation']
    creation = <Date 2018-04-17.20:02:15.239>
    creator = 'gneff'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 33300
    keywords = []
    message_count = 2.0
    messages = ['315410', '315416']
    nosy_count = 3.0
    nosy_names = ['docs@python', 'martin.panter', 'gneff']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '21314'
    type = None
    url = 'https://bugs.python.org/issue33300'
    versions = ['Python 3.5', 'Python 3.6']

    Activity

    1. gneff commented on Apr 17, 2018

      gneffmannequin
      MannequinAuthor

      The DocString for id() in 3.5.x & 3.6.x seems to have an incorrect usage example, specifically id(obj, /).

      This is present in 3.5.x & 3.6.x. It does not appear to be present in 2.7.x or 3.4.x.:

      Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win32
      Type "help", "copyright", "credits" or "license" for more information.
      >>> help(id)
      Help on built-in function id in module builtins:
      id(obj, /)
          Return the identity of an object.
      This is guaranteed to be unique among simultaneously existing objects.
      (CPython uses the object's memory address.)
      

      >>

    2. added
      docsDocumentation in the Doc dir
      on Apr 17, 2018
    3. vadmium commented on Apr 17, 2018

      @vadmium
      Member

      It is supposed to be a function signature, similar to the syntax when you define your own function, rather than a usage example of calling the function.

      In this case, the slash notation is described by PEP-457. It is supposed to indicate that “obj” is a positional-only parameter, and not a keyword parameter. If that is what you think is incorrect, perhaps you can suggest a place to explain the notation in bpo-21314.

    4. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      docsDocumentation in the Doc dir

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions