Subject | Hash | Author | Date (UTC) |
---|---|---|---|
bpo-28315: Improve code examples in docs (GH-1372) | 8856940cf2e82cb17db2b684cd5732fe658605ca | UltimateCoder | 2017-05-03 16:46:45 |
bpo-23404: make touch becomes make regen-all (#1405) | a5c62a8e9f0de6c4133825a5710984a3cd5e102b | Victor Stinner | 2017-05-03 16:21:48 |
bpo-30103: Allow Uuencode in Python using backtick as zero instead of space (#1326) | 13f1f423fac39f8f14a3ce919dd236975517d5c6 | Xiang Zhang | 2017-05-03 03:16:21 |
Fix tests: getsockname() can return None on OS X on unbound sockets (#1400) | 0360a9d015ddbc4e3d58e3ab4b433da27bf1db3a | Antoine Pitrou | 2017-05-02 21:48:26 |
bpo-30232: Regenerate configure (#1396) | 9ed34a89532763cf89f5e11fffb91ef7dee29fed | Victor Stinner | 2017-05-02 20:35:58 |
bpo-30232: Support Git worktree in configure.ac (#1391) | 5facdbb29169c2799c42f887cef4cd9d087b0167 | Victor Stinner | 2017-05-02 19:42:48 |
Remove outdated tests in test_isinstance (GH-1393) | 094909ad69a6654ac43c69ebdced060fbbbbede8 | Jim Fasarakis-Hilliard | 2017-05-02 17:17:18 |
bpo-28556: Routine updates to typing (#1366) | f06e0218ef6007667f5d61184b85a81a0466d3ae | Ivan Levkivskyi | 2017-05-02 17:14:07 |
bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux (#1370) | 495b5021e73e3c4b6404417ecf4fa83aa10297f0 | Antoine Pitrou | 2017-05-02 15:20:00 |
Fix typo in selectors.rst (#1383) | b0d82036549074357717d130a772d1e2ebc8ea01 | Tong SHEN | 2017-05-02 13:27:57 |
bpo-30228: FileIO seek() and tell() set seekable (#1384) | 999707373630ce090300c3c542066f493b12faa0 | Victor Stinner | 2017-05-02 13:10:39 |
bpo-30199: test_ssl closes all asyncore channels (#1381) | 1dae7450c68bad498e57800387b24cb103c461fa | Victor Stinner | 2017-05-02 11:12:02 |
bpo-30132: distutils BuildExtTestCase use temp_cwd (#1380) | 92fd6c9ef54a857815e3dca8ee74b2b4f5cdf154 | Victor Stinner | 2017-05-02 11:11:50 |
Clean up some confusing text left by PROTOCOL_SSLv23 -> PROTOCOL_TLS transition (#1355) | d4069de5112f0408801ff2479476827bb3e0e8fc | Nathaniel J. Smith | 2017-05-02 05:43:31 |
bpo-30190: improved error msg for assertAlmostEqual(delta=...) (#1331) | 5d7a8d0c13737fd531b722ad76c505ef47aac96a | Giampaolo Rodola | 2017-05-01 16:18:56 |
restore *data* parameter of binascii.b2a_base64 to positional-only (#1352) | 1374dbb6940f29c49c2966551a06015857c942cc | Xiang Zhang | 2017-05-01 05:12:07 |
bpo-29679: Implement @contextlib.asynccontextmanager (#360) | 2e624690bd74071358566300b7ef0bc45f444a30 | Jelle Zijlstra | 2017-05-01 01:25:58 |
bpo-30208: DOC: fix small typos in IDLE (#1354) | 9dc2b3809f38be2e403ee264958106badfda142d | csabella | 2017-04-29 22:28:36 |
bpo-30158: Fix deprecation warnings in test_importlib introduced by bpo-29576. (#1285) | 3cc8259b71ef784a9f7593f04da96043afe2228a | Serhiy Storchaka | 2017-04-29 04:06:49 |
Check that Python is 64-bit before enabling BLAKE2_USE_SSE. (#1332) | 6c991bdee7ec4bedd8c1b8d3812dc884b654b57c | Neil Schemenauer | 2017-04-28 16:56:48 |
File | Lines added | Lines deleted |
---|---|---|
Doc/extending/newtypes.rst | 1 | 1 |
Doc/howto/functional.rst | 3 | 3 |
Doc/library/ctypes.rst | 15 | 15 |
Doc/library/doctest.rst | 3 | 3 |
Doc/library/fpectl.rst | 1 | 1 |
Doc/library/pdb.rst | 1 | 1 |
Doc/library/unicodedata.rst | 1 | 1 |
Doc/reference/expressions.rst | 1 | 1 |
Doc/tutorial/classes.rst | 1 | 1 |
Doc/tutorial/controlflow.rst | 1 | 1 |
Doc/tutorial/datastructures.rst | 1 | 1 |
Doc/tutorial/inputoutput.rst | 1 | 1 |
File Doc/extending/newtypes.rst changed (mode: 100644) (index 449c1e2754..bd09aa695d) | |||
... | ... | our objects and in some error messages, for example:: | |
124 | 124 | ||
125 | 125 | >>> "" + noddy.new_noddy() | >>> "" + noddy.new_noddy() |
126 | 126 | Traceback (most recent call last): | Traceback (most recent call last): |
127 | File "<stdin>", line 1, in ? | ||
127 | File "<stdin>", line 1, in <module> | ||
128 | 128 | TypeError: cannot add type "noddy.Noddy" to string | TypeError: cannot add type "noddy.Noddy" to string |
129 | 129 | ||
130 | 130 | Note that the name is a dotted name that includes both the module name and the | Note that the name is a dotted name that includes both the module name and the |
File Doc/howto/functional.rst changed (mode: 100644) (index 8ae9679894..a82dca7077) | |||
... | ... | You can experiment with the iteration interface manually: | |
210 | 210 | 3 | 3 |
211 | 211 | >>> next(it) | >>> next(it) |
212 | 212 | Traceback (most recent call last): | Traceback (most recent call last): |
213 | File "<stdin>", line 1, in ? | ||
213 | File "<stdin>", line 1, in <module> | ||
214 | 214 | StopIteration | StopIteration |
215 | 215 | >>> | >>> |
216 | 216 | ||
... | ... | Here's a sample usage of the ``generate_ints()`` generator: | |
474 | 474 | 2 | 2 |
475 | 475 | >>> next(gen) | >>> next(gen) |
476 | 476 | Traceback (most recent call last): | Traceback (most recent call last): |
477 | File "stdin", line 1, in ? | ||
477 | File "stdin", line 1, in <module> | ||
478 | 478 | File "stdin", line 2, in generate_ints | File "stdin", line 2, in generate_ints |
479 | 479 | StopIteration | StopIteration |
480 | 480 | ||
... | ... | And here's an example of changing the counter: | |
577 | 577 | 9 | 9 |
578 | 578 | >>> next(it) #doctest: +SKIP | >>> next(it) #doctest: +SKIP |
579 | 579 | Traceback (most recent call last): | Traceback (most recent call last): |
580 | File "t.py", line 15, in ? | ||
580 | File "t.py", line 15, in <module> | ||
581 | 581 | it.next() | it.next() |
582 | 582 | StopIteration | StopIteration |
583 | 583 |
File Doc/library/ctypes.rst changed (mode: 100644) (index 49b4cbee5d..b18ce93979) | |||
... | ... | Functions are accessed as attributes of dll objects:: | |
97 | 97 | <_FuncPtr object at 0x...> | <_FuncPtr object at 0x...> |
98 | 98 | >>> print(windll.kernel32.MyOwnFunction) # doctest: +WINDOWS | >>> print(windll.kernel32.MyOwnFunction) # doctest: +WINDOWS |
99 | 99 | Traceback (most recent call last): | Traceback (most recent call last): |
100 | File "<stdin>", line 1, in ? | ||
100 | File "<stdin>", line 1, in <module> | ||
101 | 101 | File "ctypes.py", line 239, in __getattr__ | File "ctypes.py", line 239, in __getattr__ |
102 | 102 | func = _StdcallFuncPtr(name, self) | func = _StdcallFuncPtr(name, self) |
103 | 103 | AttributeError: function 'MyOwnFunction' not found | AttributeError: function 'MyOwnFunction' not found |
... | ... | functions can be accessed by indexing the dll object with the ordinal number:: | |
135 | 135 | <_FuncPtr object at 0x...> | <_FuncPtr object at 0x...> |
136 | 136 | >>> cdll.kernel32[0] # doctest: +WINDOWS | >>> cdll.kernel32[0] # doctest: +WINDOWS |
137 | 137 | Traceback (most recent call last): | Traceback (most recent call last): |
138 | File "<stdin>", line 1, in ? | ||
138 | File "<stdin>", line 1, in <module> | ||
139 | 139 | File "ctypes.py", line 310, in __getitem__ | File "ctypes.py", line 310, in __getitem__ |
140 | 140 | func = _StdcallFuncPtr(name, self) | func = _StdcallFuncPtr(name, self) |
141 | 141 | AttributeError: function ordinal 0 not found | AttributeError: function ordinal 0 not found |
... | ... | although an error is raised the function *has* been called:: | |
168 | 168 | ||
169 | 169 | >>> windll.kernel32.GetModuleHandleA() # doctest: +WINDOWS | >>> windll.kernel32.GetModuleHandleA() # doctest: +WINDOWS |
170 | 170 | Traceback (most recent call last): | Traceback (most recent call last): |
171 | File "<stdin>", line 1, in ? | ||
171 | File "<stdin>", line 1, in <module> | ||
172 | 172 | ValueError: Procedure probably called with not enough arguments (4 bytes missing) | ValueError: Procedure probably called with not enough arguments (4 bytes missing) |
173 | 173 | >>> windll.kernel32.GetModuleHandleA(0, 0) # doctest: +WINDOWS | >>> windll.kernel32.GetModuleHandleA(0, 0) # doctest: +WINDOWS |
174 | 174 | Traceback (most recent call last): | Traceback (most recent call last): |
175 | File "<stdin>", line 1, in ? | ||
175 | File "<stdin>", line 1, in <module> | ||
176 | 176 | ValueError: Procedure probably called with too many arguments (4 bytes in excess) | ValueError: Procedure probably called with too many arguments (4 bytes in excess) |
177 | 177 | >>> | >>> |
178 | 178 | ||
... | ... | The same exception is raised when you call an ``stdcall`` function with the | |
181 | 181 | ||
182 | 182 | >>> cdll.kernel32.GetModuleHandleA(None) # doctest: +WINDOWS | >>> cdll.kernel32.GetModuleHandleA(None) # doctest: +WINDOWS |
183 | 183 | Traceback (most recent call last): | Traceback (most recent call last): |
184 | File "<stdin>", line 1, in ? | ||
184 | File "<stdin>", line 1, in <module> | ||
185 | 185 | ValueError: Procedure probably called with not enough arguments (4 bytes missing) | ValueError: Procedure probably called with not enough arguments (4 bytes missing) |
186 | 186 | >>> | >>> |
187 | 187 | ||
188 | 188 | >>> windll.msvcrt.printf(b"spam") # doctest: +WINDOWS | >>> windll.msvcrt.printf(b"spam") # doctest: +WINDOWS |
189 | 189 | Traceback (most recent call last): | Traceback (most recent call last): |
190 | File "<stdin>", line 1, in ? | ||
190 | File "<stdin>", line 1, in <module> | ||
191 | 191 | ValueError: Procedure probably called with too many arguments (4 bytes in excess) | ValueError: Procedure probably called with too many arguments (4 bytes in excess) |
192 | 192 | >>> | >>> |
193 | 193 | ||
... | ... | argument values:: | |
200 | 200 | ||
201 | 201 | >>> windll.kernel32.GetModuleHandleA(32) # doctest: +WINDOWS | >>> windll.kernel32.GetModuleHandleA(32) # doctest: +WINDOWS |
202 | 202 | Traceback (most recent call last): | Traceback (most recent call last): |
203 | File "<stdin>", line 1, in ? | ||
203 | File "<stdin>", line 1, in <module> | ||
204 | 204 | OSError: exception: access violation reading 0x00000020 | OSError: exception: access violation reading 0x00000020 |
205 | 205 | >>> | >>> |
206 | 206 | ||
... | ... | from within *IDLE* or *PythonWin*:: | |
373 | 373 | 19 | 19 |
374 | 374 | >>> printf(b"%f bottles of beer\n", 42.5) | >>> printf(b"%f bottles of beer\n", 42.5) |
375 | 375 | Traceback (most recent call last): | Traceback (most recent call last): |
376 | File "<stdin>", line 1, in ? | ||
376 | File "<stdin>", line 1, in <module> | ||
377 | 377 | ArgumentError: argument 2: exceptions.TypeError: Don't know how to convert parameter 2 | ArgumentError: argument 2: exceptions.TypeError: Don't know how to convert parameter 2 |
378 | 378 | >>> | >>> |
379 | 379 | ||
... | ... | prototype for a C function), and tries to convert the arguments to valid types:: | |
436 | 436 | ||
437 | 437 | >>> printf(b"%d %d %d", 1, 2, 3) | >>> printf(b"%d %d %d", 1, 2, 3) |
438 | 438 | Traceback (most recent call last): | Traceback (most recent call last): |
439 | File "<stdin>", line 1, in ? | ||
439 | File "<stdin>", line 1, in <module> | ||
440 | 440 | ArgumentError: argument 2: exceptions.TypeError: wrong type | ArgumentError: argument 2: exceptions.TypeError: wrong type |
441 | 441 | >>> printf(b"%s %d %f\n", b"X", 2, 3) | >>> printf(b"%s %d %f\n", b"X", 2, 3) |
442 | 442 | X 2 3.000000 | X 2 3.000000 |
... | ... | single character Python bytes object into a C char:: | |
486 | 486 | 'def' | 'def' |
487 | 487 | >>> strchr(b"abcdef", b"def") | >>> strchr(b"abcdef", b"def") |
488 | 488 | Traceback (most recent call last): | Traceback (most recent call last): |
489 | File "<stdin>", line 1, in ? | ||
489 | File "<stdin>", line 1, in <module> | ||
490 | 490 | ArgumentError: argument 2: exceptions.TypeError: one character string expected | ArgumentError: argument 2: exceptions.TypeError: one character string expected |
491 | 491 | >>> print(strchr(b"abcdef", b"x")) | >>> print(strchr(b"abcdef", b"x")) |
492 | 492 | None | None |
... | ... | useful to check for error return values and automatically raise an exception:: | |
512 | 512 | 486539264 | 486539264 |
513 | 513 | >>> GetModuleHandle("something silly") # doctest: +WINDOWS | >>> GetModuleHandle("something silly") # doctest: +WINDOWS |
514 | 514 | Traceback (most recent call last): | Traceback (most recent call last): |
515 | File "<stdin>", line 1, in ? | ||
515 | File "<stdin>", line 1, in <module> | ||
516 | 516 | File "<stdin>", line 3, in ValidHandle | File "<stdin>", line 3, in ValidHandle |
517 | 517 | OSError: [Errno 126] The specified module could not be found. | OSError: [Errno 126] The specified module could not be found. |
518 | 518 | >>> | >>> |
... | ... | Here is a simple example of a POINT structure, which contains two integers named | |
583 | 583 | 0 5 | 0 5 |
584 | 584 | >>> POINT(1, 2, 3) | >>> POINT(1, 2, 3) |
585 | 585 | Traceback (most recent call last): | Traceback (most recent call last): |
586 | File "<stdin>", line 1, in ? | ||
586 | File "<stdin>", line 1, in <module> | ||
587 | 587 | ValueError: too many initializers | ValueError: too many initializers |
588 | 588 | >>> | >>> |
589 | 589 | ||
... | ... | new type:: | |
786 | 786 | <class 'ctypes.LP_c_long'> | <class 'ctypes.LP_c_long'> |
787 | 787 | >>> PI(42) | >>> PI(42) |
788 | 788 | Traceback (most recent call last): | Traceback (most recent call last): |
789 | File "<stdin>", line 1, in ? | ||
789 | File "<stdin>", line 1, in <module> | ||
790 | 790 | TypeError: expected c_long instead of int | TypeError: expected c_long instead of int |
791 | 791 | >>> PI(c_int(42)) | >>> PI(c_int(42)) |
792 | 792 | <ctypes.LP_c_long object at 0x...> | <ctypes.LP_c_long object at 0x...> |
... | ... | but not instances of other types:: | |
862 | 862 | ||
863 | 863 | >>> bar.values = (c_byte * 4)() | >>> bar.values = (c_byte * 4)() |
864 | 864 | Traceback (most recent call last): | Traceback (most recent call last): |
865 | File "<stdin>", line 1, in ? | ||
865 | File "<stdin>", line 1, in <module> | ||
866 | 866 | TypeError: incompatible types, c_byte_Array_4 instance instead of LP_c_long instance | TypeError: incompatible types, c_byte_Array_4 instance instead of LP_c_long instance |
867 | 867 | >>> | >>> |
868 | 868 | ||
... | ... | work:: | |
913 | 913 | ... ("next", POINTER(cell))] | ... ("next", POINTER(cell))] |
914 | 914 | ... | ... |
915 | 915 | Traceback (most recent call last): | Traceback (most recent call last): |
916 | File "<stdin>", line 1, in ? | ||
916 | File "<stdin>", line 1, in <module> | ||
917 | 917 | File "<stdin>", line 2, in cell | File "<stdin>", line 2, in cell |
918 | 918 | NameError: name 'cell' is not defined | NameError: name 'cell' is not defined |
919 | 919 | >>> | >>> |
File Doc/library/doctest.rst changed (mode: 100644) (index 15b12f7aa7..587a0a09a9) | |||
... | ... | Simple example:: | |
408 | 408 | ||
409 | 409 | >>> [1, 2, 3].remove(42) | >>> [1, 2, 3].remove(42) |
410 | 410 | Traceback (most recent call last): | Traceback (most recent call last): |
411 | File "<stdin>", line 1, in ? | ||
411 | File "<stdin>", line 1, in <module> | ||
412 | 412 | ValueError: list.remove(x): x not in list | ValueError: list.remove(x): x not in list |
413 | 413 | ||
414 | 414 | That doctest succeeds if :exc:`ValueError` is raised, with the ``list.remove(x): | That doctest succeeds if :exc:`ValueError` is raised, with the ``list.remove(x): |
... | ... | multi-line detail:: | |
432 | 432 | ||
433 | 433 | >>> raise ValueError('multi\n line\ndetail') | >>> raise ValueError('multi\n line\ndetail') |
434 | 434 | Traceback (most recent call last): | Traceback (most recent call last): |
435 | File "<stdin>", line 1, in ? | ||
435 | File "<stdin>", line 1, in <module> | ||
436 | 436 | ValueError: multi | ValueError: multi |
437 | 437 | line | line |
438 | 438 | detail | detail |
... | ... | doctest decides whether actual output matches an example's expected output: | |
591 | 591 | ||
592 | 592 | >>> (1, 2)[3] = 'moo' | >>> (1, 2)[3] = 'moo' |
593 | 593 | Traceback (most recent call last): | Traceback (most recent call last): |
594 | File "<stdin>", line 1, in ? | ||
594 | File "<stdin>", line 1, in <module> | ||
595 | 595 | TypeError: object doesn't support item assignment | TypeError: object doesn't support item assignment |
596 | 596 | ||
597 | 597 | passes under Python 2.3 and later Python versions with the flag specified, | passes under Python 2.3 and later Python versions with the flag specified, |
File Doc/library/fpectl.rst changed (mode: 100644) (index e4b528cf0b..96607165ba) | |||
... | ... | The following example demonstrates how to start up and test operation of the | |
89 | 89 | >>> import math | >>> import math |
90 | 90 | >>> math.exp(1000) | >>> math.exp(1000) |
91 | 91 | Traceback (most recent call last): | Traceback (most recent call last): |
92 | File "<stdin>", line 1, in ? | ||
92 | File "<stdin>", line 1, in <module> | ||
93 | 93 | FloatingPointError: in math_1 | FloatingPointError: in math_1 |
94 | 94 | ||
95 | 95 |
File Doc/library/pdb.rst changed (mode: 100644) (index 7c37bb7d24..6225a3a1f0) | |||
... | ... | The typical usage to inspect a crashed program is:: | |
76 | 76 | >>> import mymodule | >>> import mymodule |
77 | 77 | >>> mymodule.test() | >>> mymodule.test() |
78 | 78 | Traceback (most recent call last): | Traceback (most recent call last): |
79 | File "<stdin>", line 1, in ? | ||
79 | File "<stdin>", line 1, in <module> | ||
80 | 80 | File "./mymodule.py", line 4, in test | File "./mymodule.py", line 4, in test |
81 | 81 | test2() | test2() |
82 | 82 | File "./mymodule.py", line 3, in test2 | File "./mymodule.py", line 3, in test2 |
File Doc/library/unicodedata.rst changed (mode: 100644) (index 643180953f..2a97776095) | |||
... | ... | Examples: | |
158 | 158 | 9 | 9 |
159 | 159 | >>> unicodedata.decimal('a') | >>> unicodedata.decimal('a') |
160 | 160 | Traceback (most recent call last): | Traceback (most recent call last): |
161 | File "<stdin>", line 1, in ? | ||
161 | File "<stdin>", line 1, in <module> | ||
162 | 162 | ValueError: not a decimal | ValueError: not a decimal |
163 | 163 | >>> unicodedata.category('A') # 'L'etter, 'u'ppercase | >>> unicodedata.category('A') # 'L'etter, 'u'ppercase |
164 | 164 | 'Lu' | 'Lu' |
File Doc/reference/expressions.rst changed (mode: 100644) (index 6e9e07a809..b065d198b1) | |||
... | ... | keyword arguments (and any ``**expression`` arguments -- see below). So:: | |
905 | 905 | 2 1 | 2 1 |
906 | 906 | >>> f(a=1, *(2,)) | >>> f(a=1, *(2,)) |
907 | 907 | Traceback (most recent call last): | Traceback (most recent call last): |
908 | File "<stdin>", line 1, in ? | ||
908 | File "<stdin>", line 1, in <module> | ||
909 | 909 | TypeError: f() got multiple values for keyword argument 'a' | TypeError: f() got multiple values for keyword argument 'a' |
910 | 910 | >>> f(1, *(2,)) | >>> f(1, *(2,)) |
911 | 911 | 1 2 | 1 2 |
File Doc/tutorial/classes.rst changed (mode: 100644) (index e134d5d62e..073444cf8b) | |||
... | ... | using the :func:`next` built-in function; this example shows how it all works:: | |
784 | 784 | 'c' | 'c' |
785 | 785 | >>> next(it) | >>> next(it) |
786 | 786 | Traceback (most recent call last): | Traceback (most recent call last): |
787 | File "<stdin>", line 1, in ? | ||
787 | File "<stdin>", line 1, in <module> | ||
788 | 788 | next(it) | next(it) |
789 | 789 | StopIteration | StopIteration |
790 | 790 |
File Doc/tutorial/controlflow.rst changed (mode: 100644) (index 6a9bb4889f..54171bc96f) | |||
... | ... | Here's an example that fails due to this restriction:: | |
475 | 475 | ... | ... |
476 | 476 | >>> function(0, a=0) | >>> function(0, a=0) |
477 | 477 | Traceback (most recent call last): | Traceback (most recent call last): |
478 | File "<stdin>", line 1, in ? | ||
478 | File "<stdin>", line 1, in <module> | ||
479 | 479 | TypeError: function() got multiple values for keyword argument 'a' | TypeError: function() got multiple values for keyword argument 'a' |
480 | 480 | ||
481 | 481 | When a final formal parameter of the form ``**name`` is present, it receives a | When a final formal parameter of the form ``**name`` is present, it receives a |
File Doc/tutorial/datastructures.rst changed (mode: 100644) (index 74a1ee7331..62be9a0e9d) | |||
... | ... | it must be parenthesized. :: | |
261 | 261 | [(0, 0), (1, 1), (2, 4), (3, 9), (4, 16), (5, 25)] | [(0, 0), (1, 1), (2, 4), (3, 9), (4, 16), (5, 25)] |
262 | 262 | >>> # the tuple must be parenthesized, otherwise an error is raised | >>> # the tuple must be parenthesized, otherwise an error is raised |
263 | 263 | >>> [x, x**2 for x in range(6)] | >>> [x, x**2 for x in range(6)] |
264 | File "<stdin>", line 1, in ? | ||
264 | File "<stdin>", line 1, in <module> | ||
265 | 265 | [x, x**2 for x in range(6)] | [x, x**2 for x in range(6)] |
266 | 266 | ^ | ^ |
267 | 267 | SyntaxError: invalid syntax | SyntaxError: invalid syntax |
File Doc/tutorial/inputoutput.rst changed (mode: 100644) (index beeaac36b9..bad0302b03) | |||
... | ... | attempts to use the file object will automatically fail. :: | |
362 | 362 | >>> f.close() | >>> f.close() |
363 | 363 | >>> f.read() | >>> f.read() |
364 | 364 | Traceback (most recent call last): | Traceback (most recent call last): |
365 | File "<stdin>", line 1, in ? | ||
365 | File "<stdin>", line 1, in <module> | ||
366 | 366 | ValueError: I/O operation on closed file | ValueError: I/O operation on closed file |
367 | 367 | ||
368 | 368 | It is good practice to use the :keyword:`with` keyword when dealing with file | It is good practice to use the :keyword:`with` keyword when dealing with file |