noob question

Steven D'Aprano steve at REMOVETHIScyber.com.au
Sun Jun 26 12:41:44 CEST 2005


On Sat, 25 Jun 2005 22:06:08 -0700, Matt Hollingsworth wrote:

> Hello,
> 
> Very new to python, so a noob question.  When I've written stuff in 
> JavaScript or MEL in the past, I've always adopted the variable naming 
> convention of using a $ as the first character (no, I don't use perl, 
> never have).  Not possible in python.  What are some good options that 
> people commonly use so that they can easily and quickly identify 
> variable with just a glance?

Learn the language rather than relying on magic symbols.

I don't understand why you would need to have a special naming convention
to identify variables. Magic symbols just get in the way, especially in a
language like Python where everything is an object. (Except keywords and
operators, I suppose.)

Eg, when you do something like this:

myInstance = MyClass(something)
print myInstance.method(somethingelse)

everything except "print" is an object. Or rather, a name that references
an object.

Python doesn't really have variables as such. It has names and objects.
Most of the time, you can think of names as being like variables.

Can anyone think of some good, easy to understand examples of where
Python's name/object model differs from the variable/value model?


-- 
Steven.




More information about the Python-list mailing list