A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/089335.html below:

Named code blockes

Named code blockes Named code blockesAlex Martelli aleaxit at yahoo.com
Mon Apr 23 16:48:51 EDT 2001
"Stephen Hansen" <news at myNOSPAM.org> wrote in message
news:ic%E6.195119$LO3.31059618 at typhoon.we.rr.com...
    [snip]
>     With the advent of nested_scopes, I believe you can accomplish this by
> just embedding a 'def' in either the __init__ or the collection.do
function,
> making your code as readable as that smalltalk code was. :)
>
> For instance:
>
> class Dummy:
>     def __init__(self, collection):
>         def DoThisAndDoThatToItem(item):
>             item.DoThis()
>             item.DoThat()
>
>         collection.do(DoThisAndDoThatToItem)

I don't get it -- what difference do nested scopes do to THIS code?  It
will run identically with or without nested scopes.  What am I missing?


Alex




More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4