summaryrefslogtreecommitdiff
path: root/Doc/tutorial/stdlib2.rst
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2011-07-04 11:31:53 -0700
committerSenthil Kumaran <senthil@uthcode.com>2011-07-04 11:31:53 -0700
commitf587d4d9948b388a440c4b4ced069345ea0b05b1 (patch)
tree78812ada9000f9b6ba505e0d9c7d16834fd46d4f /Doc/tutorial/stdlib2.rst
parent5f0e3a42ecde1c7a70cc8f8bca9f968937631186 (diff)
parent5cb4efc23896173e283b5ed627a68da2eb57130d (diff)
downloadcpython-f587d4d9948b388a440c4b4ced069345ea0b05b1.tar.gz
Merge from 3.2 . Replace the term members with correct and appropriate terminology. Initial patch by Adam Woodbeck.
Diffstat (limited to 'Doc/tutorial/stdlib2.rst')
-rw-r--r--Doc/tutorial/stdlib2.rst6
1 files changed, 4 insertions, 2 deletions
diff --git a/Doc/tutorial/stdlib2.rst b/Doc/tutorial/stdlib2.rst
index fe7f027b53..85c88dc23f 100644
--- a/Doc/tutorial/stdlib2.rst
+++ b/Doc/tutorial/stdlib2.rst
@@ -141,7 +141,9 @@ standard size and in little-endian byte order::
import struct
- data = open('myfile.zip', 'rb').read()
+ with open('myfile.zip', 'rb') as f:
+ data = f.read()
+
start = 0
for i in range(3): # show the first 3 file headers
start += 14
@@ -271,7 +273,7 @@ applications include caching objects that are expensive to create::
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
d['primary'] # entry was automatically removed
- File "C:/python31/lib/weakref.py", line 46, in __getitem__
+ File "C:/python33/lib/weakref.py", line 46, in __getitem__
o = self.data[key]()
KeyError: 'primary'