[Python-Dev] Allowing import star with namespaces (original) (raw)
Ethan Furman ethan at stoneleaf.us
Tue Apr 26 20:03:52 CEST 2011
- Previous message: [Python-Dev] Allowing import star with namespaces
- Next message: [Python-Dev] Allowing import star with namespaces
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Brendan Moloney wrote:
We all know that doing:
--> from pkg import * is bad because it obliterates the 'pkg' namespace.
The strongest reason for not doing this is that it pollutes the current namespace, not that it obliterates the 'pkg' namespace.
So why not allow something like:
--> import pkg.*
How would that be different from
--> import pkg
?
If you want convenience for interactive work, you can always:
--> import pkg --> from pkg import *
and then have the best (and worst!) of both techniques.
Ethan
- Previous message: [Python-Dev] Allowing import star with namespaces
- Next message: [Python-Dev] Allowing import star with namespaces
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]