5 ms·
I was referring to defining optional keys. If you have a dict with some keys which are optional, you need to create a separate subclass (with `total=False`) ju
by avremel 7y ago
I was referring to defining optional keys.
If you have a dict with some keys which are optional, you need to create a separate subclass (with `total=False`) just for those optional keys.
With TypeScript, I can just use `key?: type`.
https://mypy.readthedocs.io/en/latest/more_types.html#mixing-required-and-non-required-items https://mypy.readthedocs.io/en/latest/more_types.html#mixing...