it would be nice to be able to use the "with" block syntax to do things like 
implement a builder. To do this, the with block must be able to return a final 
value to the surrounding context ass part of its __exit__ behavior.

    obj = with builder() as b: …

This would be a little like what can be done in Ruby by passing a {…} block 
argument to a function.
_______________________________________________
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/A7VPZ7HO27ZTBAT3ICVK5QKYUA2ALHKU/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to