Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python mypy cast

from typing import cast, List

o: object = [1]
x = cast(List[int], o)  # OK
y = cast(List[str], o)  # OK (cast performs no actual runtime check)
 
PREVIOUS NEXT
Tagged: #python #mypy #cast
ADD COMMENT
Topic
Name
3+1 =