uWSGI: Use a `TypeVarTuple` in `uwsgidecorators.thread`
This addresses one of the FIXME comments (and a stubtest_allowlist entry) in types-uWSGI
Deferral reason: https://github.com/google/pytype/issues/1525
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉
Looks like pytype isn't happy with the use of a TypeVarTuple in a generic class yet.
Is there a pytype issue we can refer to that tracks the necessary support?
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉
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 https://github.com/google/pytype/issues/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.
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.