[Python-ideas] name export

Nick Coghlan ncoghlan at gmail.com
Sun Apr 5 00:54:08 CEST 2009


Aahz wrote:
> Your problem is that you're using import * -- stop doing that and you
> won't have an issue.  The only good use cases for import * IMO are
> interactive Python and packages, and in the latter case I don't see why
> anyone would need the information you propose except for debugging
> purposes.

We've recently discovered another use for it: overriding a pure Python
implementation with optional native language accelerated components.
Using "from _accelerated_name import *" allows other Python
implementations to easily choose a different subset of functions and
classes to accelerate.

That one is only relevant to people writing modules that they would like
to work unchanged with more than one Python implementation though.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------



More information about the Python-ideas mailing list