Re: Adding a field to a 'foreign' object from the outside

2009-01-23 Thread Scott David Daniels
Steve Holden wrote: Write a class that implements a __call__() method, and use an instance > of that class as your callback. Then the data can be stored as the callback > object's private instance data. In fact, you needn't name the method __call__. You can pass in Holder().method if you

Re: Adding a field to a 'foreign' object from the outside

2009-01-23 Thread Steve Holden
atleta wrote: > Hi, > > I'm working with a callback API (a DBus one) and I'd need to store > some state between the calls somewhere. I know that it's possible to > extend an object with fields after creation, so I could just store my > data in the session object that is passed in with every call

Re: Adding a field to a 'foreign' object from the outside

2009-01-23 Thread Bruno Desthuilliers
atleta a écrit : Hi, I'm working with a callback API (a DBus one) and I'd need to store some state between the calls somewhere. I know that it's possible to extend an object with fields after creation, so I could just store my data in the session object that is passed in with every callback. H

Re: Adding a field to a 'foreign' object from the outside

2009-01-22 Thread Diez B. Roggisch
atleta schrieb: Hi, I'm working with a callback API (a DBus one) and I'd need to store some state between the calls somewhere. I know that it's possible to extend an object with fields after creation, so I could just store my data in the session object that is passed in with every callback. Ho

Re: Adding a field to a 'foreign' object from the outside

2009-01-22 Thread James Mills
On Fri, Jan 23, 2009 at 1:19 PM, atleta wrote: > I'm working with a callback API (a DBus one) and I'd need to store > some state between the calls somewhere. I know that it's possible to > extend an object with fields after creation, so I could just store my > data in the session object that is pa

Adding a field to a 'foreign' object from the outside

2009-01-22 Thread atleta
Hi, I'm working with a callback API (a DBus one) and I'd need to store some state between the calls somewhere. I know that it's possible to extend an object with fields after creation, so I could just store my data in the session object that is passed in with every callback. However it stinks fr