--- a/src/eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html Thu Jan 04 17:16:15 2024 +0100 +++ b/src/eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html Thu Jan 04 18:02:25 2024 +0100 @@ -7,19 +7,17 @@ <body> <a NAME="top" ID="top"></a> <h1>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor</h1> - <p> Module implementing a node visitor for function type annotations. </p> + <h3>Global Attributes</h3> - <table> <tr><td>AST_ARG_TYPES</td></tr> </table> + <h3>Classes</h3> - <table> - <tr> <td><a href="#Argument">Argument</a></td> <td>Class representing a function argument.</td> @@ -37,61 +35,59 @@ <td>Class implementing a node visitor to check the return statements of a function node.</td> </tr> </table> + <h3>Functions</h3> - <table> <tr><td>None</td></tr> </table> + <hr /> <hr /> <a NAME="Argument" ID="Argument"></a> <h2>Argument</h2> - <p> Class representing a function argument. </p> + <h3>Derived from</h3> None <h3>Class Attributes</h3> - <table> <tr><td>None</td></tr> </table> + <h3>Class Methods</h3> - <table> - <tr> <td><a href="#Argument.fromNode">fromNode</a></td> <td>Class method to create an Argument object based on the given node.</td> </tr> </table> + <h3>Methods</h3> - <table> - <tr> <td><a href="#Argument.__init__">Argument</a></td> <td>Constructor</td> </tr> </table> + <h3>Static Methods</h3> - <table> - <tr> <td><a href="#Argument._isAnnotatedAny">_isAnnotatedAny</a></td> <td>Static method to check if the provided expression node is annotated with 'typing.Any'.</td> </tr> </table> + <a NAME="Argument.fromNode" ID="Argument.fromNode"></a> <h4>Argument.fromNode (class method)</h4> <b>fromNode</b>(<i>node, annotationTypeName</i>) - <p> Class method to create an Argument object based on the given node. </p> + <dl> <dt><i>node</i> (ast.arguments)</dt> @@ -118,10 +114,10 @@ <a NAME="Argument.__init__" ID="Argument.__init__"></a> <h4>Argument (Constructor)</h4> <b>Argument</b>(<i>argname, lineno, col_offset, annotationType, hasTypeAnnotation=False, hasTypeComment=False, isDynamicallyTyped=False, </i>) - <p> Constructor </p> + <dl> <dt><i>argname</i> (str)</dt> @@ -158,7 +154,6 @@ <a NAME="Argument._isAnnotatedAny" ID="Argument._isAnnotatedAny"></a> <h4>Argument._isAnnotatedAny (static)</h4> <b>_isAnnotatedAny</b>(<i></i>) - <p> Static method to check if the provided expression node is annotated with 'typing.Any'. @@ -169,6 +164,7 @@ * 'import typing; foo: typing.Any' * 'import typing as <alias>; foo: <alias>.Any' </p> + <dl> <dt><i>argExpr</i> (ast.expr or str)</dt> @@ -193,30 +189,27 @@ <hr /> <a NAME="Function" ID="Function"></a> <h2>Function</h2> - <p> Class representing a function. </p> + <h3>Derived from</h3> None <h3>Class Attributes</h3> - <table> <tr><td>None</td></tr> </table> + <h3>Class Methods</h3> - <table> - <tr> <td><a href="#Function.fromNode">fromNode</a></td> <td>Class method to create a Function object from ast.FunctionDef or ast.AsyncFunctionDef nodes.</td> </tr> </table> + <h3>Methods</h3> - <table> - <tr> <td><a href="#Function.__init__">Function</a></td> <td>Constructor</td> @@ -246,10 +239,9 @@ <td>Public method to check, if the function definition is fully type annotated.</td> </tr> </table> + <h3>Static Methods</h3> - <table> - <tr> <td><a href="#Function._singleLineColonSeeker">_singleLineColonSeeker</a></td> <td>Static method to find the line & column indices of a single line function definition.</td> @@ -268,10 +260,10 @@ </tr> </table> + <a NAME="Function.fromNode" ID="Function.fromNode"></a> <h4>Function.fromNode (class method)</h4> <b>fromNode</b>(<i>node, lines, **kwargs</i>) - <p> Class method to create a Function object from ast.FunctionDef or ast.AsyncFunctionDef nodes. @@ -287,6 +279,7 @@ * class_decorator_type * args </p> + <dl> <dt><i>node</i> (ast.AsyncFunctionDef or ast.FunctionDef)</dt> @@ -317,10 +310,10 @@ <a NAME="Function.__init__" ID="Function.__init__"></a> <h4>Function (Constructor)</h4> <b>Function</b>(<i>name, lineno, col_offset, functionType=FunctionType.PUBLIC, isClassMethod=False, classDecoratorType=None, isReturnAnnotated=False, hasTypeComment=False, hasOnlyNoneReturns=True, isNested=False, decoratorList=None, args=None, </i>) - <p> Constructor </p> + <dl> <dt><i>name</i> (str)</dt> @@ -380,7 +373,6 @@ <a NAME="Function.__decoratorChecker" ID="Function.__decoratorChecker"></a> <h4>Function.__decoratorChecker</h4> <b>__decoratorChecker</b>(<i>decorator, checkDecorators</i>) - <p> Private method to check the provided decorator for a match against the provided set of check names. @@ -393,6 +385,7 @@ <p> Note: Deeper imports (e.g. `a.b.name`) are not explicitly supported. </p> + <dl> <dt><i>decorator</i> (ast.Attribute, ast.Call or ast.Name)</dt> @@ -419,10 +412,10 @@ <a NAME="Function.getAnnotatedArguments" ID="Function.getAnnotatedArguments"></a> <h4>Function.getAnnotatedArguments</h4> <b>getAnnotatedArguments</b>(<i></i>) - <p> Public method to get list of arguments with type annotations. </p> + <dl> <dt>Return:</dt> <dd> @@ -438,11 +431,11 @@ <a NAME="Function.getMissedAnnotations" ID="Function.getMissedAnnotations"></a> <h4>Function.getMissedAnnotations</h4> <b>getMissedAnnotations</b>(<i></i>) - <p> Public method to provide a list of arguments with missing type annotations. </p> + <dl> <dt>Return:</dt> <dd> @@ -458,7 +451,6 @@ <a NAME="Function.hasDecorator" ID="Function.hasDecorator"></a> <h4>Function.hasDecorator</h4> <b>hasDecorator</b>(<i>checkDecorators</i>) - <p> Public method to check whether the function node is decorated by any of the provided decorators. @@ -474,6 +466,7 @@ Note: Deeper decorator imports (e.g. `a.b.overload`) are not explicitly supported. </p> + <dl> <dt><i>checkDecorators</i> (set of str)</dt> @@ -496,11 +489,11 @@ <a NAME="Function.isDynamicallyTyped" ID="Function.isDynamicallyTyped"></a> <h4>Function.isDynamicallyTyped</h4> <b>isDynamicallyTyped</b>(<i></i>) - <p> Public method to check, if a function definition is dynamically typed (i.e. completely lacking hints). </p> + <dl> <dt>Return:</dt> <dd> @@ -516,7 +509,6 @@ <a NAME="Function.isFullyAnnotated" ID="Function.isFullyAnnotated"></a> <h4>Function.isFullyAnnotated</h4> <b>isFullyAnnotated</b>(<i></i>) - <p> Public method to check, if the function definition is fully type annotated. @@ -524,6 +516,7 @@ <p> Note: self.args will always include an Argument object for return. </p> + <dl> <dt>Return:</dt> <dd> @@ -539,11 +532,11 @@ <a NAME="Function._singleLineColonSeeker" ID="Function._singleLineColonSeeker"></a> <h4>Function._singleLineColonSeeker (static)</h4> <b>_singleLineColonSeeker</b>(<i>line</i>) - <p> Static method to find the line & column indices of a single line function definition. </p> + <dl> <dt><i>node</i> (ast.AsyncFunctionDef or ast.FunctionDef)</dt> @@ -570,11 +563,11 @@ <a NAME="Function.colonSeeker" ID="Function.colonSeeker"></a> <h4>Function.colonSeeker (static)</h4> <b>colonSeeker</b>(<i>lines</i>) - <p> Static method to find the line & column indices of the function definition's closing colon. </p> + <dl> <dt><i>node</i> (ast.AsyncFunctionDef or ast.FunctionDef)</dt> @@ -601,7 +594,6 @@ <a NAME="Function.getClassDecoratorType" ID="Function.getClassDecoratorType"></a> <h4>Function.getClassDecoratorType (static)</h4> <b>getClassDecoratorType</b>(<i></i>) - <p> Static method to get the class method's decorator type from its function node. @@ -614,6 +606,7 @@ If @classmethod or @staticmethod decorators are not present, this function will return None. </p> + <dl> <dt><i>functionNode</i> (ast.AsyncFunctionDef or ast.FunctionDef)</dt> @@ -636,7 +629,6 @@ <a NAME="Function.getFunctionType" ID="Function.getFunctionType"></a> <h4>Function.getFunctionType (static)</h4> <b>getFunctionType</b>(<i></i>) - <p> Static method to determine the function's FunctionType from its name. </p> @@ -647,6 +639,7 @@ 3. Protected: function name prefixed by "_" 4. Public: everything else </p> + <dl> <dt><i>functionName</i> (str)</dt> @@ -671,26 +664,27 @@ <hr /> <a NAME="FunctionVisitor" ID="FunctionVisitor"></a> <h2>FunctionVisitor</h2> - <p> Class implementing a node visitor to check function annotations. </p> + <h3>Derived from</h3> ast.NodeVisitor <h3>Class Attributes</h3> +<table> +<tr><td>AstFuncTypes</td></tr> +<tr><td>visit_AsyncFunctionDef</td></tr> +<tr><td>visit_ClassDef</td></tr> +<tr><td>visit_FunctionDef</td></tr> +</table> -<table> -<tr><td>AstFuncTypes</td></tr><tr><td>visit_AsyncFunctionDef</td></tr><tr><td>visit_ClassDef</td></tr><tr><td>visit_FunctionDef</td></tr> -</table> <h3>Class Methods</h3> - <table> <tr><td>None</td></tr> </table> + <h3>Methods</h3> - <table> - <tr> <td><a href="#FunctionVisitor.__init__">FunctionVisitor</a></td> <td>Constructor</td> @@ -700,19 +694,20 @@ <td>Public method implementing a context switcher as a generic function visitor in order to track function context.</td> </tr> </table> + <h3>Static Methods</h3> - <table> <tr><td>None</td></tr> </table> + <a NAME="FunctionVisitor.__init__" ID="FunctionVisitor.__init__"></a> <h4>FunctionVisitor (Constructor)</h4> <b>FunctionVisitor</b>(<i>lines</i>) - <p> Constructor </p> + <dl> <dt><i>lines</i> (list of str)</dt> @@ -723,7 +718,6 @@ <a NAME="FunctionVisitor.switchContext" ID="FunctionVisitor.switchContext"></a> <h4>FunctionVisitor.switchContext</h4> <b>switchContext</b>(<i>node</i>) - <p> Public method implementing a context switcher as a generic function visitor in order to track function context. @@ -733,6 +727,7 @@ differentiate class methods from "regular" functions, especially in the case of nested classes. </p> + <dl> <dt><i>node</i> (ast.AsyncFunctionDef or ast.FunctionDef)</dt> @@ -745,7 +740,6 @@ <hr /> <a NAME="ReturnVisitor" ID="ReturnVisitor"></a> <h2>ReturnVisitor</h2> - <p> Class implementing a node visitor to check the return statements of a function node. @@ -766,22 +760,22 @@ added to a set that is checked to see whether nor not the parent node is present. </p> + <h3>Derived from</h3> ast.NodeVisitor <h3>Class Attributes</h3> +<table> +<tr><td>visit_AsyncFunctionDef</td></tr> +<tr><td>visit_FunctionDef</td></tr> +</table> -<table> -<tr><td>visit_AsyncFunctionDef</td></tr><tr><td>visit_FunctionDef</td></tr> -</table> <h3>Class Methods</h3> - <table> <tr><td>None</td></tr> </table> + <h3>Methods</h3> - <table> - <tr> <td><a href="#ReturnVisitor.__init__">ReturnVisitor</a></td> <td>Constructor</td> @@ -799,19 +793,20 @@ <td>Public method to check each Return node to see if it returns anything other than `None`.</td> </tr> </table> + <h3>Static Methods</h3> - <table> <tr><td>None</td></tr> </table> + <a NAME="ReturnVisitor.__init__" ID="ReturnVisitor.__init__"></a> <h4>ReturnVisitor (Constructor)</h4> <b>ReturnVisitor</b>(<i>parentNode</i>) - <p> Constructor </p> + <dl> <dt><i>parentNode</i> (ast.AsyncFunctionDef or ast.FunctionDef)</dt> @@ -823,11 +818,11 @@ <a NAME="ReturnVisitor.hasOnlyNoneReturns" ID="ReturnVisitor.hasOnlyNoneReturns"></a> <h4>ReturnVisitor.hasOnlyNoneReturns</h4> <b>hasOnlyNoneReturns</b>(<i></i>) - <p> Public method indicating, that the parent node isn't in the visited nodes that don't return `None`. </p> + <dl> <dt>Return:</dt> <dd> @@ -844,7 +839,6 @@ <a NAME="ReturnVisitor.switchContext" ID="ReturnVisitor.switchContext"></a> <h4>ReturnVisitor.switchContext</h4> <b>switchContext</b>(<i>node</i>) - <p> Public method implementing a context switcher as a generic function visitor in order to track function context. @@ -854,6 +848,7 @@ differentiate class methods from "regular" functions, especially in the case of nested classes. </p> + <dl> <dt><i>node</i> (ast.AsyncFunctionDef or ast.FunctionDef)</dt> @@ -864,7 +859,6 @@ <a NAME="ReturnVisitor.visit_Return" ID="ReturnVisitor.visit_Return"></a> <h4>ReturnVisitor.visit_Return</h4> <b>visit_Return</b>(<i>node</i>) - <p> Public method to check each Return node to see if it returns anything other than `None`. @@ -874,6 +868,7 @@ parent context is added to the set of non-returning child nodes of the parent node. </p> + <dl> <dt><i>node</i> (ast.Return)</dt> @@ -883,4 +878,4 @@ </dl> <div align="right"><a href="#top">Up</a></div> <hr /> -</body></html> \ No newline at end of file +</body></html>