Answers for "python mypy cast"

0

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)
Posted by: Guest on August-18-2021

Python Answers by Framework

Browse Popular Code Answers by Language