using exec() to instantiate a new object.

George Sakkis george.sakkis at gmail.com
Mon Nov 10 10:50:26 EST 2008


On Nov 10, 10:37 am, RyanN <Ryan.N... at gmail.com> wrote:

> On Nov 10, 7:47 am, RyanN wrote:
>
> > Thank you both, I knew there had to be a good way of doing this.
>
> > -Ryan
>
> Just an update. I used dictionaries to hold objects and their names.
> I'm beginning to understand better. Now to apply this to my actual
> problem. Here's the code I ended up with:

That's fine, but unless you add functionality that *does* actually
something with all these data, there's not much  value going with an
OO approach compared to using plain old data structures (e.g.
[default]dicts and [named]tuples).

George



More information about the Python-list mailing list