Steven D'Aprano <[EMAIL PROTECTED]> writes:
>         namespace = module.__dict__
>     return namespace[name]

Am I missing something?  It's likely that I just don't understand
the problem, but I don't understand these dictionary extractions
for what I thought would be an attribute lookup:

    Python 2.4.4 (#1, Oct 23 2006, 13:58:00) 
    >>> import math
    >>> parrot = getattr(math, 'sqrt')
    >>> print parrot(3)
    1.73205080757
    >>> 

That just seems like a cleaner way to access stuff in a module,
using the published interface instead of an implementation detail.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to