question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Evolvers are missing keys(), values(), and items()

See original GitHub issue

The evolvers are typed as being Mappings, 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tobgucommented, Mar 13, 2019

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!

0reactions
nattofriendscommented, May 16, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found