"Antoine" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> def handle_response(record): >> format_expanded(li.content, response.related) >> server.get_synset_link(handle_response) > > As already mentioned, the problem with this idiom is that code that is > executed *after* appears *before* the "get_synset_link".
*To me* you have this backwards. The function-object creation code is executed *before* the call that passes that object. This is true whether it is placed before, as above, or nested within, as you and Tomer prefer. > It makes the code less straightforward to write *To you*. > and especially to read *To you*. I (and many others, apparently) am less comfortable reading deeply nested code inside out than perhaps you and Tomer. If a function body is more complicated than 'return <expression>', I prefer to have it factored out. > (and having readable code is important). To both of us, but we differ at least slightly in what is most readable. Terry Jan Reedy _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com