Skip to content

format_map over specified #3824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jaraco opened this issue Mar 6, 2020 · 3 comments · Fixed by #4122
Closed

format_map over specified #3824

jaraco opened this issue Mar 6, 2020 · 3 comments · Fixed by #4122

Comments

@jaraco
Copy link
Member

jaraco commented Mar 6, 2020

The definition of format_map indicates that the input is a Mapping[str, Any] when a Mapping is over-specified. format_map only requires the __getitem__ interface of a Mapping (not __iter__ nor __len__). Requiring Mapping forces someone writing an adapter to supply a full Mapping implementation for no purpose.

@JelleZijlstra
Copy link
Member

Feel free to submit a PR changing the argument type to a Protocol that just has __getitem__.

@djb4ai
Copy link
Contributor

djb4ai commented Mar 22, 2020

@jaraco Are you working on this?

@jaraco
Copy link
Member Author

jaraco commented Mar 22, 2020

I am not. I would be delighted if someone else would work on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants