Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Missing "/" in function signatures of the rst docs of stdlib (e.g. the math module) #101118

Closed as not planned
@skirpichev

Description

@skirpichev

after PEP 570, there is a syntax to specify positional-only parameters in the function definition. Unfortunately, most stdlib modules ignore this (the os module seems to be an exception). The math module is an example. While

>>> inspect.signature(math.ceil)
<Signature (x, /)>

the module docs display the function signature as math.ceil(x), that is wrong:

>>> math.ceil(x=3.14)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: math.ceil() takes no keyword arguments

Linked PRs

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