Skip to content
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

Clarify variance convention for Parameters #16302

Merged
merged 3 commits into from
Oct 23, 2023

Conversation

ilevkivskyi
Copy link
Member

Fixes #16296

In my big refactoring I flipped the variance convention for the Parameters type, but I did it inconsistently in one place. After working some more with ParamSpecs, it now seems to me the original convention is easier to remember. I also now explicitly put it in the type docstring.

@hauntsaninja Not 100% sure, but this may be important enough for 1.6.2.

mypy/types.py Outdated Show resolved Hide resolved
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

discord.py (https://github.com/Rapptz/discord.py)
+ discord/ext/commands/core.py:637: error: Unused "type: ignore" comment  [unused-ignore]
- discord/ext/commands/core.py:639: error: Argument 1 has incompatible type "CogT"; expected Never  [arg-type]
- discord/ext/commands/core.py:639: error: Argument 2 has incompatible type "Context[BotT]"; expected Never  [arg-type]
- discord/ext/commands/core.py:639: error: Argument 3 has incompatible type "CommandError"; expected Never  [arg-type]

@hauntsaninja hauntsaninja merged commit cda163d into python:master Oct 23, 2023
18 checks passed
@hauntsaninja
Copy link
Collaborator

I'll see if it gets reported again... Jukka said he'd make 1.7 release soon so may not be worth it

@ilevkivskyi ilevkivskyi deleted the fix-paramspec-subtyping-v branch October 23, 2023 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(🐞) [1.6 regression] Can not infer ParamSpec
3 participants