]> granicus.if.org Git - python/commit
Disallow "import mod.submod as m", because the result is ambiguous. Does it
authorThomas Wouters <thomas@python.org>
Sat, 19 Aug 2000 20:55:02 +0000 (20:55 +0000)
committerThomas Wouters <thomas@python.org>
Sat, 19 Aug 2000 20:55:02 +0000 (20:55 +0000)
commit8bad61288186aab93b8aaf6b229c07211e1c77d7
tree2c03c8261f7a1b91c433f20245638154b0629879
parent15446d344d2bda98bf8fd7d0244081a9d4bb7c8f
Disallow "import mod.submod as m", because the result is ambiguous. Does it
load mod.submod as m, or mod as m ? Both can be achieved differently, and
unambiguously. Also attempt to document this restriction (editor
appreciated!)

Note that this is an artificial check during compile, because incorporating
this in the grammar is hard, and then adjusting the compiler to do the right
thing with the right nodes is harder.
Doc/ref/ref6.tex
Python/compile.c