anything like C++ references?

Stephen Horne intentionally at blank.co.uk
Tue Jul 15 04:59:53 CEST 2003


On Tue, 15 Jul 2003 02:26:58 GMT, "Bryan" <belred1 at yahoo.com> wrote:

>>
>> In maths, a variable binds to a value. In Python, a variable binds to
>> an object in a way that does no correctly implement binding to a value
>> unless the object happens to be immutable.
>>
>
>this sentence is completely FALSE because python does not have the concept
>of variables that bind to values.

The term 'variable' is defined by mathematics and computer science.
The fact that Python has arbitrarily redefined it is the cause of very
real confusion and errors.

>  therefore it's impossible for python to
>incorrectly implement binding variables to values like in math.  python does
>not have the concept of variables.  instead, as has been pointed out several
>times, python has what you can call "names" that bind to objects.

Bogus.

Read the Python tutorial. I think you'll find the first use of the
word 'variable' in the file node4.html ("Using the Python
Interpreter").

Actually, there are earlier uses but they allow plausible deniability
in the interpretation. This is the first time when the tutorial
specifically refers to a variable existing...

"""
When known to the interpreter, the script name and additional
arguments thereafter are passed to the script in the variable sys.argv
"""

>  two
>completeley different concepts.  i think a lot of this argument is based on
>this false premise that python has true "slot" variables and incorrect
>comparisons are being made.

No. The point requires a certain amount of pedanticism, but that
doesn't mean it isn't real or important.

In mathematics and computer theory, variables bind to values. In a
computer language, that binding can be implemented in various ways.
The Python way, however, does not respect the original definition. The
binding to objects has side-effects which do not respect the principle
of binding to values.





More information about the Python-list mailing list