mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-28315: Improve code examples in docs (GH-1372)
Replace File "<stdin>", line 1, in ? with File "<stdin>", line 1, in <module>
This commit is contained in:
parent
a5c62a8e9f
commit
8856940cf2
12 changed files with 30 additions and 30 deletions
|
@ -408,7 +408,7 @@ Simple example::
|
|||
|
||||
>>> [1, 2, 3].remove(42)
|
||||
Traceback (most recent call last):
|
||||
File "<stdin>", line 1, in ?
|
||||
File "<stdin>", line 1, in <module>
|
||||
ValueError: list.remove(x): x not in list
|
||||
|
||||
That doctest succeeds if :exc:`ValueError` is raised, with the ``list.remove(x):
|
||||
|
@ -432,7 +432,7 @@ multi-line detail::
|
|||
|
||||
>>> raise ValueError('multi\n line\ndetail')
|
||||
Traceback (most recent call last):
|
||||
File "<stdin>", line 1, in ?
|
||||
File "<stdin>", line 1, in <module>
|
||||
ValueError: multi
|
||||
line
|
||||
detail
|
||||
|
@ -591,7 +591,7 @@ doctest decides whether actual output matches an example's expected output:
|
|||
|
||||
>>> (1, 2)[3] = 'moo'
|
||||
Traceback (most recent call last):
|
||||
File "<stdin>", line 1, in ?
|
||||
File "<stdin>", line 1, in <module>
|
||||
TypeError: object doesn't support item assignment
|
||||
|
||||
passes under Python 2.3 and later Python versions with the flag specified,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue