eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.Simplify.ast_unparse.html

branch
eric7
changeset 8440
f71f33c0d47a
parent 8372
e0227a7c850e
child 8596
d64760b2da50
--- a/eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.Simplify.ast_unparse.html	Wed Jun 23 18:54:41 2021 +0200
+++ b/eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.Simplify.ast_unparse.html	Wed Jun 23 18:55:54 2021 +0200
@@ -39,6 +39,10 @@
 <td><a href="#_Unparser">_Unparser</a></td>
 <td>Methods in this class recursively traverse an AST and output source code for the abstract syntax; original formatting is disregarded.</td>
 </tr>
+<tr>
+<td><a href="#nullcontext">nullcontext</a></td>
+<td>Context manager that does no additional processing.</td>
+</tr>
 </table>
 <h3>Functions</h3>
 
@@ -934,6 +938,71 @@
 <div align="right"><a href="#top">Up</a></div>
 <hr />
 <hr />
+<a NAME="nullcontext" ID="nullcontext"></a>
+<h2>nullcontext</h2>
+
+<p>
+Context manager that does no additional processing.
+</p>
+<p>
+        Used as a stand-in for a normal context manager, when a particular
+        block of code is only sometimes used with a normal context manager:
+</p>
+<p>
+        cm = optional_cm if condition else nullcontext()
+        with cm:
+            # Perform operation, using optional_cm if condition is True
+</p>
+<h3>Derived from</h3>
+AbstractContextManager
+<h3>Class Attributes</h3>
+
+<table>
+<tr><td>None</td></tr>
+</table>
+<h3>Class Methods</h3>
+
+<table>
+<tr><td>None</td></tr>
+</table>
+<h3>Methods</h3>
+
+<table>
+
+<tr>
+<td><a href="#nullcontext.__init__">nullcontext</a></td>
+<td></td>
+</tr>
+<tr>
+<td><a href="#nullcontext.__enter__">__enter__</a></td>
+<td></td>
+</tr>
+<tr>
+<td><a href="#nullcontext.__exit__">__exit__</a></td>
+<td></td>
+</tr>
+</table>
+<h3>Static Methods</h3>
+
+<table>
+<tr><td>None</td></tr>
+</table>
+
+<a NAME="nullcontext.__init__" ID="nullcontext.__init__"></a>
+<h4>nullcontext (Constructor)</h4>
+<b>nullcontext</b>(<i>enter_result=None</i>)
+
+<a NAME="nullcontext.__enter__" ID="nullcontext.__enter__"></a>
+<h4>nullcontext.__enter__</h4>
+<b>__enter__</b>(<i></i>)
+
+<a NAME="nullcontext.__exit__" ID="nullcontext.__exit__"></a>
+<h4>nullcontext.__exit__</h4>
+<b>__exit__</b>(<i>*excinfo</i>)
+
+<div align="right"><a href="#top">Up</a></div>
+<hr />
+<hr />
 <a NAME="unparse" ID="unparse"></a>
 <h2>unparse</h2>
 <b>unparse</b>(<i>ast_obj</i>)

eric ide

mercurial