-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Types: don't leave generic types without a parameter #2401
Types: don't leave generic types without a parameter #2401
Conversation
b8f7c68
to
62c6d44
Compare
I'm really interested in the patterns you used for decorators by using |
Also, I usually consider typing changes bug fixes, so you can retarget this to 8.1.x (although I may just make the next release 8.2 anyway). |
Sure: ParamSpec and Concatenate are defined in PEP 612 – Parameter Specification Variables. |
I wasn't aware I targeted anything :-D I found the |
You can rebase to the 8.1.x branch then change the PR target. Yeah, just add a section for another unreleased version, or I can handle the changelog. |
244aac2
to
c4bbc9f
Compare
c4bbc9f
to
71f8806
Compare
Check, done. It's better to change the PR target first and then push a rebased set of commits, as the github checks won't be re-run on a PR target change. I had to force a new commit SHA so I could force-push again and trigger the pipeline. ;-) |
Having the I'm currently doing this as part of my unit tests, but I was also looking into creating a PR similar to this one before I saw it already exists. I will definitely be testing this PR in development going forward. |
71f8806
to
d4818a7
Compare
Enable `disallow_any_generics` and provide type information for missing parameters for type hints.
Clean out a series of ignores, either by specifying types or by reworking code slightly the ignore is no longer needed.
A combination of overloads, TypeVar, ParamSpec and Concatenate make it possible to tell the type checker more about what kinds of callables are expected and what is being returned.
d4818a7
to
9afe27e
Compare
Enable
disallow_any_generics
and provide type information for missing parameters for type hints.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.