On May 14, 5:49 am, Gunter Henriksen
wrote:
> Presuming it is very common to have objects created
> on the fly using some sort of external data
> definitions, is there an obvious common standard
> way to take a dict object and create an object
> whose attribute names are the keys from the dict?
I
On Wed, May 13, 2009 at 1:00 PM, Christian Heimes wrote:
> Gunter Henriksen wrote:
>> but that seems like an arcane way to do something
>> which would ideally be transparent... if there is
>> a function in the standard library, that would be
>> good, even if I have to import it. I guess there is
Gunter Henriksen wrote:
> but that seems like an arcane way to do something
> which would ideally be transparent... if there is
> a function in the standard library, that would be
> good, even if I have to import it. I guess there is
> collections.namedtuple... that would not look much
> prettier.
Presuming it is very common to have objects created
on the fly using some sort of external data
definitions, is there an obvious common standard
way to take a dict object and create an object
whose attribute names are the keys from the dict?
I realize I can do something like:
>>> d = {"hello": "w