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
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
DOCS.PYTHON.ORG
Built-in Types
The following sections describe the standard types that are built into the interpreter. The principal built-in types are numerics, sequences, mappings, classes, instances and exceptions. Some colle...
0 Yorumlar 0 hisse senetleri 1323 Views