New submission from Rolf Campbell <thats.unpossi...@gmail.com>:

Relative imports do not replace local variables, but also don't fail.  This can 
cause some very strange outcomes like this simple example:

touch a.py; python3.6 -c 'a=7; b=5; from . import a as b; print(a,b)'

I would expect this to produce "7 <module ...>", but instead, it produces "7 7".

Tested in v3.6.2 and v3.6.5:
Python 3.6.5 (default, Mar 29 2018, 18:20:46) 
[GCC 8.0.1 20180317 (Red Hat 8.0.1-0.19)] on linux

----------
components: Interpreter Core
messages: 316864
nosy: Rolf Campbell
priority: normal
severity: normal
status: open
title: Relative imports do not replace local variables
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33547>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to