Getting a dictionary from an object

Thanos Tsouanas thanos at
Mon Jul 25 22:48:46 CEST 2005

On Sun, Jul 24, 2005 at 02:14:15PM -0600, Steven Bethard wrote:
> How about something like:
>      dict((name, getattr(obj, name)) for name in dir(obj))


> Looks like this will get instance attributes, class attributes and 
> properties just fine.

But not SQLObject's objects...
Any idea why? (Getting attribute errors, it seems that these
"attributoids" are not listed in dir(obj), so i have to use my ugly
dictobj class.. :(

Thanos Tsouanas          .: My Music: .: Sians Music:

More information about the Python-list mailing list