Evolvers are missing keys(), values(), and items()
See original GitHub issueThe evolvers are typed as being Mapping
s, e.g. https://github.com/tobgu/pyrsistent/blob/master/pyrsistent/typing.pyi#L45, but they don’t support the Mapping
’s keys()
, values()
, and items()
methods
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Typed dicts with missing keys #2632 - python/mypy - GitHub
Schema evolution or versioning is a typical case where it seems natural to have missing keys with non- Optional values. If we add...
Read more >Handling missing keys in Python dictionaries - GeeksforGeeks
Method 1 : Using get(). get(key,def_val) method is useful when we have to check for the key. If the key is present, the...
Read more >What is the difference between dict.items() and dict.iteritems ...
items() returns a list of 2-tuples ( [(key, value), (key, value), ...] ), whereas dict.iteritems() is a generator that yields 2-tuples. The former...
Read more >[Solved] Create a Python dictionary that returns a list of values ...
Create a Python dictionary that returns a list of values for each key. The key can be whatever type you want. Design the...
Read more >defaultdict — Missing Keys Return a Default Value - PyMOTW
The standard dictionary includes the method setdefault() for retrieving a value and establishing a default if the value does not exist.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for reporting this! I’d say that the typing is incorrect rather than the evolvers. The evolvers are only exposing a minimal set of methods for mutation by design.
The types will be updated!
It is probably my incorrect understanding of Evolvers. If they don’t actually support everything in MutableMapping then we should remove that. Thanks for pointing this out.