using del() to 'unimport'
Dennis Lee Bieber
wlfraed at ix.netcom.com
Sun Nov 24 18:15:36 EST 2002
Donnal Walter fed this fish to the penguins on Sunday 24 November 2002
04:25 am:
> When the the following module is imported, I want only 'MyClass' (NOT
> 'Useful' and 'Mixin1') to be publicly accessible.
>
> ======= mymodule.py ==================
> from utilities import Useful, Mixin1
>
> class MyClass(Useful, Mixin1): pass
> ======================================
>
Don't use "from...import..." <G>
What happens if you use:
import utilities
class MyClass(utilities.Useful, utilities.Mixin1): pass
--
> ============================================================== <
> wlfraed at ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
> wulfraed at dm.net | Bestiaria Support Staff <
> ============================================================== <
> Bestiaria Home Page: http://www.beastie.dm.net/ <
> Home Page: http://www.dm.net/~wulfraed/ <
More information about the Python-list
mailing list