Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f019579

Browse files
lew18gpshead
authored andcommitted
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.
1 parent 959625b commit f019579

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

Doc/tutorial/introduction.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,14 @@ This only works with two literals though, not with variables or expressions::
223223

224224
>>> prefix = 'Py'
225225
>>> prefix 'thon' # can't concatenate a variable and a string literal
226-
...
226+
File "<stdin>", line 1
227+
prefix 'thon'
228+
^
227229
SyntaxError: invalid syntax
228230
>>> ('un' * 3) 'ium'
229-
...
231+
File "<stdin>", line 1
232+
('un' * 3) 'ium'
233+
^
230234
SyntaxError: invalid syntax
231235

232236
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`.
320324
Therefore, assigning to an indexed position in the string results in an error::
321325

322326
>>> word[0] = 'J'
323-
...
327+
Traceback (most recent call last):
328+
File "<stdin>", line 1, in <module>
324329
TypeError: 'str' object does not support item assignment
325330
>>> word[2:] = 'py'
326-
...
331+
Traceback (most recent call last):
332+
File "<stdin>", line 1, in <module>
327333
TypeError: 'str' object does not support item assignment
328334

329335
If you need a different string, you should create a new one::
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
replaced ellipsis with correct error codes in tutorial chapter 3.

0 commit comments

Comments
 (0)