[Python-ideas] Allow accessing return value inside finally clause

Ram Rachum ram.rachum at gmail.com
Tue Dec 25 22:46:22 CET 2012


Say I have this function:

    def f():
        try:
            return whatever()
        finally:
            pass # I want to get what `whatever()` returned in here

I want to get the return value from inside the `finally` clause.

I understand that this is currently not possible. I'd like that to be 
possible because that would allow post-processing of a function's return 
value.

What do you think?


Thanks,
Ram.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20121225/8447fa3b/attachment.html>


More information about the Python-ideas mailing list