I think that instead of dict unpacking specifically, what we need is to come up
with a way to use the pattern-matching proposed in PEP 634 outside of match
statements. This would make it possible to unpack any pattern.
My opinion is that the walrus operator is practically waiting to support
pattern-matching:
if Response(status=200, json={"title": title}) := get('/posts/42'):
print(title)
I wrote a few more examples here:
-
https://mail.python.org/archives/list/[email protected]/thread/MJ7JHYKHKB2T4SCFV4TX4IMKUANUAF5B/
--
Valentin
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/ZWFMZH7QCOQHXPFGHAWOI74OSUAPCWGL/
Code of Conduct: http://python.org/psf/codeofconduct/