23 Oct
2020
23 Oct
'20
11:41 a.m.
On Fri, Oct 23, 2020, 1:28 PM Alex Hall
Breaking millions of lines of idiomatic code seems like a bad idea.
a, b, c = mydict
Mary not be so very common, but this is ubiquitous:
for k in mydict: ...
What I mean is that maybe `a, b = foo` could first test if `foo` is a mapping, use mapping unpacking if it is, otherwise fall back to regular iterable unpacking.
Unpacking *IS* iteration. You are suggesting adding brand new special semantics for this one case that breaks the conceptual model of Python. Also that still breaks quite a bit of existing code, even if not as much as the loop version.