gh-91162: Fix most generic type substitution test cases by mrahtz · Pull Request #92427 · python/cpython
@serhiy-storchaka Darn, I'd just finished this when I realised you'd also been working on the same thing in main...serhiy-storchaka:typing-subst-unpacked. I think the version in my branch uses more helper functions in a way that improves readability, but your version does things in a way that's more consistent with the new design of typing.py - and of course fixes a lot of the C stuff that my branch doesn't touch. How do you want to proceed here?
Quick summary of what's in this PR:
- Forbid the use of unpacked arguments unless the generic alias can take an arbitrary number of type parameters (as determined by checking for a TypeVarTuple in the parameter list)
- Unpack finite-length tuples in argument lists