mirror of
https://github.com/kennethreitz/dive-into-python3.git
synced 2026-06-05 23:10:17 +00:00
more deleting of incredibly confusing description of "with" blocks
This commit is contained in:
@@ -717,8 +717,6 @@ class FieldStorage:
|
||||
|
||||
<p>A <code>with</code> block defines a <a href=http://www.python.org/doc/3.1/library/stdtypes.html#typecontextmanager>runtime context</a>; you “enter” the context when you execute the <code>with</code> statement, and you “exit” the context after you execute the last statement in the block.
|
||||
|
||||
<p>Any class can be used in a <code>with</code> block; no special methods are required. The Python interpreter will automatically set up the runtime context and dispatch all the property and method lookups to your class. However, if you want your class to do something special upon entering or exiting a runtime context, you can define the following special methods.
|
||||
|
||||
<table>
|
||||
<tr><th>Notes
|
||||
<th>You Want…
|
||||
|
||||
Reference in New Issue
Block a user