Re: Dictionary, iterate & update objects

2006-12-18 Thread Carl Banks
Dennis Lee Bieber wrote: > On 16 Dec 2006 14:49:19 -0800, "jansenh" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > Yes. > > [... the temp object is by ref, and any manipulation of the temp object > > is to the object itself..? It really simplifies my first attempt] > > >

Re: Dictionary, iterate & update objects

2006-12-18 Thread Bruno Desthuilliers
jansenh a écrit : > hi comp.lang.python. > > I need some newbe advice on idiomatic use of Python dictionaries. > > I have service with a dictionary which holds a bunch of objects as > values, and an ID as key to each object. Then I want to change an > objects state based on its key. class MyObj(

Re: Dictionary, iterate & update objects

2006-12-16 Thread jansenh
Hi and thanx! Caleb Hattingh wrote: > > >>> temp=d[12345] > >>> temp.x = 5 > > After I assign the object to the dict with ID=12345, I can easily get > the object by its key and manipulate its state. The last 4 lines show > that the state changed for all the active references to the created > obje

Re: Dictionary, iterate & update objects

2006-12-16 Thread Caleb Hattingh
jansenh wrote: > hi comp.lang.python. > > I need some newbe advice on idiomatic use of Python dictionaries. > > I have service with a dictionary which holds a bunch of objects as > values, and an ID as key to each object. Then I want to change an > objects state based on its key. The way I am doin

Dictionary, iterate & update objects

2006-12-16 Thread jansenh
hi comp.lang.python. I need some newbe advice on idiomatic use of Python dictionaries. I have service with a dictionary which holds a bunch of objects as values, and an ID as key to each object. Then I want to change an objects state based on its key. The way I am doing this now is by using 'from