google / pytype

A static type analyzer for Python code
https://google.github.io/pytype
Other
4.72k stars 274 forks source link

Support PEP 646 - Variadic Generics #1525

Open rchen152 opened 10 months ago

rchen152 commented 10 months ago

https://peps.python.org/pep-0646/

AlexWaygood commented 9 months ago

As a first step, would it maybe be possible to have pytype gracefully fallback to Any if it sees Unpack[] being used in a type annotation? Currently using Unpack[] anywhere seems to make pytype crash, which is blocking a couple of typeshed PRs (https://github.com/python/typeshed/pull/11015, https://github.com/python/typeshed/pull/11014).

No worries if this is difficult to do, though; there's no great rush here in getting those typeshed PRs merged!

rchen152 commented 9 months ago

I can certainly give it a try.

rchen152 commented 9 months ago

Sorry, it took me a while to get to this. But I should be able to cut a release with a fix for the Unpack crash tomorrow or early next week.

AlexWaygood commented 9 months ago

No worries at all -- thanks so much!

rchen152 commented 9 months ago

Ok, version 2023.12.8 has the Unpack fix =)

AlexWaygood commented 9 months ago

Ok, version 2023.12.8 has the Unpack fix =)

Thank you so much — both the typeshed changes have been merged now <3