[Python-3000] from .foo import *

Nick Coghlan ncoghlan at gmail.com
Thu Mar 20 11:23:21 CET 2008


Guido van Rossum wrote:
> On Wed, Mar 19, 2008 at 2:57 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
>>  However, PEP 3100 (the general Py3k TO-DO list) includes a line item to
>>  get rid of "from ... import *" at function level because of the merry
>>  hell it plays with the local variable optimisations. It's possible the
>>  module level version also got clobbered when this was implemented.
> 
> That sounds like completely separate from relative import though, and
> unrelated. I think outside functions "from .foo import *" should be
> allowed.
> 

Oh, I agree (it's an invaluable trick for things like "from 
._hidden_module import *"). I was just speculating on how the module 
level variant may have come to be broken in the first place, not 
suggesting that the breakage was intentional or a good idea. My 
curiousity isn't strong enough to get me to trawl through the svn 
history to find out the actual cause though ;)

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org


More information about the Python-3000 mailing list