[Python-ideas] Allow multiple imports from a package while preserving its namespace

Steve Barnes gadgetsteve at live.co.uk
Fri Apr 27 10:22:30 EDT 2018



On 27/04/2018 12:14, Nick Coghlan wrote:
> On 27 April 2018 at 01:22, Serhiy Storchaka <storchaka at gmail.com> wrote:
>> I think this special cases isn't special enough to introduce a special
>> syntax.
> 
> While I'm mostly inclined to agree, I do think it would be nice to
> have a clean spelling for "ensure this module is fully imported, but
> don't bind it locally".
>

How about a modifier for import such as:

    from module non_local import (a, b, c, d)

or:

    from module import_named (a, b, c, d)

I think that either gets the point across.

-- 
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect 
those of my employer.

---
This email has been checked for viruses by AVG.
http://www.avg.com



More information about the Python-ideas mailing list