Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"from . import *" #53314

Closed
bhy mannequin opened this issue Jun 24, 2010 · 2 comments
Closed

"from . import *" #53314

bhy mannequin opened this issue Jun 24, 2010 · 2 comments
Assignees
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@bhy
Copy link
Mannequin

bhy mannequin commented Jun 24, 2010

BPO 9068
Nosy @brettcannon

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/brettcannon'
closed_at = <Date 2010-06-24.18:21:05.358>
created_at = <Date 2010-06-24.11:46:42.659>
labels = ['type-bug', 'docs']
title = '"from . import *"'
updated_at = <Date 2010-06-24.18:21:05.332>
user = 'https://bugs.python.org/bhy'

bugs.python.org fields:

activity = <Date 2010-06-24.18:21:05.332>
actor = 'brett.cannon'
assignee = 'brett.cannon'
closed = True
closed_date = <Date 2010-06-24.18:21:05.358>
closer = 'brett.cannon'
components = ['Documentation']
creation = <Date 2010-06-24.11:46:42.659>
creator = 'bhy'
dependencies = []
files = []
hgrepos = []
issue_num = 9068
keywords = []
message_count = 2.0
messages = ['108507', '108539']
nosy_count = 2.0
nosy_names = ['brett.cannon', 'bhy']
pr_nums = []
priority = 'low'
resolution = 'wont fix'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue9068'
versions = []

@bhy
Copy link
Mannequin Author

bhy mannequin commented Jun 24, 2010

"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

@bhy bhy mannequin added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Jun 24, 2010
@brettcannon
Copy link
Member

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.

@brettcannon brettcannon added docs Documentation in the Doc dir and removed interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Jun 24, 2010
@brettcannon brettcannon self-assigned this Jun 24, 2010
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant