typing.assert_type(val, typ, /) 호출을 확인하고 val의 추론된 타입이 typ이 아닌 경우를 보고합니다.
typing.assert_type(val, typ, /)
val
typ
예:
def greet(name: str) -> None: assert_type(name, str) # OK assert_type(name, int) # 필요한 타입: 'int'. 대신 'str'이 전달됨