4 ms·
Also type hints for dictionaries with fixed keys: https://www.python.org/dev/peps/pep-0589/ https://www.python.org/dev/peps/pep-0589/ I know it's almost alway
by ohazi 7y ago
Also type hints for dictionaries with fixed keys:
https://www.python.org/dev/peps/pep-0589/ https://www.python.org/dev/peps/pep-0589/
I know it's almost always better to use objects for this, but tons of code still uses dictionaries as pseudo-objects. This should make bug hunting a lot easier.
- lxmcneill 7y agoHuh, was totally unaware of this. For me this has good implications for ingesting CSVs/.xlsx to dicts. Clean-ups / type hinting is required at times for dirtier documents.
- ben509 7y agoOh, nice! I'll have to add that to json-syntax.[1] [1]: https://pypi.org/project/json-syntax/ https://pypi.org/project/json-syntax/