Nested function scope problem

Gerhard Fiedler gelists at gmail.com
Sun Aug 6 10:37:46 EDT 2006


On 2006-08-06 06:41:27, Slawomir Nowaczyk wrote:

> Since Python doesn't (supposedly) have variables, it couldn't have come
> from Python. 

The idea (of this part of the thread) was to find the analogy between C
variables and Python variables, at least that's what you said a few
messages ago.


> Which translates into C++ as "an object pointed to by a", IMHO.

We just need to get down to how that analogy works. 

An example from physics... You have electrical voltage, current and
resistance. These can be seen as analog to water pressure, volume flow and
flow resistance. Such an analogy is never perfect and always works only
under certain restrictions, but it can help to understand the other domain
from an understanding of one domain.

You claimed that there exists such an analogy between C variables and
Python variables. (We never disputed the existence of Python variables; not
sure why you come up with that now. That was so far back in this thread.)
The only thing I would see is a clear description of behavior and
operations and how they are analog. And also a clear definition whether
this is about C /variables/ or C /dereferenced pointers/. 

You again used an analogy to a C++ dereferenced pointer -- which is
something different from a C++ variable. It's a common C++ construct, but
it is not a C++ variable. It is important to distinguish between C/C++
variables and C/C++ dereferenced pointers. They are completely different
things (in C/C++ at least).

Unless someone can create such an analogy (something like Dennis posted
recently) that has some resemblance of being reasonable or useful, I just
think it's not possible.

Gerhard




More information about the Python-list mailing list