Aaron Iles added the comment:

My +1 is for the callback based approach. The brevity of the search loop for 
finding the innermost function is (in my opinion at least) non-obvious, relying 
on for loops not having their own scope as it does.

If a generator based API was adopted instead, I propose a convenience function 
(unwrap_all?) to help developers avoid writing code like:

    inner = None
    for inner in functools.unwrap(outer):
        pass
    if inner is None:
        inner = outer

Which combines a misunderstanding of the API with for loop scope shortcut.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13266>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to