gh-137191: Fix how type parameters are collected from `Protocol` and `Generic` bases with parameters by sobolevn · Pull Request #137281 · python/cpython · GitHub
Skip to content

gh-137191: Fix how type parameters are collected from Protocol and Generic bases with parameters#137281

Merged
sobolevn merged 3 commits into
python:mainfrom
sobolevn:issue-137191
Aug 3, 2025
Merged

gh-137191: Fix how type parameters are collected from Protocol and Generic bases with parameters#137281
sobolevn merged 3 commits into
python:mainfrom
sobolevn:issue-137191

Conversation

@sobolevn

@sobolevn sobolevn commented Jul 31, 2025

Copy link
Copy Markdown
Member

While fixing this problem, I've also noticed that code like

class ExtraTypeVars(P1[S], Protocol[T, T2]): ...

never produced any TypeError, it is in contrast to

class ExtraTypeVars(P1[S], Generic[T, T2]): ...

which produced this error as it should. I've fixed this as well.

@sobolevn sobolevn added the 3.15 pre-release feature fixes, bugs and security fixes label Jul 31, 2025
Comment thread Lib/typing.py Outdated
@sobolevn

Copy link
Copy Markdown
Member Author

@sobolevn

sobolevn commented Aug 3, 2025

Copy link
Copy Markdown
Member Author

Looks like there are no objections / suggestions. Merging!

@sobolevn sobolevn merged commit 158b28d into python:main Aug 3, 2025
45 checks passed
@bedevere-bot

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.15 pre-release feature fixes, bugs and security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants