|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric5.Utilities.py2flakes.checker</title> |
|
4 <meta charset="UTF-8"> |
|
5 <style> |
|
6 body { |
|
7 background: #EDECE6; |
|
8 margin: 0em 1em 10em 1em; |
|
9 color: black; |
|
10 } |
|
11 |
|
12 h1 { color: white; background: #85774A; } |
|
13 h2 { color: white; background: #85774A; } |
|
14 h3 { color: white; background: #9D936E; } |
|
15 h4 { color: white; background: #9D936E; } |
|
16 |
|
17 a { color: #BA6D36; } |
|
18 |
|
19 </style> |
|
20 </head> |
|
21 <body><a NAME="top" ID="top"></a> |
|
22 <h1>eric5.Utilities.py2flakes.checker</h1> |
|
23 |
|
24 <h3>Global Attributes</h3> |
|
25 <table> |
|
26 <tr><td>_MAGIC_GLOBALS</td></tr> |
|
27 </table> |
|
28 <h3>Classes</h3> |
|
29 <table> |
|
30 <tr> |
|
31 <td><a href="#Argument">Argument</a></td> |
|
32 <td>Represents binding a name as an argument.</td> |
|
33 </tr><tr> |
|
34 <td><a href="#Assignment">Assignment</a></td> |
|
35 <td>Represents binding a name with an explicit assignment.</td> |
|
36 </tr><tr> |
|
37 <td><a href="#Binding">Binding</a></td> |
|
38 <td>Represents the binding of a value to a name.</td> |
|
39 </tr><tr> |
|
40 <td><a href="#Checker">Checker</a></td> |
|
41 <td>I check the cleanliness and sanity of Python code.</td> |
|
42 </tr><tr> |
|
43 <td><a href="#ClassDefinition">ClassDefinition</a></td> |
|
44 <td></td> |
|
45 </tr><tr> |
|
46 <td><a href="#ClassScope">ClassScope</a></td> |
|
47 <td></td> |
|
48 </tr><tr> |
|
49 <td><a href="#Definition">Definition</a></td> |
|
50 <td>A binding that defines a function or a class.</td> |
|
51 </tr><tr> |
|
52 <td><a href="#ExportBinding">ExportBinding</a></td> |
|
53 <td>A binding created by an C{__all__} assignment.</td> |
|
54 </tr><tr> |
|
55 <td><a href="#FunctionDefinition">FunctionDefinition</a></td> |
|
56 <td></td> |
|
57 </tr><tr> |
|
58 <td><a href="#FunctionScope">FunctionScope</a></td> |
|
59 <td>I represent a name scope for a function.</td> |
|
60 </tr><tr> |
|
61 <td><a href="#Importation">Importation</a></td> |
|
62 <td>A binding created by an import statement.</td> |
|
63 </tr><tr> |
|
64 <td><a href="#ModuleScope">ModuleScope</a></td> |
|
65 <td></td> |
|
66 </tr><tr> |
|
67 <td><a href="#Scope">Scope</a></td> |
|
68 <td></td> |
|
69 </tr><tr> |
|
70 <td><a href="#UnBinding">UnBinding</a></td> |
|
71 <td>Created by the 'del' operator.</td> |
|
72 </tr> |
|
73 </table> |
|
74 <h3>Functions</h3> |
|
75 <table> |
|
76 <tr> |
|
77 <td><a href="#getNodeName">getNodeName</a></td> |
|
78 <td></td> |
|
79 </tr><tr> |
|
80 <td><a href="#iter_child_nodes">iter_child_nodes</a></td> |
|
81 <td>Yield all direct child nodes of *node*, that is, all fields that are nodes and all items of fields that are lists of nodes.</td> |
|
82 </tr> |
|
83 </table> |
|
84 <hr /><hr /> |
|
85 <a NAME="Argument" ID="Argument"></a> |
|
86 <h2>Argument</h2> |
|
87 <p> |
|
88 Represents binding a name as an argument. |
|
89 </p> |
|
90 <h3>Derived from</h3> |
|
91 Binding |
|
92 <h3>Class Attributes</h3> |
|
93 <table> |
|
94 <tr><td>None</td></tr> |
|
95 </table> |
|
96 <h3>Class Methods</h3> |
|
97 <table> |
|
98 <tr><td>None</td></tr> |
|
99 </table> |
|
100 <h3>Methods</h3> |
|
101 <table> |
|
102 <tr><td>None</td></tr> |
|
103 </table> |
|
104 <h3>Static Methods</h3> |
|
105 <table> |
|
106 <tr><td>None</td></tr> |
|
107 </table> |
|
108 |
|
109 <div align="right"><a href="#top">Up</a></div> |
|
110 <hr /><hr /> |
|
111 <a NAME="Assignment" ID="Assignment"></a> |
|
112 <h2>Assignment</h2> |
|
113 <p> |
|
114 Represents binding a name with an explicit assignment. |
|
115 </p><p> |
|
116 The checker will raise warnings for any Assignment that isn't used. Also, |
|
117 the checker does not consider assignments in tuple/list unpacking to be |
|
118 Assignments, rather it treats them as simple Bindings. |
|
119 </p> |
|
120 <h3>Derived from</h3> |
|
121 Binding |
|
122 <h3>Class Attributes</h3> |
|
123 <table> |
|
124 <tr><td>None</td></tr> |
|
125 </table> |
|
126 <h3>Class Methods</h3> |
|
127 <table> |
|
128 <tr><td>None</td></tr> |
|
129 </table> |
|
130 <h3>Methods</h3> |
|
131 <table> |
|
132 <tr><td>None</td></tr> |
|
133 </table> |
|
134 <h3>Static Methods</h3> |
|
135 <table> |
|
136 <tr><td>None</td></tr> |
|
137 </table> |
|
138 |
|
139 <div align="right"><a href="#top">Up</a></div> |
|
140 <hr /><hr /> |
|
141 <a NAME="Binding" ID="Binding"></a> |
|
142 <h2>Binding</h2> |
|
143 <p> |
|
144 Represents the binding of a value to a name. |
|
145 </p><p> |
|
146 The checker uses this to keep track of which names have been bound and |
|
147 which names have not. See L{Assignment} for a special type of binding that |
|
148 is checked with stricter rules. |
|
149 </p> |
|
150 <h3>Derived from</h3> |
|
151 object |
|
152 <h3>Class Attributes</h3> |
|
153 <table> |
|
154 <tr><td>None</td></tr> |
|
155 </table> |
|
156 <h3>Class Methods</h3> |
|
157 <table> |
|
158 <tr><td>None</td></tr> |
|
159 </table> |
|
160 <h3>Methods</h3> |
|
161 <table> |
|
162 <tr> |
|
163 <td><a href="#Binding.__init__">Binding</a></td> |
|
164 <td></td> |
|
165 </tr><tr> |
|
166 <td><a href="#Binding.__repr__">__repr__</a></td> |
|
167 <td></td> |
|
168 </tr><tr> |
|
169 <td><a href="#Binding.__str__">__str__</a></td> |
|
170 <td></td> |
|
171 </tr> |
|
172 </table> |
|
173 <h3>Static Methods</h3> |
|
174 <table> |
|
175 <tr><td>None</td></tr> |
|
176 </table> |
|
177 <a NAME="Binding.__init__" ID="Binding.__init__"></a> |
|
178 <h4>Binding (Constructor)</h4> |
|
179 <b>Binding</b>(<i>name, source</i>) |
|
180 <a NAME="Binding.__repr__" ID="Binding.__repr__"></a> |
|
181 <h4>Binding.__repr__</h4> |
|
182 <b>__repr__</b>(<i></i>) |
|
183 <a NAME="Binding.__str__" ID="Binding.__str__"></a> |
|
184 <h4>Binding.__str__</h4> |
|
185 <b>__str__</b>(<i></i>) |
|
186 |
|
187 <div align="right"><a href="#top">Up</a></div> |
|
188 <hr /><hr /> |
|
189 <a NAME="Checker" ID="Checker"></a> |
|
190 <h2>Checker</h2> |
|
191 <p> |
|
192 I check the cleanliness and sanity of Python code. |
|
193 </p> |
|
194 <h3>Derived from</h3> |
|
195 object |
|
196 <h3>Class Attributes</h3> |
|
197 <table> |
|
198 <tr><td>AND</td></tr><tr><td>BOOLOP</td></tr><tr><td>COMPREHENSION</td></tr><tr><td>CONTINUE</td></tr><tr><td>GENERATOREXP</td></tr><tr><td>LOAD</td></tr><tr><td>NONLOCAL</td></tr><tr><td>NUM</td></tr><tr><td>RETURN</td></tr><tr><td>SLICE</td></tr><tr><td>builtIns</td></tr><tr><td>nodeDepth</td></tr><tr><td>traceTree</td></tr> |
|
199 </table> |
|
200 <h3>Class Methods</h3> |
|
201 <table> |
|
202 <tr><td>None</td></tr> |
|
203 </table> |
|
204 <h3>Methods</h3> |
|
205 <table> |
|
206 <tr> |
|
207 <td><a href="#Checker.__init__">Checker</a></td> |
|
208 <td></td> |
|
209 </tr><tr> |
|
210 <td><a href="#Checker.ASSIGN">ASSIGN</a></td> |
|
211 <td></td> |
|
212 </tr><tr> |
|
213 <td><a href="#Checker.AUGASSIGN">AUGASSIGN</a></td> |
|
214 <td></td> |
|
215 </tr><tr> |
|
216 <td><a href="#Checker.CLASSDEF">CLASSDEF</a></td> |
|
217 <td>Check names used in a class definition, including its decorators, base classes, and the body of its definition.</td> |
|
218 </tr><tr> |
|
219 <td><a href="#Checker.DICTCOMP">DICTCOMP</a></td> |
|
220 <td></td> |
|
221 </tr><tr> |
|
222 <td><a href="#Checker.EXCEPTHANDLER">EXCEPTHANDLER</a></td> |
|
223 <td></td> |
|
224 </tr><tr> |
|
225 <td><a href="#Checker.FOR">FOR</a></td> |
|
226 <td>Process bindings for loop variables.</td> |
|
227 </tr><tr> |
|
228 <td><a href="#Checker.FUNCTIONDEF">FUNCTIONDEF</a></td> |
|
229 <td></td> |
|
230 </tr><tr> |
|
231 <td><a href="#Checker.GLOBAL">GLOBAL</a></td> |
|
232 <td>Keep track of globals declarations.</td> |
|
233 </tr><tr> |
|
234 <td><a href="#Checker.IMPORT">IMPORT</a></td> |
|
235 <td></td> |
|
236 </tr><tr> |
|
237 <td><a href="#Checker.IMPORTFROM">IMPORTFROM</a></td> |
|
238 <td></td> |
|
239 </tr><tr> |
|
240 <td><a href="#Checker.LAMBDA">LAMBDA</a></td> |
|
241 <td></td> |
|
242 </tr><tr> |
|
243 <td><a href="#Checker.LISTCOMP">LISTCOMP</a></td> |
|
244 <td></td> |
|
245 </tr><tr> |
|
246 <td><a href="#Checker.NAME">NAME</a></td> |
|
247 <td>Handle occurrence of Name (which can be a load/store/delete access.)</td> |
|
248 </tr><tr> |
|
249 <td><a href="#Checker.addArgs">addArgs</a></td> |
|
250 <td></td> |
|
251 </tr><tr> |
|
252 <td><a href="#Checker.addBinding">addBinding</a></td> |
|
253 <td>Called when a binding is altered.</td> |
|
254 </tr><tr> |
|
255 <td><a href="#Checker.checkDeadScopes">checkDeadScopes</a></td> |
|
256 <td>Look at scopes which have been fully examined and report names in them which were imported but unused.</td> |
|
257 </tr><tr> |
|
258 <td><a href="#Checker.checkUnusedAssignments">checkUnusedAssignments</a></td> |
|
259 <td>Check to see if any assignments have not been used.</td> |
|
260 </tr><tr> |
|
261 <td><a href="#Checker.collectLoopVars">collectLoopVars</a></td> |
|
262 <td></td> |
|
263 </tr><tr> |
|
264 <td><a href="#Checker.deferAssignment">deferAssignment</a></td> |
|
265 <td>Schedule an assignment handler to be called just after deferred function handlers.</td> |
|
266 </tr><tr> |
|
267 <td><a href="#Checker.deferFunction">deferFunction</a></td> |
|
268 <td>Schedule a function handler to be called just before completion.</td> |
|
269 </tr><tr> |
|
270 <td><a href="#Checker.descendantOf">descendantOf</a></td> |
|
271 <td></td> |
|
272 </tr><tr> |
|
273 <td><a href="#Checker.differentForks">differentForks</a></td> |
|
274 <td>True, if lnode and rnode are located on different forks of IF/TRY</td> |
|
275 </tr><tr> |
|
276 <td><a href="#Checker.getCommonAncestor">getCommonAncestor</a></td> |
|
277 <td></td> |
|
278 </tr><tr> |
|
279 <td><a href="#Checker.handleChildren">handleChildren</a></td> |
|
280 <td></td> |
|
281 </tr><tr> |
|
282 <td><a href="#Checker.handleNode">handleNode</a></td> |
|
283 <td></td> |
|
284 </tr><tr> |
|
285 <td><a href="#Checker.handleNodeDelete">handleNodeDelete</a></td> |
|
286 <td></td> |
|
287 </tr><tr> |
|
288 <td><a href="#Checker.handleNodeLoad">handleNodeLoad</a></td> |
|
289 <td></td> |
|
290 </tr><tr> |
|
291 <td><a href="#Checker.handleNodeStore">handleNodeStore</a></td> |
|
292 <td></td> |
|
293 </tr><tr> |
|
294 <td><a href="#Checker.hasParent">hasParent</a></td> |
|
295 <td></td> |
|
296 </tr><tr> |
|
297 <td><a href="#Checker.ignore">ignore</a></td> |
|
298 <td></td> |
|
299 </tr><tr> |
|
300 <td><a href="#Checker.isDocstring">isDocstring</a></td> |
|
301 <td>Determine if the given node is a docstring, as long as it is at the correct place in the node tree.</td> |
|
302 </tr><tr> |
|
303 <td><a href="#Checker.onFork">onFork</a></td> |
|
304 <td></td> |
|
305 </tr><tr> |
|
306 <td><a href="#Checker.popScope">popScope</a></td> |
|
307 <td></td> |
|
308 </tr><tr> |
|
309 <td><a href="#Checker.pushClassScope">pushClassScope</a></td> |
|
310 <td></td> |
|
311 </tr><tr> |
|
312 <td><a href="#Checker.pushFunctionScope">pushFunctionScope</a></td> |
|
313 <td></td> |
|
314 </tr><tr> |
|
315 <td><a href="#Checker.report">report</a></td> |
|
316 <td></td> |
|
317 </tr><tr> |
|
318 <td><a href="#Checker.runDeferred">runDeferred</a></td> |
|
319 <td>Run the callables in C{deferred} using their associated scope stack.</td> |
|
320 </tr><tr> |
|
321 <td><a href="#Checker.runFunction">runFunction</a></td> |
|
322 <td></td> |
|
323 </tr><tr> |
|
324 <td><a href="#Checker.scope">scope</a></td> |
|
325 <td></td> |
|
326 </tr> |
|
327 </table> |
|
328 <h3>Static Methods</h3> |
|
329 <table> |
|
330 <tr><td>None</td></tr> |
|
331 </table> |
|
332 <a NAME="Checker.__init__" ID="Checker.__init__"></a> |
|
333 <h4>Checker (Constructor)</h4> |
|
334 <b>Checker</b>(<i>tree, filename='(none)', builtins=None</i>) |
|
335 <a NAME="Checker.ASSIGN" ID="Checker.ASSIGN"></a> |
|
336 <h4>Checker.ASSIGN</h4> |
|
337 <b>ASSIGN</b>(<i>node</i>) |
|
338 <a NAME="Checker.AUGASSIGN" ID="Checker.AUGASSIGN"></a> |
|
339 <h4>Checker.AUGASSIGN</h4> |
|
340 <b>AUGASSIGN</b>(<i>node</i>) |
|
341 <a NAME="Checker.CLASSDEF" ID="Checker.CLASSDEF"></a> |
|
342 <h4>Checker.CLASSDEF</h4> |
|
343 <b>CLASSDEF</b>(<i>node</i>) |
|
344 <p> |
|
345 Check names used in a class definition, including its decorators, base |
|
346 classes, and the body of its definition. Additionally, add its name to |
|
347 the current scope. |
|
348 </p><a NAME="Checker.DICTCOMP" ID="Checker.DICTCOMP"></a> |
|
349 <h4>Checker.DICTCOMP</h4> |
|
350 <b>DICTCOMP</b>(<i>node</i>) |
|
351 <a NAME="Checker.EXCEPTHANDLER" ID="Checker.EXCEPTHANDLER"></a> |
|
352 <h4>Checker.EXCEPTHANDLER</h4> |
|
353 <b>EXCEPTHANDLER</b>(<i>node</i>) |
|
354 <a NAME="Checker.FOR" ID="Checker.FOR"></a> |
|
355 <h4>Checker.FOR</h4> |
|
356 <b>FOR</b>(<i>node</i>) |
|
357 <p> |
|
358 Process bindings for loop variables. |
|
359 </p><a NAME="Checker.FUNCTIONDEF" ID="Checker.FUNCTIONDEF"></a> |
|
360 <h4>Checker.FUNCTIONDEF</h4> |
|
361 <b>FUNCTIONDEF</b>(<i>node</i>) |
|
362 <a NAME="Checker.GLOBAL" ID="Checker.GLOBAL"></a> |
|
363 <h4>Checker.GLOBAL</h4> |
|
364 <b>GLOBAL</b>(<i>node</i>) |
|
365 <p> |
|
366 Keep track of globals declarations. |
|
367 </p><a NAME="Checker.IMPORT" ID="Checker.IMPORT"></a> |
|
368 <h4>Checker.IMPORT</h4> |
|
369 <b>IMPORT</b>(<i>node</i>) |
|
370 <a NAME="Checker.IMPORTFROM" ID="Checker.IMPORTFROM"></a> |
|
371 <h4>Checker.IMPORTFROM</h4> |
|
372 <b>IMPORTFROM</b>(<i>node</i>) |
|
373 <a NAME="Checker.LAMBDA" ID="Checker.LAMBDA"></a> |
|
374 <h4>Checker.LAMBDA</h4> |
|
375 <b>LAMBDA</b>(<i>node</i>) |
|
376 <a NAME="Checker.LISTCOMP" ID="Checker.LISTCOMP"></a> |
|
377 <h4>Checker.LISTCOMP</h4> |
|
378 <b>LISTCOMP</b>(<i>node</i>) |
|
379 <a NAME="Checker.NAME" ID="Checker.NAME"></a> |
|
380 <h4>Checker.NAME</h4> |
|
381 <b>NAME</b>(<i>node</i>) |
|
382 <p> |
|
383 Handle occurrence of Name (which can be a load/store/delete access.) |
|
384 </p><a NAME="Checker.addArgs" ID="Checker.addArgs"></a> |
|
385 <h4>Checker.addArgs</h4> |
|
386 <b>addArgs</b>(<i></i>) |
|
387 <a NAME="Checker.addBinding" ID="Checker.addBinding"></a> |
|
388 <h4>Checker.addBinding</h4> |
|
389 <b>addBinding</b>(<i>node, value, reportRedef=True</i>) |
|
390 <p> |
|
391 Called when a binding is altered. |
|
392 </p><p> |
|
393 - `node` is the statement responsible for the change |
|
394 - `value` is the optional new value, a Binding instance, associated |
|
395 with the binding; if None, the binding is deleted if it exists. |
|
396 - if `reportRedef` is True (default), rebinding while unused will be |
|
397 reported. |
|
398 </p><a NAME="Checker.checkDeadScopes" ID="Checker.checkDeadScopes"></a> |
|
399 <h4>Checker.checkDeadScopes</h4> |
|
400 <b>checkDeadScopes</b>(<i></i>) |
|
401 <p> |
|
402 Look at scopes which have been fully examined and report names in them |
|
403 which were imported but unused. |
|
404 </p><a NAME="Checker.checkUnusedAssignments" ID="Checker.checkUnusedAssignments"></a> |
|
405 <h4>Checker.checkUnusedAssignments</h4> |
|
406 <b>checkUnusedAssignments</b>(<i></i>) |
|
407 <p> |
|
408 Check to see if any assignments have not been used. |
|
409 </p><a NAME="Checker.collectLoopVars" ID="Checker.collectLoopVars"></a> |
|
410 <h4>Checker.collectLoopVars</h4> |
|
411 <b>collectLoopVars</b>(<i></i>) |
|
412 <a NAME="Checker.deferAssignment" ID="Checker.deferAssignment"></a> |
|
413 <h4>Checker.deferAssignment</h4> |
|
414 <b>deferAssignment</b>(<i>callable</i>) |
|
415 <p> |
|
416 Schedule an assignment handler to be called just after deferred |
|
417 function handlers. |
|
418 </p><a NAME="Checker.deferFunction" ID="Checker.deferFunction"></a> |
|
419 <h4>Checker.deferFunction</h4> |
|
420 <b>deferFunction</b>(<i>callable</i>) |
|
421 <p> |
|
422 Schedule a function handler to be called just before completion. |
|
423 </p><p> |
|
424 This is used for handling function bodies, which must be deferred |
|
425 because code later in the file might modify the global scope. When |
|
426 `callable` is called, the scope at the time this is called will be |
|
427 restored, however it will contain any new bindings added to it. |
|
428 </p><a NAME="Checker.descendantOf" ID="Checker.descendantOf"></a> |
|
429 <h4>Checker.descendantOf</h4> |
|
430 <b>descendantOf</b>(<i>node, ancestors, stop=None</i>) |
|
431 <a NAME="Checker.differentForks" ID="Checker.differentForks"></a> |
|
432 <h4>Checker.differentForks</h4> |
|
433 <b>differentForks</b>(<i>lnode, rnode</i>) |
|
434 <p> |
|
435 True, if lnode and rnode are located on different forks of IF/TRY |
|
436 </p><a NAME="Checker.getCommonAncestor" ID="Checker.getCommonAncestor"></a> |
|
437 <h4>Checker.getCommonAncestor</h4> |
|
438 <b>getCommonAncestor</b>(<i>lnode, rnode, stop=None</i>) |
|
439 <a NAME="Checker.handleChildren" ID="Checker.handleChildren"></a> |
|
440 <h4>Checker.handleChildren</h4> |
|
441 <b>handleChildren</b>(<i>tree</i>) |
|
442 <a NAME="Checker.handleNode" ID="Checker.handleNode"></a> |
|
443 <h4>Checker.handleNode</h4> |
|
444 <b>handleNode</b>(<i>node, parent</i>) |
|
445 <a NAME="Checker.handleNodeDelete" ID="Checker.handleNodeDelete"></a> |
|
446 <h4>Checker.handleNodeDelete</h4> |
|
447 <b>handleNodeDelete</b>(<i>node</i>) |
|
448 <a NAME="Checker.handleNodeLoad" ID="Checker.handleNodeLoad"></a> |
|
449 <h4>Checker.handleNodeLoad</h4> |
|
450 <b>handleNodeLoad</b>(<i>node</i>) |
|
451 <a NAME="Checker.handleNodeStore" ID="Checker.handleNodeStore"></a> |
|
452 <h4>Checker.handleNodeStore</h4> |
|
453 <b>handleNodeStore</b>(<i>node</i>) |
|
454 <a NAME="Checker.hasParent" ID="Checker.hasParent"></a> |
|
455 <h4>Checker.hasParent</h4> |
|
456 <b>hasParent</b>(<i>node, kind</i>) |
|
457 <a NAME="Checker.ignore" ID="Checker.ignore"></a> |
|
458 <h4>Checker.ignore</h4> |
|
459 <b>ignore</b>(<i>node</i>) |
|
460 <a NAME="Checker.isDocstring" ID="Checker.isDocstring"></a> |
|
461 <h4>Checker.isDocstring</h4> |
|
462 <b>isDocstring</b>(<i>node</i>) |
|
463 <p> |
|
464 Determine if the given node is a docstring, as long as it is at the |
|
465 correct place in the node tree. |
|
466 </p><a NAME="Checker.onFork" ID="Checker.onFork"></a> |
|
467 <h4>Checker.onFork</h4> |
|
468 <b>onFork</b>(<i>parent, lnode, rnode, items</i>) |
|
469 <a NAME="Checker.popScope" ID="Checker.popScope"></a> |
|
470 <h4>Checker.popScope</h4> |
|
471 <b>popScope</b>(<i></i>) |
|
472 <a NAME="Checker.pushClassScope" ID="Checker.pushClassScope"></a> |
|
473 <h4>Checker.pushClassScope</h4> |
|
474 <b>pushClassScope</b>(<i></i>) |
|
475 <a NAME="Checker.pushFunctionScope" ID="Checker.pushFunctionScope"></a> |
|
476 <h4>Checker.pushFunctionScope</h4> |
|
477 <b>pushFunctionScope</b>(<i></i>) |
|
478 <a NAME="Checker.report" ID="Checker.report"></a> |
|
479 <h4>Checker.report</h4> |
|
480 <b>report</b>(<i>messageClass, *args, **kwargs</i>) |
|
481 <a NAME="Checker.runDeferred" ID="Checker.runDeferred"></a> |
|
482 <h4>Checker.runDeferred</h4> |
|
483 <b>runDeferred</b>(<i>deferred</i>) |
|
484 <p> |
|
485 Run the callables in C{deferred} using their associated scope stack. |
|
486 </p><a NAME="Checker.runFunction" ID="Checker.runFunction"></a> |
|
487 <h4>Checker.runFunction</h4> |
|
488 <b>runFunction</b>(<i></i>) |
|
489 <a NAME="Checker.scope" ID="Checker.scope"></a> |
|
490 <h4>Checker.scope</h4> |
|
491 <b>scope</b>(<i></i>) |
|
492 |
|
493 <div align="right"><a href="#top">Up</a></div> |
|
494 <hr /><hr /> |
|
495 <a NAME="ClassDefinition" ID="ClassDefinition"></a> |
|
496 <h2>ClassDefinition</h2> |
|
497 |
|
498 <h3>Derived from</h3> |
|
499 Definition |
|
500 <h3>Class Attributes</h3> |
|
501 <table> |
|
502 <tr><td>None</td></tr> |
|
503 </table> |
|
504 <h3>Class Methods</h3> |
|
505 <table> |
|
506 <tr><td>None</td></tr> |
|
507 </table> |
|
508 <h3>Methods</h3> |
|
509 <table> |
|
510 <tr><td>None</td></tr> |
|
511 </table> |
|
512 <h3>Static Methods</h3> |
|
513 <table> |
|
514 <tr><td>None</td></tr> |
|
515 </table> |
|
516 |
|
517 <div align="right"><a href="#top">Up</a></div> |
|
518 <hr /><hr /> |
|
519 <a NAME="ClassScope" ID="ClassScope"></a> |
|
520 <h2>ClassScope</h2> |
|
521 |
|
522 <h3>Derived from</h3> |
|
523 Scope |
|
524 <h3>Class Attributes</h3> |
|
525 <table> |
|
526 <tr><td>None</td></tr> |
|
527 </table> |
|
528 <h3>Class Methods</h3> |
|
529 <table> |
|
530 <tr><td>None</td></tr> |
|
531 </table> |
|
532 <h3>Methods</h3> |
|
533 <table> |
|
534 <tr><td>None</td></tr> |
|
535 </table> |
|
536 <h3>Static Methods</h3> |
|
537 <table> |
|
538 <tr><td>None</td></tr> |
|
539 </table> |
|
540 |
|
541 <div align="right"><a href="#top">Up</a></div> |
|
542 <hr /><hr /> |
|
543 <a NAME="Definition" ID="Definition"></a> |
|
544 <h2>Definition</h2> |
|
545 <p> |
|
546 A binding that defines a function or a class. |
|
547 </p> |
|
548 <h3>Derived from</h3> |
|
549 Binding |
|
550 <h3>Class Attributes</h3> |
|
551 <table> |
|
552 <tr><td>None</td></tr> |
|
553 </table> |
|
554 <h3>Class Methods</h3> |
|
555 <table> |
|
556 <tr><td>None</td></tr> |
|
557 </table> |
|
558 <h3>Methods</h3> |
|
559 <table> |
|
560 <tr><td>None</td></tr> |
|
561 </table> |
|
562 <h3>Static Methods</h3> |
|
563 <table> |
|
564 <tr><td>None</td></tr> |
|
565 </table> |
|
566 |
|
567 <div align="right"><a href="#top">Up</a></div> |
|
568 <hr /><hr /> |
|
569 <a NAME="ExportBinding" ID="ExportBinding"></a> |
|
570 <h2>ExportBinding</h2> |
|
571 <p> |
|
572 A binding created by an C{__all__} assignment. If the names in the list |
|
573 can be determined statically, they will be treated as names for export and |
|
574 additional checking applied to them. |
|
575 </p><p> |
|
576 The only C{__all__} assignment that can be recognized is one which takes |
|
577 the value of a literal list containing literal strings. For example:: |
|
578 </p><p> |
|
579 __all__ = ["foo", "bar"] |
|
580 </p><p> |
|
581 Names which are imported and not otherwise used but appear in the value of |
|
582 C{__all__} will not have an unused import warning reported for them. |
|
583 </p> |
|
584 <h3>Derived from</h3> |
|
585 Binding |
|
586 <h3>Class Attributes</h3> |
|
587 <table> |
|
588 <tr><td>None</td></tr> |
|
589 </table> |
|
590 <h3>Class Methods</h3> |
|
591 <table> |
|
592 <tr><td>None</td></tr> |
|
593 </table> |
|
594 <h3>Methods</h3> |
|
595 <table> |
|
596 <tr> |
|
597 <td><a href="#ExportBinding.names">names</a></td> |
|
598 <td>Return a list of the names referenced by this binding.</td> |
|
599 </tr> |
|
600 </table> |
|
601 <h3>Static Methods</h3> |
|
602 <table> |
|
603 <tr><td>None</td></tr> |
|
604 </table> |
|
605 <a NAME="ExportBinding.names" ID="ExportBinding.names"></a> |
|
606 <h4>ExportBinding.names</h4> |
|
607 <b>names</b>(<i></i>) |
|
608 <p> |
|
609 Return a list of the names referenced by this binding. |
|
610 </p> |
|
611 <div align="right"><a href="#top">Up</a></div> |
|
612 <hr /><hr /> |
|
613 <a NAME="FunctionDefinition" ID="FunctionDefinition"></a> |
|
614 <h2>FunctionDefinition</h2> |
|
615 |
|
616 <h3>Derived from</h3> |
|
617 Definition |
|
618 <h3>Class Attributes</h3> |
|
619 <table> |
|
620 <tr><td>None</td></tr> |
|
621 </table> |
|
622 <h3>Class Methods</h3> |
|
623 <table> |
|
624 <tr><td>None</td></tr> |
|
625 </table> |
|
626 <h3>Methods</h3> |
|
627 <table> |
|
628 <tr><td>None</td></tr> |
|
629 </table> |
|
630 <h3>Static Methods</h3> |
|
631 <table> |
|
632 <tr><td>None</td></tr> |
|
633 </table> |
|
634 |
|
635 <div align="right"><a href="#top">Up</a></div> |
|
636 <hr /><hr /> |
|
637 <a NAME="FunctionScope" ID="FunctionScope"></a> |
|
638 <h2>FunctionScope</h2> |
|
639 <p> |
|
640 I represent a name scope for a function. |
|
641 </p> |
|
642 <h3>Derived from</h3> |
|
643 Scope |
|
644 <h3>Class Attributes</h3> |
|
645 <table> |
|
646 <tr><td>None</td></tr> |
|
647 </table> |
|
648 <h3>Class Methods</h3> |
|
649 <table> |
|
650 <tr><td>None</td></tr> |
|
651 </table> |
|
652 <h3>Methods</h3> |
|
653 <table> |
|
654 <tr> |
|
655 <td><a href="#FunctionScope.__init__">FunctionScope</a></td> |
|
656 <td></td> |
|
657 </tr> |
|
658 </table> |
|
659 <h3>Static Methods</h3> |
|
660 <table> |
|
661 <tr><td>None</td></tr> |
|
662 </table> |
|
663 <a NAME="FunctionScope.__init__" ID="FunctionScope.__init__"></a> |
|
664 <h4>FunctionScope (Constructor)</h4> |
|
665 <b>FunctionScope</b>(<i></i>) |
|
666 |
|
667 <div align="right"><a href="#top">Up</a></div> |
|
668 <hr /><hr /> |
|
669 <a NAME="Importation" ID="Importation"></a> |
|
670 <h2>Importation</h2> |
|
671 <p> |
|
672 A binding created by an import statement. |
|
673 </p> |
|
674 <h3>Derived from</h3> |
|
675 Binding |
|
676 <h3>Class Attributes</h3> |
|
677 <table> |
|
678 <tr><td>None</td></tr> |
|
679 </table> |
|
680 <h3>Class Methods</h3> |
|
681 <table> |
|
682 <tr><td>None</td></tr> |
|
683 </table> |
|
684 <h3>Methods</h3> |
|
685 <table> |
|
686 <tr> |
|
687 <td><a href="#Importation.__init__">Importation</a></td> |
|
688 <td></td> |
|
689 </tr> |
|
690 </table> |
|
691 <h3>Static Methods</h3> |
|
692 <table> |
|
693 <tr><td>None</td></tr> |
|
694 </table> |
|
695 <a NAME="Importation.__init__" ID="Importation.__init__"></a> |
|
696 <h4>Importation (Constructor)</h4> |
|
697 <b>Importation</b>(<i>name, source</i>) |
|
698 |
|
699 <div align="right"><a href="#top">Up</a></div> |
|
700 <hr /><hr /> |
|
701 <a NAME="ModuleScope" ID="ModuleScope"></a> |
|
702 <h2>ModuleScope</h2> |
|
703 |
|
704 <h3>Derived from</h3> |
|
705 Scope |
|
706 <h3>Class Attributes</h3> |
|
707 <table> |
|
708 <tr><td>None</td></tr> |
|
709 </table> |
|
710 <h3>Class Methods</h3> |
|
711 <table> |
|
712 <tr><td>None</td></tr> |
|
713 </table> |
|
714 <h3>Methods</h3> |
|
715 <table> |
|
716 <tr><td>None</td></tr> |
|
717 </table> |
|
718 <h3>Static Methods</h3> |
|
719 <table> |
|
720 <tr><td>None</td></tr> |
|
721 </table> |
|
722 |
|
723 <div align="right"><a href="#top">Up</a></div> |
|
724 <hr /><hr /> |
|
725 <a NAME="Scope" ID="Scope"></a> |
|
726 <h2>Scope</h2> |
|
727 |
|
728 <h3>Derived from</h3> |
|
729 dict |
|
730 <h3>Class Attributes</h3> |
|
731 <table> |
|
732 <tr><td>importStarred</td></tr><tr><td>usesLocals</td></tr> |
|
733 </table> |
|
734 <h3>Class Methods</h3> |
|
735 <table> |
|
736 <tr><td>None</td></tr> |
|
737 </table> |
|
738 <h3>Methods</h3> |
|
739 <table> |
|
740 <tr> |
|
741 <td><a href="#Scope.__repr__">__repr__</a></td> |
|
742 <td></td> |
|
743 </tr> |
|
744 </table> |
|
745 <h3>Static Methods</h3> |
|
746 <table> |
|
747 <tr><td>None</td></tr> |
|
748 </table> |
|
749 <a NAME="Scope.__repr__" ID="Scope.__repr__"></a> |
|
750 <h4>Scope.__repr__</h4> |
|
751 <b>__repr__</b>(<i></i>) |
|
752 |
|
753 <div align="right"><a href="#top">Up</a></div> |
|
754 <hr /><hr /> |
|
755 <a NAME="UnBinding" ID="UnBinding"></a> |
|
756 <h2>UnBinding</h2> |
|
757 <p> |
|
758 Created by the 'del' operator. |
|
759 </p> |
|
760 <h3>Derived from</h3> |
|
761 Binding |
|
762 <h3>Class Attributes</h3> |
|
763 <table> |
|
764 <tr><td>None</td></tr> |
|
765 </table> |
|
766 <h3>Class Methods</h3> |
|
767 <table> |
|
768 <tr><td>None</td></tr> |
|
769 </table> |
|
770 <h3>Methods</h3> |
|
771 <table> |
|
772 <tr><td>None</td></tr> |
|
773 </table> |
|
774 <h3>Static Methods</h3> |
|
775 <table> |
|
776 <tr><td>None</td></tr> |
|
777 </table> |
|
778 |
|
779 <div align="right"><a href="#top">Up</a></div> |
|
780 <hr /><hr /> |
|
781 <a NAME="getNodeName" ID="getNodeName"></a> |
|
782 <h2>getNodeName</h2> |
|
783 <b>getNodeName</b>(<i>node</i>) |
|
784 |
|
785 <div align="right"><a href="#top">Up</a></div> |
|
786 <hr /><hr /> |
|
787 <a NAME="iter_child_nodes" ID="iter_child_nodes"></a> |
|
788 <h2>iter_child_nodes</h2> |
|
789 <b>iter_child_nodes</b>(<i>node, astcls=ast.AST</i>) |
|
790 <p> |
|
791 Yield all direct child nodes of *node*, that is, all fields that are nodes |
|
792 and all items of fields that are lists of nodes. |
|
793 </p> |
|
794 <div align="right"><a href="#top">Up</a></div> |
|
795 <hr /> |
|
796 </body></html> |