####  Aliases to built-in types  Â¶

_ class  _ typing.  Dict  (  _ dict,  MutableMapping[KT,  VT]  _ )  Â¶

    

Deprecated alias to [ ` dict  ` ](stdtypes.html#dict "dict") .

Note that to annotate arguments, it is preferred to use an abstract collection
type such as  ` Mapping  ` rather than to use [ ` dict  ` ](stdtypes.html#dict
"dict") or ` typing.Dict  ` .

This type can be used as follows:

    
    
    def count_words(text: str) -> Dict[str, int]:
        ...
    

Deprecated since version 3.9:  [ ` builtins.dict  ` ](stdtypes.html#dict
"dict") now supports subscripting ( ` []  ` ). See  [ **PEP 585**
](https://peps.python.org/pep-0585/) and [ Generic Alias Type
](stdtypes.html#types-genericalias) .

_ class  _ typing.  List  (  _ list,  MutableSequence[T]  _ )  Â¶

    

Deprecated alias to [ ` list  ` ](stdtypes.html#list "list") .

Note that to annotate arguments, it is preferred to use an abstract collection
type such as  ` Sequence  ` or  ` Iterable  ` rather than to use [ ` list  `
](stdtypes.html#list "list") or ` typing.List  ` .

This type may be used as follows:

    
    
    def vec2[T: (int, float)](x: T, y: T) -> List[T]:
        return [x, y]
    
    def keep_positives[T: (int, float)](vector: Sequence[T]) -> List[T]:
        return [item for item in vector if item > 0]
    

Deprecated since version 3.9:  [ ` builtins.list  ` ](stdtypes.html#list
"list") now supports subscripting ( ` []  ` ). See  [ **PEP 585**
](https://peps.python.org/pep-0585/) and [ Generic Alias Type
](stdtypes.html#types-genericalias) .

_ class  _ typing.  Set  (  _ set,  MutableSet[T]  _ )  Â¶

    

Deprecated alias to [ ` builtins.set  ` ](stdtypes.html#set "set") .

Note that to annotate arguments, it is preferred to use an abstract collection
type such as  ` AbstractSet  ` rather than to use [ ` set  `
](stdtypes.html#set "set") or ` typing.Set  ` .

Deprecated since version 3.9:  [ ` builtins.set  ` ](stdtypes.html#set "set")
now supports subscripting ( ` []  ` ). See  [ **PEP 585**
](https://peps.python.org/pep-0585/) and [ Generic Alias Type
](stdtypes.html#types-genericalias) .

_ class  _ typing.  FrozenSet  (  _ frozenset,  AbstractSet[T_co]  _ )  Â¶

    

Deprecated alias to [ ` builtins.frozenset  ` ](stdtypes.html#frozenset
"frozenset") .

Deprecated since version 3.9:  [ ` builtins.frozenset  `
](stdtypes.html#frozenset "frozenset") now supports subscripting ( ` []  ` ).
See  [ **PEP 585** ](https://peps.python.org/pep-0585/) and [ Generic Alias
Type  ](stdtypes.html#types-genericalias) .

typing.  Tuple  Â¶

    

Deprecated alias for [ ` tuple  ` ](stdtypes.html#tuple "tuple") .

[ ` tuple  ` ](stdtypes.html#tuple "tuple") and ` Tuple  ` are special-cased
in the type system; see  Annotating tuples  for more details.

Deprecated since version 3.9:  [ ` builtins.tuple  ` ](stdtypes.html#tuple
"tuple") now supports subscripting ( ` []  ` ). See  [ **PEP 585**
](https://peps.python.org/pep-0585/) and [ Generic Alias Type
](stdtypes.html#types-genericalias) .

_ class  _ typing.  Type  (  _ Generic[CT_co]  _ )  Â¶

    

Deprecated alias to [ ` type  ` ](functions.html#type "type") .

See  The type of class objects  for details on using [ ` type  `
](functions.html#type "type") or ` typing.Type  ` in type annotations.

New in version 3.5.2.

Deprecated since version 3.9:  [ ` builtins.type  ` ](functions.html#type
"type") now supports subscripting ( ` []  ` ). See  [ **PEP 585**
](https://peps.python.org/pep-0585/) and [ Generic Alias Type
](stdtypes.html#types-genericalias) .