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 -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/GNQCME3OFES5WY65LJJ3ZUPQQH3UPXPE/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to