Return value of an assignment statement?

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Fri Feb 22 07:32:10 EST 2008


On Fri, 22 Feb 2008 08:12:56 +0000, Marc 'BlackJack' Rintsch wrote:

> A "variable" in
> programming languages is composed of a name, a memory location, possibly
> a type and a value. In C-like languages, where you put values in named
> and typed "boxes", the memory location and type are attached to the
> name.  In Python both belong to the value.

But Python objects don't have names, so by your own definition, they 
aren't variables. Names are associated with namespaces, not objects. A 
name must have one and only one object bound to it at any one time; 
objects on the other hand can be bound to one name, or no name, or a 
thousand names. The object itself has no way of knowing what names it is 
bound to, if any.

Or, to put it another way... Python doesn't have variables.



-- 
Steven



More information about the Python-list mailing list