https://docs.python.org/3/library/stdtypes.html#generic-alias-type
"The Python runtime does not enforce type annotations. This extends to generic types and their type parameters. When creating a container object from a GenericAlias, the elements in the container are not checked against their type. For example, the following code is discouraged, but will run without errors:
>>> t = list[str]
>>> t([1, 2, 3])
[1, 2, 3]"
#python
"The Python runtime does not enforce type annotations. This extends to generic types and their type parameters. When creating a container object from a GenericAlias, the elements in the container are not checked against their type. For example, the following code is discouraged, but will run without errors:
>>> t = list[str]
>>> t([1, 2, 3])
[1, 2, 3]"
#python
https://docs.python.org/3/library/stdtypes.html#generic-alias-type
"The Python runtime does not enforce type annotations. This extends to generic types and their type parameters. When creating a container object from a GenericAlias, the elements in the container are not checked against their type. For example, the following code is discouraged, but will run without errors:
>>> t = list[str]
>>> t([1, 2, 3])
[1, 2, 3]"
#python
0 Comentários
0 Compartilhamentos
1461 Visualizações