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 f019579828)

Co-authored-by: Lew Kurtz <37632626+lew18@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2018-09-10 18:49:39 -07:00 committed by GitHub
parent f3d00ae3be
commit 037582eb7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View File

@ -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::

View File

@ -0,0 +1 @@
replaced ellipsis with correct error codes in tutorial chapter 3.