[Python-checkins] bpo-33460: remove ellipsis that look like continuation prompts (GH-7851)

Miss Islington (bot) webhook-mailer at python.org
Mon Sep 10 21:49:42 EDT 2018


https://github.com/python/cpython/commit/037582eb7f4d61604ef2dcc72f896117588eeb3c
commit: 037582eb7f4d61604ef2dcc72f896117588eeb3c
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018年09月10日T18:49:39-07:00
summary:
bpo-33460: remove ellipsis that look like continuation prompts (GH-7851)
Remove ellipsis that look like continuation prompts,
has a side benefit of putting rest of error message in proper text color.
(cherry picked from commit f019579828ed62653e2d41c95278308fa076ccaf)
Co-authored-by: Lew Kurtz <37632626+lew18 at users.noreply.github.com>
files:
A Misc/NEWS.d/next/Documentation/2018-06-22-08-38-29.bpo-33460.kHt4D0.rst
M Doc/tutorial/introduction.rst
diff --git a/Doc/tutorial/introduction.rst b/Doc/tutorial/introduction.rst
index 22a209c10333..e68c9b10d03e 100644
--- a/Doc/tutorial/introduction.rst
+++ b/Doc/tutorial/introduction.rst
@@ -223,10 +223,14 @@ This only works with two literals though, not with variables or expressions::
 
 >>> prefix = 'Py'
 >>> prefix 'thon' # can't concatenate a variable and a string literal
- ...
+ File "<stdin>", line 1
+ prefix 'thon'
+ ^
 SyntaxError: invalid syntax
 >>> ('un' * 3) 'ium'
- ...
+ File "<stdin>", line 1
+ ('un' * 3) 'ium'
+ ^
 SyntaxError: invalid syntax
 
 If you want to concatenate variables or a variable and a literal, use ``+``::
@@ -320,10 +324,12 @@ Python strings cannot be changed --- they are :term:`immutable`.
 Therefore, assigning to an indexed position in the string results in an error::
 
 >>> word[0] = 'J'
- ...
+ Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
 TypeError: 'str' object does not support item assignment
 >>> word[2:] = 'py'
- ...
+ Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
 TypeError: 'str' object does not support item assignment
 
 If you need a different string, you should create a new one::
diff --git a/Misc/NEWS.d/next/Documentation/2018-06-22-08-38-29.bpo-33460.kHt4D0.rst b/Misc/NEWS.d/next/Documentation/2018-06-22-08-38-29.bpo-33460.kHt4D0.rst
new file mode 100644
index 000000000000..6ee63b08f682
--- /dev/null
+++ b/Misc/NEWS.d/next/Documentation/2018-06-22-08-38-29.bpo-33460.kHt4D0.rst
@@ -0,0 +1 @@
+replaced ellipsis with correct error codes in tutorial chapter 3.


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /