Best way to dynamically get an attribute from a module from within the same module
jeremy+complangpython at jeremysanders.net
Mon Dec 1 06:53:03 EST 2008
> I guess, in the end, I'd use getattr() because it feels more pythonic,
> and more basic. I got pretty deep in to learning python before I had
> to learn what the globals() dict could do for me.
Why not store your individual classes inside another class or keep them in a
dict? That would be clearer, would not mess around with global namespace,
and more pythonic IMHO.
More information about the Python-list