-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
bpo-33702: Add some missing links in production lists and do a little polish #7259
Changes from 6 commits
d59d9a1
e69dfc4
71148b3
433fba9
96e5d9e
5b7a413
f762477
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -707,15 +707,14 @@ The :keyword:`import` statement | |
keyword: from | ||
|
||
.. productionlist:: | ||
import_stmt: "import" `module` ["as" `name`] ( "," `module` ["as" `name`] )* | ||
: | "from" `relative_module` "import" `identifier` ["as" `name`] | ||
: ( "," `identifier` ["as" `name`] )* | ||
: | "from" `relative_module` "import" "(" `identifier` ["as" `name`] | ||
: ( "," `identifier` ["as" `name`] )* [","] ")" | ||
import_stmt: "import" `module` ["as" `identifier`] ("," `module` ["as" `identifier`])* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because, when I added a link to name in future statements, it linked to the name in import statements. That's why I replaced name in both places to "identifier". Perhaps it can be solved in other way? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I see, the problem was that |
||
: | "from" `relative_module` "import" `identifier` ["as" `identifier`] | ||
: ("," `identifier` ["as" `identifier`])* | ||
: | "from" `relative_module` "import" "(" `identifier` ["as" `identifier`] | ||
: ("," `identifier` ["as" `identifier`])* [","] ")" | ||
: | "from" `module` "import" "*" | ||
module: (`identifier` ".")* `identifier` | ||
relative_module: "."* `module` | "."+ | ||
name: `identifier` | ||
|
||
The basic import statement (no :keyword:`from` clause) is executed in two | ||
steps: | ||
|
@@ -837,12 +836,11 @@ features on a per-module basis before the release in which the feature becomes | |
standard. | ||
|
||
.. productionlist:: * | ||
future_statement: "from" "__future__" "import" feature ["as" name] | ||
: ("," feature ["as" name])* | ||
: | "from" "__future__" "import" "(" feature ["as" name] | ||
: ("," feature ["as" name])* [","] ")" | ||
feature: identifier | ||
name: identifier | ||
future_stmt: "from" "__future__" "import" `feature` ["as" `identifier`] | ||
: ("," `feature` ["as" `identifier`])* | ||
: | "from" "__future__" "import" "(" `feature` ["as" `identifier`] | ||
: ("," `feature` ["as" `identifier`])* [","] ")" | ||
feature: `identifier` | ||
|
||
A future statement must appear near the top of the module. The only lines that | ||
can appear before a future statement are: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to break a line before
|
than at arbitrary place. I think it is better to keep the existing formatting. It is not much longer that the previous production list.