A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-April/052816.html below:

[Python-Dev] anonymous blocks

[Python-Dev] anonymous blocks [Python-Dev] anonymous blocksSteven Bethard steven.bethard at gmail.com
Thu Apr 21 19:05:35 CEST 2005
On 4/21/05, Guido van Rossum <gvanrossum at gmail.com> wrote:
> > It strikes me that with something like this lexical declaration, we
> > could abuse decorators as per Carl Banks's recipe[1] to get the
> > equivalent of thunks:
> 
> "abuse" being the operative word.

Yup.  I was just drawing the parallel between:

@withfile("readme.txt")
def thunk(fileobj):
    for line in fileobj:
        print line

and

@withfile("readme.txt"):
    # called by withfile as thunk(fileobj=<file object>)
    for line in fileobj:
        print line

STeVe
-- 
You can wordify anything if you just verb it.
        --- Bucky Katt, Get Fuzzy
More information about the Python-Dev 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