Skip to content

uWSGI: Use a TypeVarTuple in uwsgidecorators.thread#11128

Merged
srittau merged 6 commits intopython:mainfrom
Daverball:uwsgi-thread-typevartuple
Mar 30, 2026
Merged

uWSGI: Use a TypeVarTuple in uwsgidecorators.thread#11128
srittau merged 6 commits intopython:mainfrom
Daverball:uwsgi-thread-typevartuple

Conversation

@Daverball
Copy link
Copy Markdown
Contributor

@Daverball Daverball commented Dec 9, 2023

This addresses one of the FIXME comments (and a stubtest_allowlist entry) in types-uWSGI

@github-actions

This comment has been minimized.

@Daverball
Copy link
Copy Markdown
Contributor Author

Looks like pytype isn't happy with the use of a TypeVarTuple in a generic class yet.

@AlexWaygood AlexWaygood added the status: deferred Issue or PR deferred until some precondition is fixed label Dec 9, 2023
@JelleZijlstra
Copy link
Copy Markdown
Member

Is there a pytype issue we can refer to that tracks the necessary support?

@github-actions

This comment has been minimized.

@AlexWaygood
Copy link
Copy Markdown
Member

AlexWaygood commented Feb 17, 2024

Is there a pytype issue we can refer to that tracks the necessary support?

The issue is that pytype doesn't yet support classes being generic over Unpack[Ts]. I don't think pytype has a more specific issue for that than google/pytype#1525.

When we use Unpack[Ts] for a parameter annotation, pytype just falls back to Any, but it doesn't yet do that if a class is generic over Unpack[Ts]. I can think of reasons why that might be a little harder to do, but I don't know that it actually is harder.

@Daverball
Copy link
Copy Markdown
Contributor Author

Daverball commented Feb 17, 2024

The reason it's harder is that the generic now needs to be able to accept multiple values instead of just one, as well as some of the other special rules, such as not requiring redundant brackets. So I can see why there is maybe no easy way to add partial support for it, except for maybe the most simple case, where a generic accepts a single TypeVarTuple and nothing else, re-using the tuple logic 1:1.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@Avasam
Copy link
Copy Markdown
Collaborator

Avasam commented Jul 30, 2025

We have removed support for pytype, so I'll also remove the deferred status

@Avasam Avasam removed the status: deferred Issue or PR deferred until some precondition is fixed label Jul 30, 2025
@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Copy Markdown
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took a few days, but LGTM. Thanks!

@srittau srittau merged commit ccf9411 into python:main Mar 30, 2026
39 checks passed
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.

5 participants