summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLew Kurtz <37632626+lew18@users.noreply.github.com>2018-09-11 01:13:08 (GMT)
committerGregory P. Smith <greg@krypto.org>2018-09-11 01:13:08 (GMT)
commitf019579828ed62653e2d41c95278308fa076ccaf (patch)
tree43c585cd5b3672d446a79fd2a561a42de94f01bf
parent959625b5a56545f1908a7002fe11eb4f0411b780 (diff)
downloadcpython-f019579828ed62653e2d41c95278308fa076ccaf.zip
cpython-f019579828ed62653e2d41c95278308fa076ccaf.tar.gz
cpython-f019579828ed62653e2d41c95278308fa076ccaf.tar.bz2
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.
-rw-r--r--Doc/tutorial/introduction.rst14
-rw-r--r--Misc/NEWS.d/next/Documentation/2018-06-22-08-38-29.bpo-33460.kHt4D0.rst1
2 files changed, 11 insertions, 4 deletions
diff --git a/Doc/tutorial/introduction.rst b/Doc/tutorial/introduction.rst
index 22a209c..e68c9b1 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 0000000..6ee63b0
--- /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.