intermediate python lesson 3: Final Exercise: Runtime Type Checker
Runtime Type Checker
Functions in Python can be optionally annotated by semantically-useless but structurally-valuable type annotations. For example:
def foo(a: int, b: str) -> bool:
return b[a] == 'X'
foo.__annotations__ # => {'a': int, 'b': str...
philipdevblog.hashnode.dev3 min read