Closures in leu of pointers?

Antoon Pardon antoon.pardon at rece.vub.ac.be
Sun Jun 30 06:07:22 EDT 2013


Op 29-06-13 21:23, Ian Kelly schreef:
> On Sat, Jun 29, 2013 at 11:02 AM, Antoon Pardon
> <antoon.pardon at rece.vub.ac.be>  wrote:
>> Op 29-06-13 16:02, Michael Torrie schreef:
>>
>>>
>>> The real problem here is that you don't understand how python variables
>>> work.  And in fact, python does not have variables.  It has names that
>>> bind to objects.
>>
>>
>> I don't understand why members of this list keep saying this. Sure the
>> variables in python behave differently than those in C and algol  But they
>> behave similarly as those in smalltalk and lisp and I haven't seen
>> anyone claim that smalltalk and lisp don't have variables.
>
> Perhaps because that is the terminology used by the language documentation:
>
> http://docs.python.org/3/reference/executionmodel.html#naming-and-binding

I don't think this reference is as strong as you think it is. Here is
a paragraph somewhat lower:

] If a name is bound in a block, it is a local variable of that block,
] unless declared as nonlocal. If a name is bound at the module level, ] 
it is a global variable. (The variables of the module code block are ] 
local and global.) If a variable is used in a code block but not
] defined there, it is a free variable.

So the language documentation mentions these names as being variables.

-- 
Antoon Pardon



More information about the Python-list mailing list