You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeVars aren't iterable, but their bounds might be!
Resolve a TypeVar to its bounds before trying to decide how to unpack
one of its instances.
Fixespython#13402.
* Allow unpacking from TypeVars by resolving bounds
TypeVars aren't iterable, but their bounds might be!
Resolve a TypeVar to its bounds before trying to decide how to unpack
one of its instances.
Fixes#13402.
* Allow unpacking from TypeVars by resolving bounds
TypeVars aren't iterable, but their bounds might be!
Resolve a TypeVar to its bounds before trying to decide how to unpack
one of its instances.
Fixespython#13402.
…13425) (#13644)
TypeVars aren't iterable, but their bounds might be! Resolve a TypeVar
to its bounds before trying to decide how to unpack one of its
instances.
Fixes#13402
Co-authored-by: Tim D. Smith <github@tim-smith.us>
Bug Report
Instances of type variables bounded by an iterable type support iteration but not unpacking.
To Reproduce
Bounding the TypeVar by
list[A]
has the same behaviour as bounding it bytuple[A, ...]
.Expected Behavior
No error -- an ATuple should support both iteration and unpacking.
Actual Behavior
f() checks clean.
In g(), unpacking fails with:
error: "ATuple" object is not iterable
error: Cannot determine type of "a"
Your Environment
This reproduces in all versions in the playground.
The text was updated successfully, but these errors were encountered: