Skip to content

The explanation of "Annotating callable objects" section should be made better #145577

@hyperkai

Description

@hyperkai

Documentation

*Notes:

In the explanation of Annotating callable objects section, some words or sentence aren't clear, distinct, specific, concise and less common, and the word argument is misused, etc. So they should be corrected:

<Some examples>

The 1st one:

*Notes:

  • "has" is better than "takes" because "takes" sounds taking an argument but not parameter:

... a function that takes a single parameter of type int and returns a str.

... a function that has a single parameter of type int and returns a str.

The 2nd one:

*Notes:

  • Naming and calling [] "type specification" is more understandable than "subscription syntax".
  • "must" is enough for emphasis so "always" and "exactly" aren't needed, emphasizing too much.
  • "two objects" are better than "two values" because "two values" sounds actual values like v = "Hello"'s "Hello" so it's confusing while talking about types.
  • "parameter type list" is better than "argument list" because "parameter" is correct and "type list" is more specific and understandable.

The subscription syntax must always be used with exactly two values: the
argument list and the return type.

The type specification [] must have two objects, a parameter type list and return type.

etc.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions