Skip to content

Type annotations missing for assert_never? #1176

Closed
@bluenote10

Description

@bluenote10

According to tracking issue python/mypy#5818, assert_never was introduced in typing_extensions version 4.1.0. At runtime, this clearly seems to work, which I can verify via:

python -c "from typing_extensions import assert_never"

However if I type check the code with mypy it complains at the line of the import:

error: Module "typing_extensions" has no attribute "assert_never"

I'm not sure if this an issue with typing_extensions or mypy though.

In any case, assert_never is supposed to have runtime behavior (to raise an assertion), i.e., it is not something that is supposed to be hidden behind a TYPE_ASSERTION barrier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: otherOther topics not covered

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions