--- a/src/eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html Tue May 23 14:39:14 2023 +0200 +++ b/src/eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html Tue May 23 15:58:50 2023 +0200 @@ -117,7 +117,7 @@ </dl> <a NAME="Argument.__init__" ID="Argument.__init__"></a> <h4>Argument (Constructor)</h4> -<b>Argument</b>(<i>argname, lineno, col_offset, annotationType, hasTypeAnnotation=False, has3107Annotation=False, hasTypeComment=False, isDynamicallyTyped=False, </i>) +<b>Argument</b>(<i>argname, lineno, col_offset, annotationType, hasTypeAnnotation=False, hasTypeComment=False, isDynamicallyTyped=False, </i>) <p> Constructor @@ -145,11 +145,6 @@ flag indicating the presence of a type annotation (defaults to False) </dd> -<dt><i>has3107Annotation</i> (bool (optional))</dt> -<dd> -flag indicating the presence of a PEP 3107 - annotation (defaults to False) -</dd> <dt><i>hasTypeComment</i> (bool (optional))</dt> <dd> flag indicating the presence of a type comment @@ -174,11 +169,6 @@ * 'import typing; foo: typing.Any' * 'import typing as <alias>; foo: <alias>.Any' </p> -<p> - Type comments are also supported. Inline type comments are assumed to be - passed here as 'str', and function-level type comments are assumed to be - passed as 'ast.expr'. -</p> <dl> <dt><i>argExpr</i> (ast.expr or str)</dt> @@ -261,10 +251,6 @@ <table> <tr> -<td><a href="#Function._maybeInjectClassArgument">_maybeInjectClassArgument</a></td> -<td>Static method to inject `self` or `cls` args into a type comment to align with PEP 3107-style annotations.</td> -</tr> -<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> </tr> @@ -280,10 +266,6 @@ <td><a href="#Function.getFunctionType">getFunctionType</a></td> <td>Static method to determine the function's FunctionType from its name.</td> </tr> -<tr> -<td><a href="#Function.tryTypeComment">tryTypeComment</a></td> -<td>Static method to infer type hints from a function-level type comment.</td> -</tr> </table> <a NAME="Function.fromNode" ID="Function.fromNode"></a> @@ -554,69 +536,6 @@ bool </dd> </dl> -<a NAME="Function._maybeInjectClassArgument" ID="Function._maybeInjectClassArgument"></a> -<h4>Function._maybeInjectClassArgument (static)</h4> -<b>_maybeInjectClassArgument</b>(<i>funcObj</i>) - -<p> - Static method to inject `self` or `cls` args into a type comment to - align with PEP 3107-style annotations. -</p> -<p> - Because PEP 484 does not describe a method to provide partial function- - level type comments, there is a potential for ambiguity in the context - of both class methods and classmethods when aligning type comments to - method arguments. -</p> -<p> - These two class methods, for example, should lint equivalently: -</p> -<p> - def bar(self, a): - # type: (int) -> int - ... -</p> -<p> - def bar(self, a: int) -> int - ... -</p> -<p> - When this example type comment is parsed by `ast` and then matched with - the method's arguments, it associates the `int` hint to `self` rather - than `a`, so a dummy hint needs to be provided in situations where - `self` or `class` are not hinted in the type comment in order to - achieve equivalent linting results to PEP-3107 style annotations. -</p> -<p> - A dummy `ast.Ellipses` constant is injected if the following criteria - are met: - 1. The function node is either a class method or classmethod - 2. The number of hinted args is at least 1 less than the number - of function args -</p> -<dl> - -<dt><i>hintTree</i> (ast.FunctionType)</dt> -<dd> -parsed type hint node -</dd> -<dt><i>funcObj</i> (Function)</dt> -<dd> -reference to the Function object -</dd> -</dl> -<dl> -<dt>Return:</dt> -<dd> -reference to the hint node -</dd> -</dl> -<dl> -<dt>Return Type:</dt> -<dd> -ast.FunctionType -</dd> -</dl> <a NAME="Function._singleLineColonSeeker" ID="Function._singleLineColonSeeker"></a> <h4>Function._singleLineColonSeeker (static)</h4> <b>_singleLineColonSeeker</b>(<i>line</i>) @@ -747,40 +666,6 @@ FunctionType </dd> </dl> -<a NAME="Function.tryTypeComment" ID="Function.tryTypeComment"></a> -<h4>Function.tryTypeComment (static)</h4> -<b>tryTypeComment</b>(<i>node</i>) - -<p> - Static method to infer type hints from a function-level type comment. -</p> -<p> - If a function is type commented it is assumed to have a return - annotation, otherwise Python will fail to parse the hint. -</p> -<dl> - -<dt><i>funcObj</i> (Function)</dt> -<dd> -reference to the Function object -</dd> -<dt><i>node</i> (ast.AsyncFunctionDef or ast.FunctionDef)</dt> -<dd> -reference to the function definition node -</dd> -</dl> -<dl> -<dt>Return:</dt> -<dd> -reference to the modified Function object -</dd> -</dl> -<dl> -<dt>Return Type:</dt> -<dd> -Function -</dd> -</dl> <div align="right"><a href="#top">Up</a></div> <hr /> <hr />