Newbie: question regarding references and class relationships

Rui Maciel rui.maciel at gmail.com
Mon Jun 10 13:42:44 EDT 2013


Peter Otten wrote:

> Have you read the code in the interpreter session I posted?
> 
> If you do not agree that the demonstrated behaviour is puzzling I'll have
> to drop my claim...

I don't see how it should be puzzling.  You've deleted the attribute, so it 
ceassed to exist.


> Likewise if you can show a benefit of the
> 
>>>position = []
> 
> line.

I wrote the code that way to declare intent and help document the code.  In 
this case that the class Point is expected to have an attribute named 
position which will point to a list.


Rui Maciel



More information about the Python-list mailing list