mirror of
https://github.com/kennethreitz/dive-into-python3.git
synced 2026-06-05 23:10:17 +00:00
finished #stdio and #redirect sections, added xrefs in appendix B, added new example file
This commit is contained in:
@@ -759,6 +759,8 @@ def __exit__(self, *args):
|
||||
<p><span class=u>☞</span>The <code>__exit__()</code> method will always be called, even if an exception is raised inside the <code>with</code> block. In fact, if an exception is raises, the exception information will be passed to the <code>__exit__()</code> method. See <a href=http://www.python.org/doc/3.0/reference/datamodel.html#with-statement-context-managers>With Statement Context Managers</a> for more details.
|
||||
</blockquote>
|
||||
|
||||
<p>For more on context managers, see <a href=files.html#with>Closing Files Automatically</a> and <a href=files.html#redirect>Redirecting Standard Output</a>.
|
||||
|
||||
<h2 id=esoterica>Really Esoteric Stuff</h2>
|
||||
|
||||
<p>If you know what you’re doing, you can gain almost complete control over how classes are compared, how attributes are defined, and what kinds of classes are considered subclasses of your class.
|
||||
|
||||
Reference in New Issue
Block a user