While we're on the subject of assignment expression limitations, I've
occasionally wanted to write something like
try:
return a_dict[key]
except KeyError:
return (a_dict[key] := expression to construct value)
_______________________________________________
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/GNQCME3OFES5WY65LJJ3ZUPQQH3UPXPE/
Code of Conduct: http://python.org/psf/codeofconduct/