Nested function scope problem

Antoon Pardon apardon at forel.vub.ac.be
Fri Aug 4 11:12:44 EDT 2006


On 2006-08-04, Slawomir Nowaczyk <slawomir.nowaczyk.847 at student.lu.se> wrote:
> On Fri, 04 Aug 2006 10:10:45 -0300
> Gerhard Fiedler <gelists at gmail.com> wrote:
>
> #> You can hardly claim that what gets printed is the "id" of the variable c.
> #> (Well, you can claim, but few C programmers would follow you.)
>
> That's possible. I wouldn't expect too many C programmers to have any
> notion of "id of a variable". I, for example, never thought about such
> thing before this thread.

But even in Python we don't speak of "id of a variable". It is not
the variable that has an id. It is the object that is currently
attached to the variable that has an id. Yes we can use "id of
a variable" as a shortcut for the correct formulation as long
as you keep in mind that it is not the variable itself that has
an id.

-- 
Antoon Pardon



More information about the Python-list mailing list