[issue33300] Bad usage example in id() DocString
New submission from Glen Neff <gneff@trioptimum.com>: 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.)
---------- assignee: docs@python components: Documentation messages: 315410 nosy: docs@python, gneff priority: normal severity: normal status: open title: Bad usage example in id() DocString versions: Python 3.5, Python 3.6 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue33300> _______________________________________
Martin Panter <vadmium+py@gmail.com> added the comment: 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 Issue 21314. ---------- nosy: +martin.panter superseder: -> Document '/' in signatures _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue33300> _______________________________________
Change by Martin Panter <vadmium+py@gmail.com>: ---------- resolution: -> duplicate status: open -> pending _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue33300> _______________________________________
Change by Irit Katriel <iritkatriel@yahoo.com>: ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue33300> _______________________________________
participants (3)
-
Glen Neff
-
Irit Katriel
-
Martin Panter