[docs] 7.2 Reading and Writing Files - No empty secondary prompt after "with" block

Adrián Herrera Arcila adr.her.arc.95 at gmail.com
Mon Dec 25 15:57:48 EST 2017


Only happening in docs for Python 3.

The statement:

>>>  with open('workfile') as f:
.  .  .         read_data = f.read()
>>>  f.closed
True

should be:

>>>  with open('workfile') as f:
.  .  .         read_data = f.read()
.  .  .
>>>  f.closed
True

This would avoid people writing the code by themselves (instead of copying
and pasting it) making the mistake of introducing "f.closed" in the
secondary prompt after the end of the "with" compound.

Thanks in advance and have a beautiful day, Adrián.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20171225/6aba0bd0/attachment-0001.html>


More information about the docs mailing list