Skip to content

[red-knot] support typing.NoReturn and typing.Never in annotations #14558

@Glyphack

Description

@Glyphack

(part of #14172 created to claim the task)

NoReturn and Never are synonyms. They can both be mapped to Type::Never.
We can have a boolean flag on the Type::Never to indicate if this was a Never or NoReturn Although this is only useful for showing the type.

Assignability

https://github.com/python/typing/blob/main/conformance/tests/specialtypes_never.py#L64

  • Never is assignable to other types
  • Only Never and Any are assignable to Never

Metadata

Metadata

Assignees

No one assigned

    Labels

    tyMulti-file analysis & type inference

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions