This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: "from . import *"
Type: behavior Stage:
Components: Documentation Versions:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: bhy, brett.cannon
Priority: low Keywords:

Created on 2010-06-24 11:46 by bhy, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg108507 - (view) Author: Haoyu Bai (bhy) Date: 2010-06-24 11:46
"from . import *" is valid syntax in CPython (both 2.6 and py3k) but in the language reference it is not allowed:

http://docs.python.org/dev/py3k/reference/simple_stmts.html#the-import-statement
msg108539 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2010-06-24 18:21
That's because while it is syntactically allowed, it is semantically disallowed. The grammar rules shown in the docs is a generalization of the actual grammar used to build the parser so that we can take shortcuts with it to simply not have rules that will pass the parser but fail in the compiler.
History
Date User Action Args
2022-04-11 14:57:02adminsetgithub: 53314
2010-06-24 18:21:05brett.cannonsetstatus: open -> closed
priority: normal -> low

components: + Documentation, - Interpreter Core
assignee: brett.cannon

nosy: + brett.cannon
messages: + msg108539
resolution: wont fix
2010-06-24 11:46:42bhycreate