Get List of Classes

Maric Michaud maric at aristote.info
Mon Jun 26 11:46:36 EDT 2006


Le lundi 26 juin 2006 17:25, Tim Chase a écrit :
>  I couldn't find any nice
> method for determining if a variable referenced a module other
> than checking to see if that item had both a "__file__" and a
> "__name__" attribute.
Why not :

In [8]: import types, sys

In [9]: isinstance(sys, types.ModuleType)
Out[9]: True

?
Seems rather explicit IMO.

-- 
_____________

Maric Michaud
_____________

Aristote - www.aristote.info
3 place des tapis
69004 Lyon
Tel: +33 426 880 097



More information about the Python-list mailing list