[Python-ideas] Anonymous blocks (again):

Juancarlo Añez apalala at gmail.com
Mon May 13 19:23:39 CEST 2013


On Mon, May 13, 2013 at 11:58 AM, Terry Jan Reedy <tjreedy at udel.edu> wrote:

> I disagree that the above is unpythonic. In Python, functions are objects
> like everything else. Define them, pass them to functions, like anything
> else. 'Unpythonic' is treating functions as special, other than that they
> are called (have a call method).


I beg to disagree. Functions are objects in python, but they get particular
treatment.

You can do:

def f():
    pass
x = f


But you can't do:

x = def(): pass

Cheers,

-- 
Juancarlo *Añez*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130513/b8ebda48/attachment.html>


More information about the Python-ideas mailing list