A class question

Bruno Desthuilliers bruno.42.desthuilliers at wtf.websiteburo.oops.com
Mon Oct 29 15:12:18 CET 2007


Hrvoje Niksic a écrit :
> Bruno Desthuilliers <bruno.42.desthuilliers at wtf.websiteburo.oops.com>
> writes:
> 
>>> As others have answered, an instance can live in many variables,
>> "be bound to many names" would be more accurate IMHO.
> 
> Technically more accurate maybe (but see below), but I was responding
> to a beginner's post, so I was striving for ease of understanding.

The problem is that your formulation implies (to me at least) that the 
variable is actually a kind of container for the object. And I'm not 
sure being inaccurate really helps (OTHO, I often tend to get too 
technical, so who knows which approach is the best here... At least, the 
OP will now have both !-)

>> Python's "variables" are name=>object bindings.
> 
> No reason to use quotes. 

Yes, there's one : to mark the difference between Python-like 
name=>object bindings and C-like labels-on-memory-address variables - 
the latter model being the most commonly known to beginners.

> Variable is just as acceptable a term,

Indeed - no need to refer to chapter and verse here, I've read the book 
too !-)

(snip)

> I disagree with the idea that the terms "name" and "binding" are the
> only correct terminology. 

Which is not what I meant here.




More information about the Python-list mailing list