|
|
|
|
|
by JackSlateur
331 days ago
|
|
Typing is declarative In the end, it ensures nothing and accepts everything $ cat test.py
from typing import TypedDict
class MyDict(TypedDict):
some_bool: bool
print(MyDict(some_bool="test", unknown_field="blabla"))
=> $ ./test.py
{'some_bool': 'test', 'unknown_field': 'blabla'}
|
|