[Python-ideas] name export
Terry Reedy
tjreedy at udel.edu
Sun Apr 5 04:14:30 CEST 2009
Nick Coghlan wrote:
> 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.
It also allows the set of accerated components to change (typically,
grow) within an implementation.
> That one is only relevant to people writing modules that they would like
> to work unchanged with more than one Python implementation though.
tjr
More information about the Python-ideas
mailing list