-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Use t.Mapping not t.Dict for parameters #2265
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @altendky , Thanks for the PR and sorry for the long delay!
This PR makes sense to me. I fixed some merging issues and we are ready to merge.
The only thing that I think worth fine tuning is the change note. I wrote a suggestion, but if you have better one - please feel free to paraphrase.
After this is fixed, we could merge!
Your suggestion reads well to me. Thanks for your interest and effort on this. |
I'm now rethinking that this PR might should be merged into 8.1.x instead of main. @davidism , I would appriciate your input on it. |
Yes, this can go in 8.1.x. |
https://docs.python.org/3/library/typing.html#typing.Dict > To annotate arguments it is preferred to use an abstract collection type such as Mapping.
for more information, see https://pre-commit.ci
735210b
to
d45fd9d
Compare
I changed the target branch and reworked the commits history. This is now ready to be merged. Thanks @altendky again for the PR. I hope to see more of your contributions and the future. |
https://docs.python.org/3/library/typing.html#typing.Dict
This PR does almost that to fix the issue below. I instead use
MutableMapping
here since we do mutate in some cases. I chose to useMutableMapping
everywhere for consistency and leaving it open for more mutation in the future. I understand that this may not be preferred and would be happy to useMapping
where possible instead.It was suggested I could follow #2256 as a guide for how much of this checklist applies to hint-only changes. As such some have been skipped.
Checklist:
CHANGES.rst
summarizing the change and linking to the issue... versionchanged::
entries in any relevant code docs.pre-commit
hooks and fix any issues.pytest
andtox
, no tests failed.