+1. I was thinking along the same lines.
Allowing relative imports in "import module [as X]" statements.
If 'module' consists of pure dots, then "as X" is required.
Otherwise, if "as X" is not present, strip the leading dot(s) when assigning 
the local name.
K

> -----Original Message-----
> From: Python-Dev [mailto:python-dev-
> bounces+kristjan=ccpgames....@python.org] On Behalf Of Richard
> Oudkerk
> Sent: 4. apríl 2013 16:26
> To: python-dev@python.org
> Subject: Re: [Python-Dev] relative import circular problem
> 
>
 
> How about having a form of relative import which only works for
> submodules.  For instance, instead of
> 
>      from . import moduleX
> 
> write
> 
>      import .moduleX
> 
> which is currently a SyntaxError.  I think this could be implemented as
> 
>      moduleX = importlib.import_module('.moduleX', __package__)
> 
> --
> 


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to