76 </tr> |
76 </tr> |
77 </table> |
77 </table> |
78 <h3>Static Methods</h3> |
78 <h3>Static Methods</h3> |
79 |
79 |
80 <table> |
80 <table> |
81 <tr><td>None</td></tr> |
81 |
|
82 <tr> |
|
83 <td><a href="#Argument._isAnnotatedAny">_isAnnotatedAny</a></td> |
|
84 <td>Static method to check if the provided expression node is annotated with 'typing.Any'.</td> |
|
85 </tr> |
82 </table> |
86 </table> |
83 |
87 |
84 <a NAME="Argument.fromNode" ID="Argument.fromNode"></a> |
88 <a NAME="Argument.fromNode" ID="Argument.fromNode"></a> |
85 <h4>Argument.fromNode (class method)</h4> |
89 <h4>Argument.fromNode (class method)</h4> |
86 <b>fromNode</b>(<i>node, annotationTypeName</i>) |
90 <b>fromNode</b>(<i>node, annotationTypeName</i>) |
111 Argument |
115 Argument |
112 </dd> |
116 </dd> |
113 </dl> |
117 </dl> |
114 <a NAME="Argument.__init__" ID="Argument.__init__"></a> |
118 <a NAME="Argument.__init__" ID="Argument.__init__"></a> |
115 <h4>Argument (Constructor)</h4> |
119 <h4>Argument (Constructor)</h4> |
116 <b>Argument</b>(<i>argname, lineno, col_offset, annotationType, hasTypeAnnotation=False, has3107Annotation=False, hasTypeComment=False, </i>) |
120 <b>Argument</b>(<i>argname, lineno, col_offset, annotationType, hasTypeAnnotation=False, has3107Annotation=False, hasTypeComment=False, isDynamicallyTyped=False, </i>) |
117 |
121 |
118 <p> |
122 <p> |
119 Constructor |
123 Constructor |
120 </p> |
124 </p> |
121 <dl> |
125 <dl> |
148 </dd> |
152 </dd> |
149 <dt><i>hasTypeComment</i> (bool (optional))</dt> |
153 <dt><i>hasTypeComment</i> (bool (optional))</dt> |
150 <dd> |
154 <dd> |
151 flag indicating the presence of a type comment |
155 flag indicating the presence of a type comment |
152 (defaults to False) |
156 (defaults to False) |
|
157 </dd> |
|
158 <dt><i>isDynamicallyTyped</i> (bool (optional))</dt> |
|
159 <dd> |
|
160 flag indicating dynamic typing (defaults to False) |
|
161 </dd> |
|
162 </dl> |
|
163 <a NAME="Argument._isAnnotatedAny" ID="Argument._isAnnotatedAny"></a> |
|
164 <h4>Argument._isAnnotatedAny (static)</h4> |
|
165 <b>_isAnnotatedAny</b>(<i></i>) |
|
166 |
|
167 <p> |
|
168 Static method to check if the provided expression node is annotated with |
|
169 'typing.Any'. |
|
170 </p> |
|
171 <p> |
|
172 Support is provided for the following patterns: |
|
173 * 'from typing import Any; foo: Any' |
|
174 * 'import typing; foo: typing.Any' |
|
175 * 'import typing as <alias>; foo: <alias>.Any' |
|
176 </p> |
|
177 <p> |
|
178 Type comments are also supported. Inline type comments are assumed to be |
|
179 passed here as 'str', and function-level type comments are assumed to be |
|
180 passed as 'ast.expr'. |
|
181 </p> |
|
182 <dl> |
|
183 |
|
184 <dt><i>argExpr</i> (ast.expr or str)</dt> |
|
185 <dd> |
|
186 DESCRIPTION |
|
187 </dd> |
|
188 </dl> |
|
189 <dl> |
|
190 <dt>Return:</dt> |
|
191 <dd> |
|
192 flag indicating an annotation with 'typing.Any' |
|
193 </dd> |
|
194 </dl> |
|
195 <dl> |
|
196 <dt>Return Type:</dt> |
|
197 <dd> |
|
198 bool |
153 </dd> |
199 </dd> |
154 </dl> |
200 </dl> |
155 <div align="right"><a href="#top">Up</a></div> |
201 <div align="right"><a href="#top">Up</a></div> |
156 <hr /> |
202 <hr /> |
157 <hr /> |
203 <hr /> |