summaryrefslogtreecommitdiffstats
path: root/Doc/reference/simple_stmts.rst
diff options
context:
space:
mode:
authorAndrés Delfino <adelfino@gmail.com>2018-07-07 20:24:46 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2018-07-07 20:24:46 (GMT)
commitcaccca78e46bf3c3b24e09b3afb1c1b08c39990c (patch)
treea4fe984b0fbc0e9dec2e4c0dba924e56e15d3f97 /Doc/reference/simple_stmts.rst
parentb6bb77c2b8e83ba6cb845c7b512ac564276e854f (diff)
downloadcpython-caccca78e46bf3c3b24e09b3afb1c1b08c39990c.zip
cpython-caccca78e46bf3c3b24e09b3afb1c1b08c39990c.tar.gz
cpython-caccca78e46bf3c3b24e09b3afb1c1b08c39990c.tar.bz2
bpo-33702: Add some missing links in production lists and do a little polish (GH-7259)
Diffstat (limited to 'Doc/reference/simple_stmts.rst')
-rw-r--r--Doc/reference/simple_stmts.rst22
1 files changed, 10 insertions, 12 deletions
diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst
index 9186210..bb1eea6 100644
--- a/Doc/reference/simple_stmts.rst
+++ b/Doc/reference/simple_stmts.rst
@@ -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`])*
+ : | "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: