Re: Represent object type as

2010-03-26 Thread Gregory Ewing
Jason wrote: I'm reusing the __getstate__ function I wrote for pickling like so: Instead of reinventing part of pickle, is there some reason you couldn't just use it? -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Represent object type as

2010-03-25 Thread Jason
Hi, I want to send objects (new style) over DBUS. DBUS can only send fairly primitive types[1] so I turn my objects into dicts and send that. I'm reusing the __getstate__ function I wrote for pickling like so: def __getstate__(self): attrs = self.__dict__.copy() return attrs

Re: Represent object type as

2010-03-25 Thread Bruno Desthuilliers
Jason a écrit : Hi, I want to send objects (new style) over DBUS. DBUS can only send fairly primitive types[1] so I turn my objects into dicts and send that. I'm reusing the __getstate__ function I wrote for pickling like so: def __getstate__(self): attrs = self.__dict__.copy()

Re: Represent object type as

2010-03-25 Thread Jason
On Mar 26, 12:00 am, Bruno Desthuilliers bruno. 42.desthuilli...@websiteburo.invalid wrote:            attrs['type'] = type(self) Do the same thing with less work !-) Ah, silly me :P      attrs['__typename__'] = type(self).__name__ That's exactly what I needed — I was not aware of the