Importing a class without knowing the module

Mike Meyer mwm at mired.org
Fri Nov 18 20:48:06 EST 2005


aleax at mail.comcast.net (Alex Martelli) writes:
> You did help me to better understand some of the roots of your many
> mistaken assertions in this thread, from your first "How about adding
> Foo.__file__" proposal onwards, yes -- thank you. 

I claim I haven't made a single mistaken assertion in this
thread. Referencing class.__file__ instead of module.__file__ was a
mistake, but not an assertion. In fact, when I did that, I asked the
OP what was wrong with it.

You have read into some of the things I've written assertions which
simply weren't there.  For instance, I said "you may not have the
module name", which led you to ask for an example of a class without
an __module__ attribute. I never asserted that you could get a class
without a __module__ attribute, merely that you could get classes
where the module name wasn't useful. if you had spent your time
reading the text a bit more carefully, you might have saved us both
some time.

     <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list