Skip to content

Clarify variance convention for Parameters#16302

Merged
hauntsaninja merged 3 commits intopython:masterfrom
ilevkivskyi:fix-paramspec-subtyping-v
Oct 23, 2023
Merged

Clarify variance convention for Parameters#16302
hauntsaninja merged 3 commits intopython:masterfrom
ilevkivskyi:fix-paramspec-subtyping-v

Conversation

@ilevkivskyi
Copy link
Copy Markdown
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.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@github-actions
Copy link
Copy Markdown
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
@hauntsaninja
Copy link
Copy Markdown
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