Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

NewType documentation is incorrect  #11620

Copy link
Copy link
@AlexWaygood

Description

@AlexWaygood
Issue body actions

The documentation for NewType at https://mypy.readthedocs.io/en/stable/more_types.html#newtypes states:

...the typing module provides a helper function NewType that creates simple unique types with almost zero runtime overhead.

However, as the cpython documentation for NewType` states:

Changed in version 3.10: NewType is now a class rather than a function. There is some additional runtime cost when calling NewType over a regular function. However, this cost will be reduced in 3.11.0.

In Python >=3.10, NewType is a class rather than a function, meaning the mypy documentation is now incorrect.

I'm not immediately sure how it could be rewritten in a more accurate way that is still concise, however.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.