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 "__name__" attribute. > Warning: won't be very useful if your code still uses old-style classes. No, all the objects are new-style classes so that's fine. > Depends on what you do with this dict, DBUS etc. And of your definition > of "better", of course. Simplest possible :P But this looks like it, so thanks very much :) Cheers, Jason -- http://mail.python.org/mailman/listinfo/python-list