Variables

Kirk Job Sluder kirk at jobsluder.net
Sun Apr 24 13:58:33 EDT 2005


Richard Blackwood <richardblackwood at cloudthunder.com> writes:

> Unfortunately that's not much of an option for me. We are working on a
> project together so I am forced to either prove his notion incorrect
> or I give in to his conception. *throws hands in air*

Well, one option is to give in to his conception and point out that if
you are working in python, foo=5 is neither a true constant or a
variable.  foo is an object reference pointing to an anonymous object
with the value 5.

Another way around it is to point out that while the use of the term
"variable" in this sense may not be technically correct in terms of
maths, it is the accepted jargon in the python community.  Other
programming communities may use different terms to describe values that
change and values that don't change.

A third way around this is to use this to your advantage and point out
that python does not have a mechanism for distinguishing varibles from
constants, so settle on some syntactic sugar to make the differences
clear in your code.  

-- 
Kirk Job-Sluder
"The square-jawed homunculi of Tommy Hilfinger ads make every day an
existential holocaust."  --Scary Go Round



More information about the Python-list mailing list