the demise of 'from foo import * and its implications?

Alex Martelli aleaxit at
Mon Mar 5 18:25:20 CET 2001

"Steve Holden" <sholden at> wrote in message
news:suPo6.16824$ML1.841861 at
> I did begin to wonder whether it might be possible to specify a name
> along the lines of
>     from modulewithaverylongname import * prefix sh_
> to allow
>     sh_i

But why not just
    import modulewithaverylongname as sh
and then use

You can do that today, and the detailed semantics seem
likelier to be what is desired (e.g., should attribute
i of the module ever be re-bound, it's probably better
to automatically pick up the new reference, as happens
by using sh.i, than keep using the old one, as any
'from/import' approach would do -- marginal stuff, sure).


More information about the Python-list mailing list