summaryrefslogtreecommitdiff
path: root/Doc/reference
diff options
context:
space:
mode:
authorStéphane Wirtel <stephane@wirtel.be>2019-05-13 15:48:50 +0200
committerJulien Palard <julien@palard.fr>2019-05-13 15:48:49 +0200
commit074d7c44a474680122ed869bb6be89c1f4f18f12 (patch)
treef72e04929f1a0884d3a5a72fd75069bf6627da80 /Doc/reference
parentaf5ef3e1077bc2ed177a7c8598f8ecc756ecf6f9 (diff)
downloadcpython-git-074d7c44a474680122ed869bb6be89c1f4f18f12.tar.gz
[3.7] bpo-34682: Wording and grammatical changes to the doc(https://docs.python.org/3) (GH-13120) (GH-13281)
https://bugs.python.org/issue34682 (cherry picked from commit 778a9107586e29421af3a08209cf0b557c1fe5bc) Co-authored-by: divyag9 <divyam9@gmail.com>
Diffstat (limited to 'Doc/reference')
-rw-r--r--Doc/reference/executionmodel.rst2
-rw-r--r--Doc/reference/expressions.rst22
-rw-r--r--Doc/reference/lexical_analysis.rst2
3 files changed, 13 insertions, 13 deletions
diff --git a/Doc/reference/executionmodel.rst b/Doc/reference/executionmodel.rst
index ba7130d636..49cb86b560 100644
--- a/Doc/reference/executionmodel.rst
+++ b/Doc/reference/executionmodel.rst
@@ -243,7 +243,7 @@ re-entering the offending piece of code from the top).
When an exception is not handled at all, the interpreter terminates execution of
the program, or returns to its interactive main loop. In either case, it prints
-a stack backtrace, except when the exception is :exc:`SystemExit`.
+a stack traceback, except when the exception is :exc:`SystemExit`.
Exceptions are identified by class instances. The :keyword:`except` clause is
selected depending on the class of the instance: it must reference the class of
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index d7da7ad4b8..3fb27c8a80 100644
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -144,7 +144,7 @@ the single expression that makes up the expression list.
.. index:: pair: empty; tuple
An empty pair of parentheses yields an empty tuple object. Since tuples are
-immutable, the rules for literals apply (i.e., two occurrences of the empty
+immutable, the same rules as for literals apply (i.e., two occurrences of the empty
tuple may or may not yield the same object).
.. index::
@@ -484,8 +484,8 @@ will raise :exc:`AttributeError` or :exc:`TypeError`, while
When the underlying iterator is complete, the :attr:`~StopIteration.value`
attribute of the raised :exc:`StopIteration` instance becomes the value of
the yield expression. It can be either set explicitly when raising
-:exc:`StopIteration`, or automatically when the sub-iterator is a generator
-(by returning a value from the sub-generator).
+:exc:`StopIteration`, or automatically when the subiterator is a generator
+(by returning a value from the subgenerator).
.. versionchanged:: 3.3
Added ``yield from <expr>`` to delegate control flow to a subiterator.
@@ -504,7 +504,7 @@ on the right hand side of an assignment statement.
:pep:`380` - Syntax for Delegating to a Subgenerator
The proposal to introduce the :token:`yield_from` syntax, making delegation
- to sub-generators easy.
+ to subgenerators easy.
:pep:`525` - Asynchronous Generators
The proposal that expanded on :pep:`492` by adding generator capabilities to
@@ -613,7 +613,7 @@ Asynchronous generator functions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The presence of a yield expression in a function or method defined using
-:keyword:`async def` further defines the function as a
+:keyword:`async def` further defines the function as an
:term:`asynchronous generator` function.
When an asynchronous generator function is called, it returns an
@@ -678,13 +678,13 @@ which are used to control the execution of a generator function.
Returns an awaitable which when run starts to execute the asynchronous
generator or resumes it at the last executed yield expression. When an
- asynchronous generator function is resumed with a :meth:`~agen.__anext__`
+ asynchronous generator function is resumed with an :meth:`~agen.__anext__`
method, the current yield expression always evaluates to :const:`None` in
the returned awaitable, which when run will continue to the next yield
expression. The value of the :token:`expression_list` of the yield
expression is the value of the :exc:`StopIteration` exception raised by
the completing coroutine. If the asynchronous generator exits without
- yielding another value, the awaitable instead raises an
+ yielding another value, the awaitable instead raises a
:exc:`StopAsyncIteration` exception, signalling that the asynchronous
iteration has completed.
@@ -712,7 +712,7 @@ which are used to control the execution of a generator function.
where the asynchronous generator was paused, and returns the next value
yielded by the generator function as the value of the raised
:exc:`StopIteration` exception. If the asynchronous generator exits
- without yielding another value, an :exc:`StopAsyncIteration` exception is
+ without yielding another value, a :exc:`StopAsyncIteration` exception is
raised by the awaitable.
If the generator function does not catch the passed-in exception, or
raises a different exception, then when the awaitable is run that exception
@@ -1584,7 +1584,7 @@ if :keyword:`in` raised that exception).
pair: membership; test
object: sequence
-The operator :keyword:`not in` is defined to have the inverse true value of
+The operator :keyword:`not in` is defined to have the inverse truth value of
:keyword:`in`.
.. index::
@@ -1599,8 +1599,8 @@ The operator :keyword:`not in` is defined to have the inverse true value of
Identity comparisons
--------------------
-The operators :keyword:`is` and :keyword:`is not` test for object identity: ``x
-is y`` is true if and only if *x* and *y* are the same object. Object identity
+The operators :keyword:`is` and :keyword:`is not` test for an object's identity: ``x
+is y`` is true if and only if *x* and *y* are the same object. An Object's identity
is determined using the :meth:`id` function. ``x is not y`` yields the inverse
truth value. [#]_
diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst
index b3c3215a98..7b90f3b31c 100644
--- a/Doc/reference/lexical_analysis.rst
+++ b/Doc/reference/lexical_analysis.rst
@@ -70,7 +70,7 @@ Comments
A comment starts with a hash character (``#``) that is not part of a string
literal, and ends at the end of the physical line. A comment signifies the end
of the logical line unless the implicit line joining rules are invoked. Comments
-are ignored by the syntax; they are not tokens.
+are ignored by the syntax.
.. _encodings: