Skip to content
Snippets Groups Projects
Commit 27ccd3d2 authored by Benjamin Peterson's avatar Benjamin Peterson
Browse files

use a more modern example

parent 028d6969
No related branches found
No related tags found
No related merge requests found
......@@ -81,9 +81,8 @@
</pre>
<p>The proper fix is:</p>
<pre class="literal-block">
f = open(&quot;filename&quot;, &quot;w&quot;)
f.write(&quot;stuff&quot;)
f.close()
with open(&quot;filename&quot;, &quot;w&quot;) as f:
f.write(&quot;stuff&quot;)
</pre>
</li>
<li><p class="first">We don't support certain attributes that were decided to be
......
......@@ -44,10 +44,9 @@
open("filename", "w").write("stuff")
The proper fix is::
f = open("filename", "w")
f.write("stuff")
f.close()
with open("filename", "w") as f:
f.write("stuff")
* We don't support certain attributes that were decided to be
implementation-dependent. For example ``gc.get_referrers``. ``gc.enable``
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment