summaryrefslogtreecommitdiffstats
path: root/Doc/tutorial
diff options
context:
space:
mode:
authorUltimateCoder <jaysinhp@gmail.com>2017-05-03 16:46:45 (GMT)
committerMariatta <Mariatta@users.noreply.github.com>2017-05-03 16:46:45 (GMT)
commit8856940cf2e82cb17db2b684cd5732fe658605ca (patch)
treeb185e240823e78a7b5b3829185140b0f18da1509 /Doc/tutorial
parenta5c62a8e9f0de6c4133825a5710984a3cd5e102b (diff)
downloadcpython-8856940cf2e82cb17db2b684cd5732fe658605ca.zip
cpython-8856940cf2e82cb17db2b684cd5732fe658605ca.tar.gz
cpython-8856940cf2e82cb17db2b684cd5732fe658605ca.tar.bz2
bpo-28315: Improve code examples in docs (GH-1372)
Replace File "<stdin>", line 1, in ? with File "<stdin>", line 1, in <module>
Diffstat (limited to 'Doc/tutorial')
-rw-r--r--Doc/tutorial/classes.rst2
-rw-r--r--Doc/tutorial/controlflow.rst2
-rw-r--r--Doc/tutorial/datastructures.rst2
-rw-r--r--Doc/tutorial/inputoutput.rst2
4 files changed, 4 insertions, 4 deletions
diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst
index e134d5d..073444c 100644
--- a/Doc/tutorial/classes.rst
+++ b/Doc/tutorial/classes.rst
@@ -784,7 +784,7 @@ using the :func:`next` built-in function; this example shows how it all works::
'c'
>>> next(it)
Traceback (most recent call last):
- File "<stdin>", line 1, in ?
+ File "<stdin>", line 1, in <module>
next(it)
StopIteration
diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst
index 6a9bb48..54171bc 100644
--- a/Doc/tutorial/controlflow.rst
+++ b/Doc/tutorial/controlflow.rst
@@ -475,7 +475,7 @@ Here's an example that fails due to this restriction::
...
>>> function(0, a=0)
Traceback (most recent call last):
- File "<stdin>", line 1, in ?
+ File "<stdin>", line 1, in <module>
TypeError: function() got multiple values for keyword argument 'a'
When a final formal parameter of the form ``**name`` is present, it receives a
diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst
index 74a1ee7..62be9a0 100644
--- a/Doc/tutorial/datastructures.rst
+++ b/Doc/tutorial/datastructures.rst
@@ -261,7 +261,7 @@ it must be parenthesized. ::
[(0, 0), (1, 1), (2, 4), (3, 9), (4, 16), (5, 25)]
>>> # the tuple must be parenthesized, otherwise an error is raised
>>> [x, x**2 for x in range(6)]
- File "<stdin>", line 1, in ?
+ File "<stdin>", line 1, in <module>
[x, x**2 for x in range(6)]
^
SyntaxError: invalid syntax
diff --git a/Doc/tutorial/inputoutput.rst b/Doc/tutorial/inputoutput.rst
index beeaac3..bad0302 100644
--- a/Doc/tutorial/inputoutput.rst
+++ b/Doc/tutorial/inputoutput.rst
@@ -362,7 +362,7 @@ attempts to use the file object will automatically fail. ::
>>> f.close()
>>> f.read()
Traceback (most recent call last):
- File "<stdin>", line 1, in ?
+ File "<stdin>", line 1, in <module>
ValueError: I/O operation on closed file
It is good practice to use the :keyword:`with` keyword when dealing with file