Steven D'Aprano <[email protected]> wrote:
> import alienmodule
>
> class MyClass(alienmodule.AlienClass):
> do_stuff()
>
> rather than:
>
> from alienmodule import AlienClass
>
> class MyClass(AlienClass):
> do_stuff()
>
> del AlienClass
The original developer may also have been unaware of the ability to
limit a * import through the use of __all__.
from alienmodule import AlienClass
__all__ = ['MyClass']
class MyClass(AlienClass):
do_stuff()
Of course, this is really only useful if you're doing "from module
import *" which is generally discouraged inside actual code.
--
http://mail.python.org/mailman/listinfo/python-list