[3.9] [doc] Use list[int] instead of List[int] (etc.) in a few more places (GH-22524) by miss-islington · Pull Request #22531 · python/cpython
class Starship: stats: ClassVar[Dict[str, int]] = {} # class variable stats: ClassVar[dict[str, int]] = {} # class variable damage: int = 10 # instance variable
:data:`ClassVar` accepts only types and cannot be further subscribed.
T = TypeVar('T') Vec = Annotated[List[Tuple[T, T]], MaxLen(10)] Vec = Annotated[list[tuple[T, T]], MaxLen(10)] V = Vec[int]
V == Annotated[List[Tuple[int, int]], MaxLen(10)] V == Annotated[list[tuple[int, int]], MaxLen(10)]
.. versionadded:: 3.9
A class used for internal typing representation of string forward references. For example, ``List["SomeClass"]`` is implicitly transformed into ``List[ForwardRef("SomeClass")]``. This class should not be instantiated by For example, ``list["SomeClass"]`` is implicitly transformed into ``list[ForwardRef("SomeClass")]``. This class should not be instantiated by a user, but may be used by introspection tools.
Constant