Skip to content

(🎁) Special case NoReturn, Never, Self and TypeAlias to not be subscriptable #12375

Open
@KotlinIsland

Description

@KotlinIsland
from typing import NoReturn, Never, Self and TypeAlias

NoReturn[int]
Never[int]
Self[int]
TypeAlias[int]

All of these usages are a 'no error moment'.

These methods exist at runtime, but are noops that just raise TypeErrors (:trollface:)

I would expect warnings on any of these usaages especially Self as I could imagine every single person trying to use it with type parameters(it doesn't support type parameters 😢).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @hauntsaninja@KotlinIsland

        Issue actions

          (🎁) Special case `NoReturn`, `Never`, `Self` and `TypeAlias` to not be subscriptable · Issue #12375 · python/mypy