src/eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html

branch
eric7
changeset 10479
856476537696
parent 10437
2f70ca07f0af
child 10510
fa7b8ebfbe13
equal deleted inserted replaced
10478:de9106c55c3d 10479:856476537696
5 <link rel="stylesheet" href="styles.css"> 5 <link rel="stylesheet" href="styles.css">
6 </head> 6 </head>
7 <body> 7 <body>
8 <a NAME="top" ID="top"></a> 8 <a NAME="top" ID="top"></a>
9 <h1>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker</h1> 9 <h1>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker</h1>
10
11 <p> 10 <p>
12 Module implementing a checker for miscellaneous checks. 11 Module implementing a checker for miscellaneous checks.
13 </p> 12 </p>
13
14 <h3>Global Attributes</h3> 14 <h3>Global Attributes</h3>
15
16 <table> 15 <table>
17 <tr><td>BugBearContext</td></tr> 16 <tr><td>BugBearContext</td></tr>
18 </table> 17 </table>
18
19 <h3>Classes</h3> 19 <h3>Classes</h3>
20 20 <table>
21 <table>
22
23 <tr> 21 <tr>
24 <td><a href="#BugBearVisitor">BugBearVisitor</a></td> 22 <td><a href="#BugBearVisitor">BugBearVisitor</a></td>
25 <td>Class implementing a node visitor to check for various topics.</td> 23 <td>Class implementing a node visitor to check for various topics.</td>
26 </tr> 24 </tr>
27 <tr> 25 <tr>
51 <tr> 49 <tr>
52 <td><a href="#TextVisitor">TextVisitor</a></td> 50 <td><a href="#TextVisitor">TextVisitor</a></td>
53 <td>Class implementing a node visitor for bytes and str instances.</td> 51 <td>Class implementing a node visitor for bytes and str instances.</td>
54 </tr> 52 </tr>
55 </table> 53 </table>
54
56 <h3>Functions</h3> 55 <h3>Functions</h3>
57 56 <table>
58 <table>
59
60 <tr> 57 <tr>
61 <td><a href="#composeCallPath">composeCallPath</a></td> 58 <td><a href="#composeCallPath">composeCallPath</a></td>
62 <td>Generator function to assemble the call path of a given node.</td> 59 <td>Generator function to assemble the call path of a given node.</td>
63 </tr> 60 </tr>
64 <tr> 61 <tr>
65 <td><a href="#pairwise">pairwise</a></td> 62 <td><a href="#pairwise">pairwise</a></td>
66 <td></td> 63 <td></td>
67 </tr> 64 </tr>
68 </table> 65 </table>
66
69 <hr /> 67 <hr />
70 <hr /> 68 <hr />
71 <a NAME="BugBearVisitor" ID="BugBearVisitor"></a> 69 <a NAME="BugBearVisitor" ID="BugBearVisitor"></a>
72 <h2>BugBearVisitor</h2> 70 <h2>BugBearVisitor</h2>
73
74 <p> 71 <p>
75 Class implementing a node visitor to check for various topics. 72 Class implementing a node visitor to check for various topics.
76 </p> 73 </p>
74
77 <h3>Derived from</h3> 75 <h3>Derived from</h3>
78 ast.NodeVisitor 76 ast.NodeVisitor
79 <h3>Class Attributes</h3> 77 <h3>Class Attributes</h3>
80 78 <table>
81 <table> 79 <tr><td>CONTEXTFUL_NODES</td></tr>
82 <tr><td>CONTEXTFUL_NODES</td></tr><tr><td>FUNCTION_NODES</td></tr><tr><td>NodeWindowSize</td></tr> 80 <tr><td>FUNCTION_NODES</td></tr>
83 </table> 81 <tr><td>NodeWindowSize</td></tr>
82 </table>
83
84 <h3>Class Methods</h3> 84 <h3>Class Methods</h3>
85
86 <table> 85 <table>
87 <tr><td>None</td></tr> 86 <tr><td>None</td></tr>
88 </table> 87 </table>
88
89 <h3>Methods</h3> 89 <h3>Methods</h3>
90 90 <table>
91 <table>
92
93 <tr> 91 <tr>
94 <td><a href="#BugBearVisitor.__init__">BugBearVisitor</a></td> 92 <td><a href="#BugBearVisitor.__init__">BugBearVisitor</a></td>
95 <td>Constructor</td> 93 <td>Constructor</td>
96 </tr> 94 </tr>
97 <tr> 95 <tr>
357 <tr> 355 <tr>
358 <td><a href="#BugBearVisitor.visit_With">visit_With</a></td> 356 <td><a href="#BugBearVisitor.visit_With">visit_With</a></td>
359 <td>Public method to handle 'with' statements.</td> 357 <td>Public method to handle 'with' statements.</td>
360 </tr> 358 </tr>
361 </table> 359 </table>
360
362 <h3>Static Methods</h3> 361 <h3>Static Methods</h3>
363
364 <table> 362 <table>
365 <tr><td>None</td></tr> 363 <tr><td>None</td></tr>
366 </table> 364 </table>
365
367 366
368 <a NAME="BugBearVisitor.__init__" ID="BugBearVisitor.__init__"></a> 367 <a NAME="BugBearVisitor.__init__" ID="BugBearVisitor.__init__"></a>
369 <h4>BugBearVisitor (Constructor)</h4> 368 <h4>BugBearVisitor (Constructor)</h4>
370 <b>BugBearVisitor</b>(<i></i>) 369 <b>BugBearVisitor</b>(<i></i>)
371
372 <p> 370 <p>
373 Constructor 371 Constructor
374 </p> 372 </p>
373
375 <a NAME="BugBearVisitor.__checkForM505" ID="BugBearVisitor.__checkForM505"></a> 374 <a NAME="BugBearVisitor.__checkForM505" ID="BugBearVisitor.__checkForM505"></a>
376 <h4>BugBearVisitor.__checkForM505</h4> 375 <h4>BugBearVisitor.__checkForM505</h4>
377 <b>__checkForM505</b>(<i>node</i>) 376 <b>__checkForM505</b>(<i>node</i>)
378
379 <p> 377 <p>
380 Private method to check the use of *strip(). 378 Private method to check the use of *strip().
381 </p> 379 </p>
380
382 <dl> 381 <dl>
383 382
384 <dt><i>node</i> (ast.Call)</dt> 383 <dt><i>node</i> (ast.Call)</dt>
385 <dd> 384 <dd>
386 reference to the node to be processed 385 reference to the node to be processed
387 </dd> 386 </dd>
388 </dl> 387 </dl>
389 <a NAME="BugBearVisitor.__checkForM507" ID="BugBearVisitor.__checkForM507"></a> 388 <a NAME="BugBearVisitor.__checkForM507" ID="BugBearVisitor.__checkForM507"></a>
390 <h4>BugBearVisitor.__checkForM507</h4> 389 <h4>BugBearVisitor.__checkForM507</h4>
391 <b>__checkForM507</b>(<i>node</i>) 390 <b>__checkForM507</b>(<i>node</i>)
392
393 <p> 391 <p>
394 Private method to check for unused loop variables. 392 Private method to check for unused loop variables.
395 </p> 393 </p>
394
396 <dl> 395 <dl>
397 396
398 <dt><i>node</i> (ast.For or ast.AsyncFor)</dt> 397 <dt><i>node</i> (ast.For or ast.AsyncFor)</dt>
399 <dd> 398 <dd>
400 reference to the node to be processed 399 reference to the node to be processed
401 </dd> 400 </dd>
402 </dl> 401 </dl>
403 <a NAME="BugBearVisitor.__checkForM512" ID="BugBearVisitor.__checkForM512"></a> 402 <a NAME="BugBearVisitor.__checkForM512" ID="BugBearVisitor.__checkForM512"></a>
404 <h4>BugBearVisitor.__checkForM512</h4> 403 <h4>BugBearVisitor.__checkForM512</h4>
405 <b>__checkForM512</b>(<i>node</i>) 404 <b>__checkForM512</b>(<i>node</i>)
406
407 <p> 405 <p>
408 Private method to check for return/continue/break inside finally blocks. 406 Private method to check for return/continue/break inside finally blocks.
409 </p> 407 </p>
408
410 <dl> 409 <dl>
411 410
412 <dt><i>node</i> (ast.Try)</dt> 411 <dt><i>node</i> (ast.Try)</dt>
413 <dd> 412 <dd>
414 reference to the node to be processed 413 reference to the node to be processed
415 </dd> 414 </dd>
416 </dl> 415 </dl>
417 <a NAME="BugBearVisitor.__checkForM515" ID="BugBearVisitor.__checkForM515"></a> 416 <a NAME="BugBearVisitor.__checkForM515" ID="BugBearVisitor.__checkForM515"></a>
418 <h4>BugBearVisitor.__checkForM515</h4> 417 <h4>BugBearVisitor.__checkForM515</h4>
419 <b>__checkForM515</b>(<i>node</i>) 418 <b>__checkForM515</b>(<i>node</i>)
420
421 <p> 419 <p>
422 Private method to check for pointless comparisons. 420 Private method to check for pointless comparisons.
423 </p> 421 </p>
422
424 <dl> 423 <dl>
425 424
426 <dt><i>node</i> (ast.Compare)</dt> 425 <dt><i>node</i> (ast.Compare)</dt>
427 <dd> 426 <dd>
428 reference to the node to be processed 427 reference to the node to be processed
429 </dd> 428 </dd>
430 </dl> 429 </dl>
431 <a NAME="BugBearVisitor.__checkForM516" ID="BugBearVisitor.__checkForM516"></a> 430 <a NAME="BugBearVisitor.__checkForM516" ID="BugBearVisitor.__checkForM516"></a>
432 <h4>BugBearVisitor.__checkForM516</h4> 431 <h4>BugBearVisitor.__checkForM516</h4>
433 <b>__checkForM516</b>(<i>node</i>) 432 <b>__checkForM516</b>(<i>node</i>)
434
435 <p> 433 <p>
436 Private method to check for raising a literal instead of an exception. 434 Private method to check for raising a literal instead of an exception.
437 </p> 435 </p>
436
438 <dl> 437 <dl>
439 438
440 <dt><i>node</i> (ast.Raise)</dt> 439 <dt><i>node</i> (ast.Raise)</dt>
441 <dd> 440 <dd>
442 reference to the node to be processed 441 reference to the node to be processed
443 </dd> 442 </dd>
444 </dl> 443 </dl>
445 <a NAME="BugBearVisitor.__checkForM517" ID="BugBearVisitor.__checkForM517"></a> 444 <a NAME="BugBearVisitor.__checkForM517" ID="BugBearVisitor.__checkForM517"></a>
446 <h4>BugBearVisitor.__checkForM517</h4> 445 <h4>BugBearVisitor.__checkForM517</h4>
447 <b>__checkForM517</b>(<i>node</i>) 446 <b>__checkForM517</b>(<i>node</i>)
448
449 <p> 447 <p>
450 Private method to check for use of the evil syntax 448 Private method to check for use of the evil syntax
451 'with assertRaises(Exception): or 'with pytest.raises(Exception):'. 449 'with assertRaises(Exception): or 'with pytest.raises(Exception):'.
452 </p> 450 </p>
451
453 <dl> 452 <dl>
454 453
455 <dt><i>node</i> (ast.With)</dt> 454 <dt><i>node</i> (ast.With)</dt>
456 <dd> 455 <dd>
457 reference to the node to be processed 456 reference to the node to be processed
458 </dd> 457 </dd>
459 </dl> 458 </dl>
460 <a NAME="BugBearVisitor.__checkForM518" ID="BugBearVisitor.__checkForM518"></a> 459 <a NAME="BugBearVisitor.__checkForM518" ID="BugBearVisitor.__checkForM518"></a>
461 <h4>BugBearVisitor.__checkForM518</h4> 460 <h4>BugBearVisitor.__checkForM518</h4>
462 <b>__checkForM518</b>(<i>node</i>) 461 <b>__checkForM518</b>(<i>node</i>)
463
464 <p> 462 <p>
465 Private method to check for useless expressions. 463 Private method to check for useless expressions.
466 </p> 464 </p>
465
467 <dl> 466 <dl>
468 467
469 <dt><i>node</i> (ast.FunctionDef)</dt> 468 <dt><i>node</i> (ast.FunctionDef)</dt>
470 <dd> 469 <dd>
471 reference to the node to be processed 470 reference to the node to be processed
472 </dd> 471 </dd>
473 </dl> 472 </dl>
474 <a NAME="BugBearVisitor.__checkForM519" ID="BugBearVisitor.__checkForM519"></a> 473 <a NAME="BugBearVisitor.__checkForM519" ID="BugBearVisitor.__checkForM519"></a>
475 <h4>BugBearVisitor.__checkForM519</h4> 474 <h4>BugBearVisitor.__checkForM519</h4>
476 <b>__checkForM519</b>(<i>node</i>) 475 <b>__checkForM519</b>(<i>node</i>)
477
478 <p> 476 <p>
479 Private method to check for use of 'functools.lru_cache' or 'functools.cache'. 477 Private method to check for use of 'functools.lru_cache' or 'functools.cache'.
480 </p> 478 </p>
479
481 <dl> 480 <dl>
482 481
483 <dt><i>node</i> (ast.FunctionDef)</dt> 482 <dt><i>node</i> (ast.FunctionDef)</dt>
484 <dd> 483 <dd>
485 reference to the node to be processed 484 reference to the node to be processed
486 </dd> 485 </dd>
487 </dl> 486 </dl>
488 <a NAME="BugBearVisitor.__checkForM520" ID="BugBearVisitor.__checkForM520"></a> 487 <a NAME="BugBearVisitor.__checkForM520" ID="BugBearVisitor.__checkForM520"></a>
489 <h4>BugBearVisitor.__checkForM520</h4> 488 <h4>BugBearVisitor.__checkForM520</h4>
490 <b>__checkForM520</b>(<i>node</i>) 489 <b>__checkForM520</b>(<i>node</i>)
491
492 <p> 490 <p>
493 Private method to check for a loop that modifies its iterable. 491 Private method to check for a loop that modifies its iterable.
494 </p> 492 </p>
493
495 <dl> 494 <dl>
496 495
497 <dt><i>node</i> (ast.For or ast.AsyncFor)</dt> 496 <dt><i>node</i> (ast.For or ast.AsyncFor)</dt>
498 <dd> 497 <dd>
499 reference to the node to be processed 498 reference to the node to be processed
500 </dd> 499 </dd>
501 </dl> 500 </dl>
502 <a NAME="BugBearVisitor.__checkForM521" ID="BugBearVisitor.__checkForM521"></a> 501 <a NAME="BugBearVisitor.__checkForM521" ID="BugBearVisitor.__checkForM521"></a>
503 <h4>BugBearVisitor.__checkForM521</h4> 502 <h4>BugBearVisitor.__checkForM521</h4>
504 <b>__checkForM521</b>(<i>node</i>) 503 <b>__checkForM521</b>(<i>node</i>)
505
506 <p> 504 <p>
507 Private method to check for use of an f-string as docstring. 505 Private method to check for use of an f-string as docstring.
508 </p> 506 </p>
507
509 <dl> 508 <dl>
510 509
511 <dt><i>node</i> (ast.FunctionDef or ast.ClassDef)</dt> 510 <dt><i>node</i> (ast.FunctionDef or ast.ClassDef)</dt>
512 <dd> 511 <dd>
513 reference to the node to be processed 512 reference to the node to be processed
514 </dd> 513 </dd>
515 </dl> 514 </dl>
516 <a NAME="BugBearVisitor.__checkForM522" ID="BugBearVisitor.__checkForM522"></a> 515 <a NAME="BugBearVisitor.__checkForM522" ID="BugBearVisitor.__checkForM522"></a>
517 <h4>BugBearVisitor.__checkForM522</h4> 516 <h4>BugBearVisitor.__checkForM522</h4>
518 <b>__checkForM522</b>(<i>node</i>) 517 <b>__checkForM522</b>(<i>node</i>)
519
520 <p> 518 <p>
521 Private method to check for use of an f-string as docstring. 519 Private method to check for use of an f-string as docstring.
522 </p> 520 </p>
521
523 <dl> 522 <dl>
524 523
525 <dt><i>node</i> (ast.With)</dt> 524 <dt><i>node</i> (ast.With)</dt>
526 <dd> 525 <dd>
527 reference to the node to be processed 526 reference to the node to be processed
528 </dd> 527 </dd>
529 </dl> 528 </dl>
530 <a NAME="BugBearVisitor.__checkForM523" ID="BugBearVisitor.__checkForM523"></a> 529 <a NAME="BugBearVisitor.__checkForM523" ID="BugBearVisitor.__checkForM523"></a>
531 <h4>BugBearVisitor.__checkForM523</h4> 530 <h4>BugBearVisitor.__checkForM523</h4>
532 <b>__checkForM523</b>(<i>loopNode</i>) 531 <b>__checkForM523</b>(<i>loopNode</i>)
533
534 <p> 532 <p>
535 Private method to check that functions (including lambdas) do not use loop 533 Private method to check that functions (including lambdas) do not use loop
536 variables. 534 variables.
537 </p> 535 </p>
536
538 <dl> 537 <dl>
539 538
540 <dt><i>loopNode</i> (ast.For, ast.AsyncFor, ast.While, ast.ListComp, ast.SetComp,ast.DictComp,)</dt> 539 <dt><i>loopNode</i> (ast.For, ast.AsyncFor, ast.While, ast.ListComp, ast.SetComp,ast.DictComp,)</dt>
541 <dd> 540 <dd>
542 reference to the node to be processed 541 reference to the node to be processed
544 </dd> 543 </dd>
545 </dl> 544 </dl>
546 <a NAME="BugBearVisitor.__checkForM524AndM527" ID="BugBearVisitor.__checkForM524AndM527"></a> 545 <a NAME="BugBearVisitor.__checkForM524AndM527" ID="BugBearVisitor.__checkForM524AndM527"></a>
547 <h4>BugBearVisitor.__checkForM524AndM527</h4> 546 <h4>BugBearVisitor.__checkForM524AndM527</h4>
548 <b>__checkForM524AndM527</b>(<i>node</i>) 547 <b>__checkForM524AndM527</b>(<i>node</i>)
549
550 <p> 548 <p>
551 Private method to check for inheritance from abstract classes in abc and lack of 549 Private method to check for inheritance from abstract classes in abc and lack of
552 any methods decorated with abstract*. 550 any methods decorated with abstract*.
553 </p> 551 </p>
552
554 <dl> 553 <dl>
555 554
556 <dt><i>node</i> (ast.ClassDef)</dt> 555 <dt><i>node</i> (ast.ClassDef)</dt>
557 <dd> 556 <dd>
558 reference to the node to be processed 557 reference to the node to be processed
559 </dd> 558 </dd>
560 </dl> 559 </dl>
561 <a NAME="BugBearVisitor.__checkForM525" ID="BugBearVisitor.__checkForM525"></a> 560 <a NAME="BugBearVisitor.__checkForM525" ID="BugBearVisitor.__checkForM525"></a>
562 <h4>BugBearVisitor.__checkForM525</h4> 561 <h4>BugBearVisitor.__checkForM525</h4>
563 <b>__checkForM525</b>(<i>node</i>) 562 <b>__checkForM525</b>(<i>node</i>)
564
565 <p> 563 <p>
566 Private method to check for exceptions being handled multiple times. 564 Private method to check for exceptions being handled multiple times.
567 </p> 565 </p>
566
568 <dl> 567 <dl>
569 568
570 <dt><i>node</i> (ast.Try)</dt> 569 <dt><i>node</i> (ast.Try)</dt>
571 <dd> 570 <dd>
572 reference to the node to be processed 571 reference to the node to be processed
573 </dd> 572 </dd>
574 </dl> 573 </dl>
575 <a NAME="BugBearVisitor.__checkForM526" ID="BugBearVisitor.__checkForM526"></a> 574 <a NAME="BugBearVisitor.__checkForM526" ID="BugBearVisitor.__checkForM526"></a>
576 <h4>BugBearVisitor.__checkForM526</h4> 575 <h4>BugBearVisitor.__checkForM526</h4>
577 <b>__checkForM526</b>(<i>node</i>) 576 <b>__checkForM526</b>(<i>node</i>)
578
579 <p> 577 <p>
580 Private method to check for Star-arg unpacking after keyword argument. 578 Private method to check for Star-arg unpacking after keyword argument.
581 </p> 579 </p>
580
582 <dl> 581 <dl>
583 582
584 <dt><i>node</i> (ast.Call)</dt> 583 <dt><i>node</i> (ast.Call)</dt>
585 <dd> 584 <dd>
586 reference to the node to be processed 585 reference to the node to be processed
587 </dd> 586 </dd>
588 </dl> 587 </dl>
589 <a NAME="BugBearVisitor.__checkForM528" ID="BugBearVisitor.__checkForM528"></a> 588 <a NAME="BugBearVisitor.__checkForM528" ID="BugBearVisitor.__checkForM528"></a>
590 <h4>BugBearVisitor.__checkForM528</h4> 589 <h4>BugBearVisitor.__checkForM528</h4>
591 <b>__checkForM528</b>(<i>node</i>) 590 <b>__checkForM528</b>(<i>node</i>)
592
593 <p> 591 <p>
594 Private method to check for warn without stacklevel. 592 Private method to check for warn without stacklevel.
595 </p> 593 </p>
594
596 <dl> 595 <dl>
597 596
598 <dt><i>node</i> (ast.Call)</dt> 597 <dt><i>node</i> (ast.Call)</dt>
599 <dd> 598 <dd>
600 reference to the node to be processed 599 reference to the node to be processed
601 </dd> 600 </dd>
602 </dl> 601 </dl>
603 <a NAME="BugBearVisitor.__checkForM531" ID="BugBearVisitor.__checkForM531"></a> 602 <a NAME="BugBearVisitor.__checkForM531" ID="BugBearVisitor.__checkForM531"></a>
604 <h4>BugBearVisitor.__checkForM531</h4> 603 <h4>BugBearVisitor.__checkForM531</h4>
605 <b>__checkForM531</b>(<i>loopNode</i>) 604 <b>__checkForM531</b>(<i>loopNode</i>)
606
607 <p> 605 <p>
608 Private method to check that 'itertools.groupby' isn't iterated over more than 606 Private method to check that 'itertools.groupby' isn't iterated over more than
609 once. 607 once.
610 </p> 608 </p>
611 <p> 609 <p>
612 A warning is emitted when the generator returned by 'groupby()' is used 610 A warning is emitted when the generator returned by 'groupby()' is used
613 more than once inside a loop body or when it's used in a nested loop. 611 more than once inside a loop body or when it's used in a nested loop.
614 </p> 612 </p>
613
615 <dl> 614 <dl>
616 615
617 <dt><i>loopNode</i> (ast.For or ast.AsyncFor)</dt> 616 <dt><i>loopNode</i> (ast.For or ast.AsyncFor)</dt>
618 <dd> 617 <dd>
619 reference to the node to be processed 618 reference to the node to be processed
620 </dd> 619 </dd>
621 </dl> 620 </dl>
622 <a NAME="BugBearVisitor.__checkForM532" ID="BugBearVisitor.__checkForM532"></a> 621 <a NAME="BugBearVisitor.__checkForM532" ID="BugBearVisitor.__checkForM532"></a>
623 <h4>BugBearVisitor.__checkForM532</h4> 622 <h4>BugBearVisitor.__checkForM532</h4>
624 <b>__checkForM532</b>(<i>node</i>) 623 <b>__checkForM532</b>(<i>node</i>)
625
626 <p> 624 <p>
627 Private method to check for possible unintentional typing annotation. 625 Private method to check for possible unintentional typing annotation.
628 </p> 626 </p>
627
629 <dl> 628 <dl>
630 629
631 <dt><i>node</i> (ast.AnnAssign)</dt> 630 <dt><i>node</i> (ast.AnnAssign)</dt>
632 <dd> 631 <dd>
633 reference to the node to be processed 632 reference to the node to be processed
634 </dd> 633 </dd>
635 </dl> 634 </dl>
636 <a NAME="BugBearVisitor.__checkForM533" ID="BugBearVisitor.__checkForM533"></a> 635 <a NAME="BugBearVisitor.__checkForM533" ID="BugBearVisitor.__checkForM533"></a>
637 <h4>BugBearVisitor.__checkForM533</h4> 636 <h4>BugBearVisitor.__checkForM533</h4>
638 <b>__checkForM533</b>(<i>node</i>) 637 <b>__checkForM533</b>(<i>node</i>)
639
640 <p> 638 <p>
641 Private method to check a set for duplicate items. 639 Private method to check a set for duplicate items.
642 </p> 640 </p>
641
643 <dl> 642 <dl>
644 643
645 <dt><i>node</i> (ast.Set)</dt> 644 <dt><i>node</i> (ast.Set)</dt>
646 <dd> 645 <dd>
647 reference to the node to be processed 646 reference to the node to be processed
648 </dd> 647 </dd>
649 </dl> 648 </dl>
650 <a NAME="BugBearVisitor.__checkForM534" ID="BugBearVisitor.__checkForM534"></a> 649 <a NAME="BugBearVisitor.__checkForM534" ID="BugBearVisitor.__checkForM534"></a>
651 <h4>BugBearVisitor.__checkForM534</h4> 650 <h4>BugBearVisitor.__checkForM534</h4>
652 <b>__checkForM534</b>(<i>node</i>) 651 <b>__checkForM534</b>(<i>node</i>)
653
654 <p> 652 <p>
655 Private method to check that re.sub/subn/split arguments flags/count/maxsplit 653 Private method to check that re.sub/subn/split arguments flags/count/maxsplit
656 are passed as keyword arguments. 654 are passed as keyword arguments.
657 </p> 655 </p>
656
658 <dl> 657 <dl>
659 658
660 <dt><i>node</i> (ast.Call)</dt> 659 <dt><i>node</i> (ast.Call)</dt>
661 <dd> 660 <dd>
662 reference to the node to be processed 661 reference to the node to be processed
663 </dd> 662 </dd>
664 </dl> 663 </dl>
665 <a NAME="BugBearVisitor.__checkForM535" ID="BugBearVisitor.__checkForM535"></a> 664 <a NAME="BugBearVisitor.__checkForM535" ID="BugBearVisitor.__checkForM535"></a>
666 <h4>BugBearVisitor.__checkForM535</h4> 665 <h4>BugBearVisitor.__checkForM535</h4>
667 <b>__checkForM535</b>(<i>node: ast.DictComp</i>) 666 <b>__checkForM535</b>(<i>node: ast.DictComp</i>)
668
669 <p> 667 <p>
670 Private method to check that a static key isn't used in a dict comprehension. 668 Private method to check that a static key isn't used in a dict comprehension.
671 </p> 669 </p>
672 <p> 670 <p>
673 Record a warning if a likely unchanging key is used - either a constant, 671 Record a warning if a likely unchanging key is used - either a constant,
674 or a variable that isn't coming from the generator expression. 672 or a variable that isn't coming from the generator expression.
675 </p> 673 </p>
674
676 <dl> 675 <dl>
677 676
678 <dt><i>node</i> (ast.DictComp)</dt> 677 <dt><i>node</i> (ast.DictComp)</dt>
679 <dd> 678 <dd>
680 reference to the node to be processed 679 reference to the node to be processed
681 </dd> 680 </dd>
682 </dl> 681 </dl>
683 <a NAME="BugBearVisitor.__checkRedundantExcepthandlers" ID="BugBearVisitor.__checkRedundantExcepthandlers"></a> 682 <a NAME="BugBearVisitor.__checkRedundantExcepthandlers" ID="BugBearVisitor.__checkRedundantExcepthandlers"></a>
684 <h4>BugBearVisitor.__checkRedundantExcepthandlers</h4> 683 <h4>BugBearVisitor.__checkRedundantExcepthandlers</h4>
685 <b>__checkRedundantExcepthandlers</b>(<i>names, node</i>) 684 <b>__checkRedundantExcepthandlers</b>(<i>names, node</i>)
686
687 <p> 685 <p>
688 Private method to check for redundant exception types in an exception handler. 686 Private method to check for redundant exception types in an exception handler.
689 </p> 687 </p>
688
690 <dl> 689 <dl>
691 690
692 <dt><i>names</i> (list of ast.Name)</dt> 691 <dt><i>names</i> (list of ast.Name)</dt>
693 <dd> 692 <dd>
694 list of exception types to be checked 693 list of exception types to be checked
711 </dd> 710 </dd>
712 </dl> 711 </dl>
713 <a NAME="BugBearVisitor.__childrenInScope" ID="BugBearVisitor.__childrenInScope"></a> 712 <a NAME="BugBearVisitor.__childrenInScope" ID="BugBearVisitor.__childrenInScope"></a>
714 <h4>BugBearVisitor.__childrenInScope</h4> 713 <h4>BugBearVisitor.__childrenInScope</h4>
715 <b>__childrenInScope</b>(<i>node</i>) 714 <b>__childrenInScope</b>(<i>node</i>)
716
717 <p> 715 <p>
718 Private method to get all child nodes in the given scope. 716 Private method to get all child nodes in the given scope.
719 </p> 717 </p>
718
720 <dl> 719 <dl>
721 720
722 <dt><i>node</i> (ast.Node)</dt> 721 <dt><i>node</i> (ast.Node)</dt>
723 <dd> 722 <dd>
724 reference to the node to be processed 723 reference to the node to be processed
737 </dd> 736 </dd>
738 </dl> 737 </dl>
739 <a NAME="BugBearVisitor.__composeCallPath" ID="BugBearVisitor.__composeCallPath"></a> 738 <a NAME="BugBearVisitor.__composeCallPath" ID="BugBearVisitor.__composeCallPath"></a>
740 <h4>BugBearVisitor.__composeCallPath</h4> 739 <h4>BugBearVisitor.__composeCallPath</h4>
741 <b>__composeCallPath</b>(<i>node</i>) 740 <b>__composeCallPath</b>(<i>node</i>)
742
743 <p> 741 <p>
744 Private method get the individual elements of the call path of a node. 742 Private method get the individual elements of the call path of a node.
745 </p> 743 </p>
744
746 <dl> 745 <dl>
747 746
748 <dt><i>node</i> (ast.Node)</dt> 747 <dt><i>node</i> (ast.Node)</dt>
749 <dd> 748 <dd>
750 reference to the node 749 reference to the node
763 </dd> 762 </dd>
764 </dl> 763 </dl>
765 <a NAME="BugBearVisitor.__flattenExcepthandler" ID="BugBearVisitor.__flattenExcepthandler"></a> 764 <a NAME="BugBearVisitor.__flattenExcepthandler" ID="BugBearVisitor.__flattenExcepthandler"></a>
766 <h4>BugBearVisitor.__flattenExcepthandler</h4> 765 <h4>BugBearVisitor.__flattenExcepthandler</h4>
767 <b>__flattenExcepthandler</b>(<i>node</i>) 766 <b>__flattenExcepthandler</b>(<i>node</i>)
768
769 <p> 767 <p>
770 Private method to flatten the list of exceptions handled by an except handler. 768 Private method to flatten the list of exceptions handled by an except handler.
771 </p> 769 </p>
770
772 <dl> 771 <dl>
773 772
774 <dt><i>node</i> (ast.Node)</dt> 773 <dt><i>node</i> (ast.Node)</dt>
775 <dd> 774 <dd>
776 reference to the node to be processed 775 reference to the node to be processed
789 </dd> 788 </dd>
790 </dl> 789 </dl>
791 <a NAME="BugBearVisitor.__getAssignedNames" ID="BugBearVisitor.__getAssignedNames"></a> 790 <a NAME="BugBearVisitor.__getAssignedNames" ID="BugBearVisitor.__getAssignedNames"></a>
792 <h4>BugBearVisitor.__getAssignedNames</h4> 791 <h4>BugBearVisitor.__getAssignedNames</h4>
793 <b>__getAssignedNames</b>(<i>loopNode</i>) 792 <b>__getAssignedNames</b>(<i>loopNode</i>)
794
795 <p> 793 <p>
796 Private method to get the names of a for loop. 794 Private method to get the names of a for loop.
797 </p> 795 </p>
796
798 <dl> 797 <dl>
799 798
800 <dt><i>loopNode</i> (ast.For)</dt> 799 <dt><i>loopNode</i> (ast.For)</dt>
801 <dd> 800 <dd>
802 reference to the node to be processed 801 reference to the node to be processed
815 </dd> 814 </dd>
816 </dl> 815 </dl>
817 <a NAME="BugBearVisitor.__getDictCompLoopVarNames" ID="BugBearVisitor.__getDictCompLoopVarNames"></a> 816 <a NAME="BugBearVisitor.__getDictCompLoopVarNames" ID="BugBearVisitor.__getDictCompLoopVarNames"></a>
818 <h4>BugBearVisitor.__getDictCompLoopVarNames</h4> 817 <h4>BugBearVisitor.__getDictCompLoopVarNames</h4>
819 <b>__getDictCompLoopVarNames</b>(<i>node</i>) 818 <b>__getDictCompLoopVarNames</b>(<i>node</i>)
820
821 <p> 819 <p>
822 Private method to get the names of comprehension loop variables. 820 Private method to get the names of comprehension loop variables.
823 </p> 821 </p>
822
824 <dl> 823 <dl>
825 824
826 <dt><i>node</i> (ast.DictComp)</dt> 825 <dt><i>node</i> (ast.DictComp)</dt>
827 <dd> 826 <dd>
828 ast node to be processed 827 ast node to be processed
841 </dd> 840 </dd>
842 </dl> 841 </dl>
843 <a NAME="BugBearVisitor.__getNamesFromTuple" ID="BugBearVisitor.__getNamesFromTuple"></a> 842 <a NAME="BugBearVisitor.__getNamesFromTuple" ID="BugBearVisitor.__getNamesFromTuple"></a>
844 <h4>BugBearVisitor.__getNamesFromTuple</h4> 843 <h4>BugBearVisitor.__getNamesFromTuple</h4>
845 <b>__getNamesFromTuple</b>(<i>node</i>) 844 <b>__getNamesFromTuple</b>(<i>node</i>)
846
847 <p> 845 <p>
848 Private method to get the names from an ast.Tuple node. 846 Private method to get the names from an ast.Tuple node.
849 </p> 847 </p>
848
850 <dl> 849 <dl>
851 850
852 <dt><i>node</i> (ast.Tuple)</dt> 851 <dt><i>node</i> (ast.Tuple)</dt>
853 <dd> 852 <dd>
854 ast node to be processed 853 ast node to be processed
867 </dd> 866 </dd>
868 </dl> 867 </dl>
869 <a NAME="BugBearVisitor.__isIdentifier" ID="BugBearVisitor.__isIdentifier"></a> 868 <a NAME="BugBearVisitor.__isIdentifier" ID="BugBearVisitor.__isIdentifier"></a>
870 <h4>BugBearVisitor.__isIdentifier</h4> 869 <h4>BugBearVisitor.__isIdentifier</h4>
871 <b>__isIdentifier</b>(<i>arg</i>) 870 <b>__isIdentifier</b>(<i>arg</i>)
872
873 <p> 871 <p>
874 Private method to check if arg is a valid identifier. 872 Private method to check if arg is a valid identifier.
875 </p> 873 </p>
876 <p> 874 <p>
877 See https://docs.python.org/2/reference/lexical_analysis.html#identifiers 875 See https://docs.python.org/2/reference/lexical_analysis.html#identifiers
878 </p> 876 </p>
877
879 <dl> 878 <dl>
880 879
881 <dt><i>arg</i> (ast.Node)</dt> 880 <dt><i>arg</i> (ast.Node)</dt>
882 <dd> 881 <dd>
883 reference to an argument node 882 reference to an argument node
896 </dd> 895 </dd>
897 </dl> 896 </dl>
898 <a NAME="BugBearVisitor.__namesFromAssignments" ID="BugBearVisitor.__namesFromAssignments"></a> 897 <a NAME="BugBearVisitor.__namesFromAssignments" ID="BugBearVisitor.__namesFromAssignments"></a>
899 <h4>BugBearVisitor.__namesFromAssignments</h4> 898 <h4>BugBearVisitor.__namesFromAssignments</h4>
900 <b>__namesFromAssignments</b>(<i>assignTarget</i>) 899 <b>__namesFromAssignments</b>(<i>assignTarget</i>)
901
902 <p> 900 <p>
903 Private method to get names of an assignment. 901 Private method to get names of an assignment.
904 </p> 902 </p>
903
905 <dl> 904 <dl>
906 905
907 <dt><i>assignTarget</i> (ast.Node)</dt> 906 <dt><i>assignTarget</i> (ast.Node)</dt>
908 <dd> 907 <dd>
909 reference to the node to be processed 908 reference to the node to be processed
922 </dd> 921 </dd>
923 </dl> 922 </dl>
924 <a NAME="BugBearVisitor.__toNameStr" ID="BugBearVisitor.__toNameStr"></a> 923 <a NAME="BugBearVisitor.__toNameStr" ID="BugBearVisitor.__toNameStr"></a>
925 <h4>BugBearVisitor.__toNameStr</h4> 924 <h4>BugBearVisitor.__toNameStr</h4>
926 <b>__toNameStr</b>(<i>node</i>) 925 <b>__toNameStr</b>(<i>node</i>)
927
928 <p> 926 <p>
929 Private method to turn Name and Attribute nodes to strings, handling any 927 Private method to turn Name and Attribute nodes to strings, handling any
930 depth of attribute accesses. 928 depth of attribute accesses.
931 </p> 929 </p>
932 <p> 930 <p>
933 931
934 </p> 932 </p>
933
935 <dl> 934 <dl>
936 935
937 <dt><i>node</i> (ast.Name or ast.Attribute)</dt> 936 <dt><i>node</i> (ast.Name or ast.Attribute)</dt>
938 <dd> 937 <dd>
939 reference to the node 938 reference to the node
952 </dd> 951 </dd>
953 </dl> 952 </dl>
954 <a NAME="BugBearVisitor.__typesafeIssubclass" ID="BugBearVisitor.__typesafeIssubclass"></a> 953 <a NAME="BugBearVisitor.__typesafeIssubclass" ID="BugBearVisitor.__typesafeIssubclass"></a>
955 <h4>BugBearVisitor.__typesafeIssubclass</h4> 954 <h4>BugBearVisitor.__typesafeIssubclass</h4>
956 <b>__typesafeIssubclass</b>(<i>obj, classOrTuple</i>) 955 <b>__typesafeIssubclass</b>(<i>obj, classOrTuple</i>)
957
958 <p> 956 <p>
959 Private method implementing a type safe issubclass() function. 957 Private method implementing a type safe issubclass() function.
960 </p> 958 </p>
959
961 <dl> 960 <dl>
962 961
963 <dt><i>obj</i> (Any)</dt> 962 <dt><i>obj</i> (Any)</dt>
964 <dd> 963 <dd>
965 reference to the object to be tested 964 reference to the object to be tested
982 </dd> 981 </dd>
983 </dl> 982 </dl>
984 <a NAME="BugBearVisitor.__walkList" ID="BugBearVisitor.__walkList"></a> 983 <a NAME="BugBearVisitor.__walkList" ID="BugBearVisitor.__walkList"></a>
985 <h4>BugBearVisitor.__walkList</h4> 984 <h4>BugBearVisitor.__walkList</h4>
986 <b>__walkList</b>(<i>nodes</i>) 985 <b>__walkList</b>(<i>nodes</i>)
987
988 <p> 986 <p>
989 Private method to walk a given list of nodes. 987 Private method to walk a given list of nodes.
990 </p> 988 </p>
989
991 <dl> 990 <dl>
992 991
993 <dt><i>nodes</i> (list of ast.Node)</dt> 992 <dt><i>nodes</i> (list of ast.Node)</dt>
994 <dd> 993 <dd>
995 list of nodes to walk 994 list of nodes to walk
1036 <b>isStrOrEllipsis</b>(<i></i>) 1035 <b>isStrOrEllipsis</b>(<i></i>)
1037 1036
1038 <a NAME="BugBearVisitor.nodeStack" ID="BugBearVisitor.nodeStack"></a> 1037 <a NAME="BugBearVisitor.nodeStack" ID="BugBearVisitor.nodeStack"></a>
1039 <h4>BugBearVisitor.nodeStack</h4> 1038 <h4>BugBearVisitor.nodeStack</h4>
1040 <b>nodeStack</b>(<i></i>) 1039 <b>nodeStack</b>(<i></i>)
1041
1042 <p> 1040 <p>
1043 Public method to get a reference to the most recent node stack. 1041 Public method to get a reference to the most recent node stack.
1044 </p> 1042 </p>
1043
1045 <dl> 1044 <dl>
1046 <dt>Return:</dt> 1045 <dt>Return:</dt>
1047 <dd> 1046 <dd>
1048 reference to the most recent node stack 1047 reference to the most recent node stack
1049 </dd> 1048 </dd>
1055 </dd> 1054 </dd>
1056 </dl> 1055 </dl>
1057 <a NAME="BugBearVisitor.visit" ID="BugBearVisitor.visit"></a> 1056 <a NAME="BugBearVisitor.visit" ID="BugBearVisitor.visit"></a>
1058 <h4>BugBearVisitor.visit</h4> 1057 <h4>BugBearVisitor.visit</h4>
1059 <b>visit</b>(<i>node</i>) 1058 <b>visit</b>(<i>node</i>)
1060
1061 <p> 1059 <p>
1062 Public method to traverse a given AST node. 1060 Public method to traverse a given AST node.
1063 </p> 1061 </p>
1062
1064 <dl> 1063 <dl>
1065 1064
1066 <dt><i>node</i> (ast.Node)</dt> 1065 <dt><i>node</i> (ast.Node)</dt>
1067 <dd> 1066 <dd>
1068 AST node to be traversed 1067 AST node to be traversed
1069 </dd> 1068 </dd>
1070 </dl> 1069 </dl>
1071 <a NAME="BugBearVisitor.visit_AnnAssign" ID="BugBearVisitor.visit_AnnAssign"></a> 1070 <a NAME="BugBearVisitor.visit_AnnAssign" ID="BugBearVisitor.visit_AnnAssign"></a>
1072 <h4>BugBearVisitor.visit_AnnAssign</h4> 1071 <h4>BugBearVisitor.visit_AnnAssign</h4>
1073 <b>visit_AnnAssign</b>(<i>node</i>) 1072 <b>visit_AnnAssign</b>(<i>node</i>)
1074
1075 <p> 1073 <p>
1076 Public method to check annotated assign statements. 1074 Public method to check annotated assign statements.
1077 </p> 1075 </p>
1076
1078 <dl> 1077 <dl>
1079 1078
1080 <dt><i>node</i> (ast.AnnAssign)</dt> 1079 <dt><i>node</i> (ast.AnnAssign)</dt>
1081 <dd> 1080 <dd>
1082 reference to the node to be processed 1081 reference to the node to be processed
1083 </dd> 1082 </dd>
1084 </dl> 1083 </dl>
1085 <a NAME="BugBearVisitor.visit_Assert" ID="BugBearVisitor.visit_Assert"></a> 1084 <a NAME="BugBearVisitor.visit_Assert" ID="BugBearVisitor.visit_Assert"></a>
1086 <h4>BugBearVisitor.visit_Assert</h4> 1085 <h4>BugBearVisitor.visit_Assert</h4>
1087 <b>visit_Assert</b>(<i>node</i>) 1086 <b>visit_Assert</b>(<i>node</i>)
1088
1089 <p> 1087 <p>
1090 Public method to handle 'assert' statements. 1088 Public method to handle 'assert' statements.
1091 </p> 1089 </p>
1090
1092 <dl> 1091 <dl>
1093 1092
1094 <dt><i>node</i> (ast.Assert)</dt> 1093 <dt><i>node</i> (ast.Assert)</dt>
1095 <dd> 1094 <dd>
1096 reference to the node to be processed 1095 reference to the node to be processed
1097 </dd> 1096 </dd>
1098 </dl> 1097 </dl>
1099 <a NAME="BugBearVisitor.visit_Assign" ID="BugBearVisitor.visit_Assign"></a> 1098 <a NAME="BugBearVisitor.visit_Assign" ID="BugBearVisitor.visit_Assign"></a>
1100 <h4>BugBearVisitor.visit_Assign</h4> 1099 <h4>BugBearVisitor.visit_Assign</h4>
1101 <b>visit_Assign</b>(<i>node</i>) 1100 <b>visit_Assign</b>(<i>node</i>)
1102
1103 <p> 1101 <p>
1104 Public method to handle assignments. 1102 Public method to handle assignments.
1105 </p> 1103 </p>
1104
1106 <dl> 1105 <dl>
1107 1106
1108 <dt><i>node</i> (ast.Assign)</dt> 1107 <dt><i>node</i> (ast.Assign)</dt>
1109 <dd> 1108 <dd>
1110 reference to the node to be processed 1109 reference to the node to be processed
1111 </dd> 1110 </dd>
1112 </dl> 1111 </dl>
1113 <a NAME="BugBearVisitor.visit_AsyncFor" ID="BugBearVisitor.visit_AsyncFor"></a> 1112 <a NAME="BugBearVisitor.visit_AsyncFor" ID="BugBearVisitor.visit_AsyncFor"></a>
1114 <h4>BugBearVisitor.visit_AsyncFor</h4> 1113 <h4>BugBearVisitor.visit_AsyncFor</h4>
1115 <b>visit_AsyncFor</b>(<i>node</i>) 1114 <b>visit_AsyncFor</b>(<i>node</i>)
1116
1117 <p> 1115 <p>
1118 Public method to handle 'for' statements. 1116 Public method to handle 'for' statements.
1119 </p> 1117 </p>
1118
1120 <dl> 1119 <dl>
1121 1120
1122 <dt><i>node</i> (ast.AsyncFor)</dt> 1121 <dt><i>node</i> (ast.AsyncFor)</dt>
1123 <dd> 1122 <dd>
1124 reference to the node to be processed 1123 reference to the node to be processed
1125 </dd> 1124 </dd>
1126 </dl> 1125 </dl>
1127 <a NAME="BugBearVisitor.visit_Call" ID="BugBearVisitor.visit_Call"></a> 1126 <a NAME="BugBearVisitor.visit_Call" ID="BugBearVisitor.visit_Call"></a>
1128 <h4>BugBearVisitor.visit_Call</h4> 1127 <h4>BugBearVisitor.visit_Call</h4>
1129 <b>visit_Call</b>(<i>node</i>) 1128 <b>visit_Call</b>(<i>node</i>)
1130
1131 <p> 1129 <p>
1132 Public method to handle a function call. 1130 Public method to handle a function call.
1133 </p> 1131 </p>
1132
1134 <dl> 1133 <dl>
1135 1134
1136 <dt><i>node</i> (ast.Call)</dt> 1135 <dt><i>node</i> (ast.Call)</dt>
1137 <dd> 1136 <dd>
1138 reference to the node to be processed 1137 reference to the node to be processed
1139 </dd> 1138 </dd>
1140 </dl> 1139 </dl>
1141 <a NAME="BugBearVisitor.visit_ClassDef" ID="BugBearVisitor.visit_ClassDef"></a> 1140 <a NAME="BugBearVisitor.visit_ClassDef" ID="BugBearVisitor.visit_ClassDef"></a>
1142 <h4>BugBearVisitor.visit_ClassDef</h4> 1141 <h4>BugBearVisitor.visit_ClassDef</h4>
1143 <b>visit_ClassDef</b>(<i>node</i>) 1142 <b>visit_ClassDef</b>(<i>node</i>)
1144
1145 <p> 1143 <p>
1146 Public method to handle class definitions. 1144 Public method to handle class definitions.
1147 </p> 1145 </p>
1146
1148 <dl> 1147 <dl>
1149 1148
1150 <dt><i>node</i> (ast.ClassDef)</dt> 1149 <dt><i>node</i> (ast.ClassDef)</dt>
1151 <dd> 1150 <dd>
1152 reference to the node to be processed 1151 reference to the node to be processed
1153 </dd> 1152 </dd>
1154 </dl> 1153 </dl>
1155 <a NAME="BugBearVisitor.visit_Compare" ID="BugBearVisitor.visit_Compare"></a> 1154 <a NAME="BugBearVisitor.visit_Compare" ID="BugBearVisitor.visit_Compare"></a>
1156 <h4>BugBearVisitor.visit_Compare</h4> 1155 <h4>BugBearVisitor.visit_Compare</h4>
1157 <b>visit_Compare</b>(<i>node</i>) 1156 <b>visit_Compare</b>(<i>node</i>)
1158
1159 <p> 1157 <p>
1160 Public method to handle comparison statements. 1158 Public method to handle comparison statements.
1161 </p> 1159 </p>
1160
1162 <dl> 1161 <dl>
1163 1162
1164 <dt><i>node</i> (ast.Compare)</dt> 1163 <dt><i>node</i> (ast.Compare)</dt>
1165 <dd> 1164 <dd>
1166 reference to the node to be processed 1165 reference to the node to be processed
1167 </dd> 1166 </dd>
1168 </dl> 1167 </dl>
1169 <a NAME="BugBearVisitor.visit_DictComp" ID="BugBearVisitor.visit_DictComp"></a> 1168 <a NAME="BugBearVisitor.visit_DictComp" ID="BugBearVisitor.visit_DictComp"></a>
1170 <h4>BugBearVisitor.visit_DictComp</h4> 1169 <h4>BugBearVisitor.visit_DictComp</h4>
1171 <b>visit_DictComp</b>(<i>node</i>) 1170 <b>visit_DictComp</b>(<i>node</i>)
1172
1173 <p> 1171 <p>
1174 Public method to handle dictionary comprehensions. 1172 Public method to handle dictionary comprehensions.
1175 </p> 1173 </p>
1174
1176 <dl> 1175 <dl>
1177 1176
1178 <dt><i>node</i> (ast.DictComp)</dt> 1177 <dt><i>node</i> (ast.DictComp)</dt>
1179 <dd> 1178 <dd>
1180 reference to the node to be processed 1179 reference to the node to be processed
1181 </dd> 1180 </dd>
1182 </dl> 1181 </dl>
1183 <a NAME="BugBearVisitor.visit_ExceptHandler" ID="BugBearVisitor.visit_ExceptHandler"></a> 1182 <a NAME="BugBearVisitor.visit_ExceptHandler" ID="BugBearVisitor.visit_ExceptHandler"></a>
1184 <h4>BugBearVisitor.visit_ExceptHandler</h4> 1183 <h4>BugBearVisitor.visit_ExceptHandler</h4>
1185 <b>visit_ExceptHandler</b>(<i>node</i>) 1184 <b>visit_ExceptHandler</b>(<i>node</i>)
1186
1187 <p> 1185 <p>
1188 Public method to handle exception handlers. 1186 Public method to handle exception handlers.
1189 </p> 1187 </p>
1188
1190 <dl> 1189 <dl>
1191 1190
1192 <dt><i>node</i> (ast.ExceptHandler)</dt> 1191 <dt><i>node</i> (ast.ExceptHandler)</dt>
1193 <dd> 1192 <dd>
1194 reference to the node to be processed 1193 reference to the node to be processed
1195 </dd> 1194 </dd>
1196 </dl> 1195 </dl>
1197 <a NAME="BugBearVisitor.visit_For" ID="BugBearVisitor.visit_For"></a> 1196 <a NAME="BugBearVisitor.visit_For" ID="BugBearVisitor.visit_For"></a>
1198 <h4>BugBearVisitor.visit_For</h4> 1197 <h4>BugBearVisitor.visit_For</h4>
1199 <b>visit_For</b>(<i>node</i>) 1198 <b>visit_For</b>(<i>node</i>)
1200
1201 <p> 1199 <p>
1202 Public method to handle 'for' statements. 1200 Public method to handle 'for' statements.
1203 </p> 1201 </p>
1202
1204 <dl> 1203 <dl>
1205 1204
1206 <dt><i>node</i> (ast.For)</dt> 1205 <dt><i>node</i> (ast.For)</dt>
1207 <dd> 1206 <dd>
1208 reference to the node to be processed 1207 reference to the node to be processed
1209 </dd> 1208 </dd>
1210 </dl> 1209 </dl>
1211 <a NAME="BugBearVisitor.visit_FunctionDef" ID="BugBearVisitor.visit_FunctionDef"></a> 1210 <a NAME="BugBearVisitor.visit_FunctionDef" ID="BugBearVisitor.visit_FunctionDef"></a>
1212 <h4>BugBearVisitor.visit_FunctionDef</h4> 1211 <h4>BugBearVisitor.visit_FunctionDef</h4>
1213 <b>visit_FunctionDef</b>(<i>node</i>) 1212 <b>visit_FunctionDef</b>(<i>node</i>)
1214
1215 <p> 1213 <p>
1216 Public method to handle function definitions. 1214 Public method to handle function definitions.
1217 </p> 1215 </p>
1216
1218 <dl> 1217 <dl>
1219 1218
1220 <dt><i>node</i> (ast.FunctionDef)</dt> 1219 <dt><i>node</i> (ast.FunctionDef)</dt>
1221 <dd> 1220 <dd>
1222 reference to the node to be processed 1221 reference to the node to be processed
1223 </dd> 1222 </dd>
1224 </dl> 1223 </dl>
1225 <a NAME="BugBearVisitor.visit_GeneratorExp" ID="BugBearVisitor.visit_GeneratorExp"></a> 1224 <a NAME="BugBearVisitor.visit_GeneratorExp" ID="BugBearVisitor.visit_GeneratorExp"></a>
1226 <h4>BugBearVisitor.visit_GeneratorExp</h4> 1225 <h4>BugBearVisitor.visit_GeneratorExp</h4>
1227 <b>visit_GeneratorExp</b>(<i>node</i>) 1226 <b>visit_GeneratorExp</b>(<i>node</i>)
1228
1229 <p> 1227 <p>
1230 Public method to handle generator expressions. 1228 Public method to handle generator expressions.
1231 </p> 1229 </p>
1230
1232 <dl> 1231 <dl>
1233 1232
1234 <dt><i>node</i> (ast.GeneratorExp)</dt> 1233 <dt><i>node</i> (ast.GeneratorExp)</dt>
1235 <dd> 1234 <dd>
1236 reference to the node to be processed 1235 reference to the node to be processed
1237 </dd> 1236 </dd>
1238 </dl> 1237 </dl>
1239 <a NAME="BugBearVisitor.visit_Import" ID="BugBearVisitor.visit_Import"></a> 1238 <a NAME="BugBearVisitor.visit_Import" ID="BugBearVisitor.visit_Import"></a>
1240 <h4>BugBearVisitor.visit_Import</h4> 1239 <h4>BugBearVisitor.visit_Import</h4>
1241 <b>visit_Import</b>(<i>node</i>) 1240 <b>visit_Import</b>(<i>node</i>)
1242
1243 <p> 1241 <p>
1244 Public method to check imports. 1242 Public method to check imports.
1245 </p> 1243 </p>
1244
1246 <dl> 1245 <dl>
1247 1246
1248 <dt><i>node</i> (ast.Import)</dt> 1247 <dt><i>node</i> (ast.Import)</dt>
1249 <dd> 1248 <dd>
1250 reference to the node to be processed 1249 reference to the node to be processed
1251 </dd> 1250 </dd>
1252 </dl> 1251 </dl>
1253 <a NAME="BugBearVisitor.visit_ImportFrom" ID="BugBearVisitor.visit_ImportFrom"></a> 1252 <a NAME="BugBearVisitor.visit_ImportFrom" ID="BugBearVisitor.visit_ImportFrom"></a>
1254 <h4>BugBearVisitor.visit_ImportFrom</h4> 1253 <h4>BugBearVisitor.visit_ImportFrom</h4>
1255 <b>visit_ImportFrom</b>(<i>node</i>) 1254 <b>visit_ImportFrom</b>(<i>node</i>)
1256
1257 <p> 1255 <p>
1258 Public method to check from imports. 1256 Public method to check from imports.
1259 </p> 1257 </p>
1258
1260 <dl> 1259 <dl>
1261 1260
1262 <dt><i>node</i> (ast.Import)</dt> 1261 <dt><i>node</i> (ast.Import)</dt>
1263 <dd> 1262 <dd>
1264 reference to the node to be processed 1263 reference to the node to be processed
1265 </dd> 1264 </dd>
1266 </dl> 1265 </dl>
1267 <a NAME="BugBearVisitor.visit_JoinedStr" ID="BugBearVisitor.visit_JoinedStr"></a> 1266 <a NAME="BugBearVisitor.visit_JoinedStr" ID="BugBearVisitor.visit_JoinedStr"></a>
1268 <h4>BugBearVisitor.visit_JoinedStr</h4> 1267 <h4>BugBearVisitor.visit_JoinedStr</h4>
1269 <b>visit_JoinedStr</b>(<i>node</i>) 1268 <b>visit_JoinedStr</b>(<i>node</i>)
1270
1271 <p> 1269 <p>
1272 Public method to handle f-string arguments. 1270 Public method to handle f-string arguments.
1273 </p> 1271 </p>
1272
1274 <dl> 1273 <dl>
1275 1274
1276 <dt><i>node</i> (ast.JoinedStr)</dt> 1275 <dt><i>node</i> (ast.JoinedStr)</dt>
1277 <dd> 1276 <dd>
1278 reference to the node to be processed 1277 reference to the node to be processed
1279 </dd> 1278 </dd>
1280 </dl> 1279 </dl>
1281 <a NAME="BugBearVisitor.visit_ListComp" ID="BugBearVisitor.visit_ListComp"></a> 1280 <a NAME="BugBearVisitor.visit_ListComp" ID="BugBearVisitor.visit_ListComp"></a>
1282 <h4>BugBearVisitor.visit_ListComp</h4> 1281 <h4>BugBearVisitor.visit_ListComp</h4>
1283 <b>visit_ListComp</b>(<i>node</i>) 1282 <b>visit_ListComp</b>(<i>node</i>)
1284
1285 <p> 1283 <p>
1286 Public method to handle list comprehensions. 1284 Public method to handle list comprehensions.
1287 </p> 1285 </p>
1286
1288 <dl> 1287 <dl>
1289 1288
1290 <dt><i>node</i> (ast.ListComp)</dt> 1289 <dt><i>node</i> (ast.ListComp)</dt>
1291 <dd> 1290 <dd>
1292 reference to the node to be processed 1291 reference to the node to be processed
1293 </dd> 1292 </dd>
1294 </dl> 1293 </dl>
1295 <a NAME="BugBearVisitor.visit_Module" ID="BugBearVisitor.visit_Module"></a> 1294 <a NAME="BugBearVisitor.visit_Module" ID="BugBearVisitor.visit_Module"></a>
1296 <h4>BugBearVisitor.visit_Module</h4> 1295 <h4>BugBearVisitor.visit_Module</h4>
1297 <b>visit_Module</b>(<i>node</i>) 1296 <b>visit_Module</b>(<i>node</i>)
1298
1299 <p> 1297 <p>
1300 Public method to handle a module node. 1298 Public method to handle a module node.
1301 </p> 1299 </p>
1300
1302 <dl> 1301 <dl>
1303 1302
1304 <dt><i>node</i> (ast.Module)</dt> 1303 <dt><i>node</i> (ast.Module)</dt>
1305 <dd> 1304 <dd>
1306 reference to the node to be processed 1305 reference to the node to be processed
1307 </dd> 1306 </dd>
1308 </dl> 1307 </dl>
1309 <a NAME="BugBearVisitor.visit_Raise" ID="BugBearVisitor.visit_Raise"></a> 1308 <a NAME="BugBearVisitor.visit_Raise" ID="BugBearVisitor.visit_Raise"></a>
1310 <h4>BugBearVisitor.visit_Raise</h4> 1309 <h4>BugBearVisitor.visit_Raise</h4>
1311 <b>visit_Raise</b>(<i>node</i>) 1310 <b>visit_Raise</b>(<i>node</i>)
1312
1313 <p> 1311 <p>
1314 Public method to handle 'raise' statements. 1312 Public method to handle 'raise' statements.
1315 </p> 1313 </p>
1314
1316 <dl> 1315 <dl>
1317 1316
1318 <dt><i>node</i> (ast.Raise)</dt> 1317 <dt><i>node</i> (ast.Raise)</dt>
1319 <dd> 1318 <dd>
1320 reference to the node to be processed 1319 reference to the node to be processed
1321 </dd> 1320 </dd>
1322 </dl> 1321 </dl>
1323 <a NAME="BugBearVisitor.visit_Set" ID="BugBearVisitor.visit_Set"></a> 1322 <a NAME="BugBearVisitor.visit_Set" ID="BugBearVisitor.visit_Set"></a>
1324 <h4>BugBearVisitor.visit_Set</h4> 1323 <h4>BugBearVisitor.visit_Set</h4>
1325 <b>visit_Set</b>(<i>node</i>) 1324 <b>visit_Set</b>(<i>node</i>)
1326
1327 <p> 1325 <p>
1328 Public method to check a set. 1326 Public method to check a set.
1329 </p> 1327 </p>
1328
1330 <dl> 1329 <dl>
1331 1330
1332 <dt><i>node</i> (ast.Set)</dt> 1331 <dt><i>node</i> (ast.Set)</dt>
1333 <dd> 1332 <dd>
1334 reference to the node to be processed 1333 reference to the node to be processed
1335 </dd> 1334 </dd>
1336 </dl> 1335 </dl>
1337 <a NAME="BugBearVisitor.visit_SetComp" ID="BugBearVisitor.visit_SetComp"></a> 1336 <a NAME="BugBearVisitor.visit_SetComp" ID="BugBearVisitor.visit_SetComp"></a>
1338 <h4>BugBearVisitor.visit_SetComp</h4> 1337 <h4>BugBearVisitor.visit_SetComp</h4>
1339 <b>visit_SetComp</b>(<i>node</i>) 1338 <b>visit_SetComp</b>(<i>node</i>)
1340
1341 <p> 1339 <p>
1342 Public method to handle set comprehensions. 1340 Public method to handle set comprehensions.
1343 </p> 1341 </p>
1342
1344 <dl> 1343 <dl>
1345 1344
1346 <dt><i>node</i> (ast.SetComp)</dt> 1345 <dt><i>node</i> (ast.SetComp)</dt>
1347 <dd> 1346 <dd>
1348 reference to the node to be processed 1347 reference to the node to be processed
1349 </dd> 1348 </dd>
1350 </dl> 1349 </dl>
1351 <a NAME="BugBearVisitor.visit_Try" ID="BugBearVisitor.visit_Try"></a> 1350 <a NAME="BugBearVisitor.visit_Try" ID="BugBearVisitor.visit_Try"></a>
1352 <h4>BugBearVisitor.visit_Try</h4> 1351 <h4>BugBearVisitor.visit_Try</h4>
1353 <b>visit_Try</b>(<i>node</i>) 1352 <b>visit_Try</b>(<i>node</i>)
1354
1355 <p> 1353 <p>
1356 Public method to handle 'try' statements'. 1354 Public method to handle 'try' statements'.
1357 </p> 1355 </p>
1356
1358 <dl> 1357 <dl>
1359 1358
1360 <dt><i>node</i> (ast.Try)</dt> 1359 <dt><i>node</i> (ast.Try)</dt>
1361 <dd> 1360 <dd>
1362 reference to the node to be processed 1361 reference to the node to be processed
1363 </dd> 1362 </dd>
1364 </dl> 1363 </dl>
1365 <a NAME="BugBearVisitor.visit_UAdd" ID="BugBearVisitor.visit_UAdd"></a> 1364 <a NAME="BugBearVisitor.visit_UAdd" ID="BugBearVisitor.visit_UAdd"></a>
1366 <h4>BugBearVisitor.visit_UAdd</h4> 1365 <h4>BugBearVisitor.visit_UAdd</h4>
1367 <b>visit_UAdd</b>(<i>node</i>) 1366 <b>visit_UAdd</b>(<i>node</i>)
1368
1369 <p> 1367 <p>
1370 Public method to handle unary additions. 1368 Public method to handle unary additions.
1371 </p> 1369 </p>
1370
1372 <dl> 1371 <dl>
1373 1372
1374 <dt><i>node</i> (ast.UAdd)</dt> 1373 <dt><i>node</i> (ast.UAdd)</dt>
1375 <dd> 1374 <dd>
1376 reference to the node to be processed 1375 reference to the node to be processed
1377 </dd> 1376 </dd>
1378 </dl> 1377 </dl>
1379 <a NAME="BugBearVisitor.visit_While" ID="BugBearVisitor.visit_While"></a> 1378 <a NAME="BugBearVisitor.visit_While" ID="BugBearVisitor.visit_While"></a>
1380 <h4>BugBearVisitor.visit_While</h4> 1379 <h4>BugBearVisitor.visit_While</h4>
1381 <b>visit_While</b>(<i>node</i>) 1380 <b>visit_While</b>(<i>node</i>)
1382
1383 <p> 1381 <p>
1384 Public method to handle 'while' statements. 1382 Public method to handle 'while' statements.
1385 </p> 1383 </p>
1384
1386 <dl> 1385 <dl>
1387 1386
1388 <dt><i>node</i> (ast.While)</dt> 1387 <dt><i>node</i> (ast.While)</dt>
1389 <dd> 1388 <dd>
1390 reference to the node to be processed 1389 reference to the node to be processed
1391 </dd> 1390 </dd>
1392 </dl> 1391 </dl>
1393 <a NAME="BugBearVisitor.visit_With" ID="BugBearVisitor.visit_With"></a> 1392 <a NAME="BugBearVisitor.visit_With" ID="BugBearVisitor.visit_With"></a>
1394 <h4>BugBearVisitor.visit_With</h4> 1393 <h4>BugBearVisitor.visit_With</h4>
1395 <b>visit_With</b>(<i>node</i>) 1394 <b>visit_With</b>(<i>node</i>)
1396
1397 <p> 1395 <p>
1398 Public method to handle 'with' statements. 1396 Public method to handle 'with' statements.
1399 </p> 1397 </p>
1398
1400 <dl> 1399 <dl>
1401 1400
1402 <dt><i>node</i> (ast.With)</dt> 1401 <dt><i>node</i> (ast.With)</dt>
1403 <dd> 1402 <dd>
1404 reference to the node to be processed 1403 reference to the node to be processed
1407 <div align="right"><a href="#top">Up</a></div> 1406 <div align="right"><a href="#top">Up</a></div>
1408 <hr /> 1407 <hr />
1409 <hr /> 1408 <hr />
1410 <a NAME="DateTimeVisitor" ID="DateTimeVisitor"></a> 1409 <a NAME="DateTimeVisitor" ID="DateTimeVisitor"></a>
1411 <h2>DateTimeVisitor</h2> 1410 <h2>DateTimeVisitor</h2>
1412
1413 <p> 1411 <p>
1414 Class implementing a node visitor to check datetime function calls. 1412 Class implementing a node visitor to check datetime function calls.
1415 </p> 1413 </p>
1416 <p> 1414 <p>
1417 Note: This class is modeled after flake8_datetimez checker. 1415 Note: This class is modeled after flake8_datetimez checker.
1418 </p> 1416 </p>
1417
1419 <h3>Derived from</h3> 1418 <h3>Derived from</h3>
1420 ast.NodeVisitor 1419 ast.NodeVisitor
1421 <h3>Class Attributes</h3> 1420 <h3>Class Attributes</h3>
1422
1423 <table> 1421 <table>
1424 <tr><td>None</td></tr> 1422 <tr><td>None</td></tr>
1425 </table> 1423 </table>
1424
1426 <h3>Class Methods</h3> 1425 <h3>Class Methods</h3>
1427
1428 <table> 1426 <table>
1429 <tr><td>None</td></tr> 1427 <tr><td>None</td></tr>
1430 </table> 1428 </table>
1429
1431 <h3>Methods</h3> 1430 <h3>Methods</h3>
1432 1431 <table>
1433 <table>
1434
1435 <tr> 1432 <tr>
1436 <td><a href="#DateTimeVisitor.__init__">DateTimeVisitor</a></td> 1433 <td><a href="#DateTimeVisitor.__init__">DateTimeVisitor</a></td>
1437 <td>Constructor</td> 1434 <td>Constructor</td>
1438 </tr> 1435 </tr>
1439 <tr> 1436 <tr>
1443 <tr> 1440 <tr>
1444 <td><a href="#DateTimeVisitor.visit_Call">visit_Call</a></td> 1441 <td><a href="#DateTimeVisitor.visit_Call">visit_Call</a></td>
1445 <td>Public method to handle a function call.</td> 1442 <td>Public method to handle a function call.</td>
1446 </tr> 1443 </tr>
1447 </table> 1444 </table>
1445
1448 <h3>Static Methods</h3> 1446 <h3>Static Methods</h3>
1449
1450 <table> 1447 <table>
1451 <tr><td>None</td></tr> 1448 <tr><td>None</td></tr>
1452 </table> 1449 </table>
1450
1453 1451
1454 <a NAME="DateTimeVisitor.__init__" ID="DateTimeVisitor.__init__"></a> 1452 <a NAME="DateTimeVisitor.__init__" ID="DateTimeVisitor.__init__"></a>
1455 <h4>DateTimeVisitor (Constructor)</h4> 1453 <h4>DateTimeVisitor (Constructor)</h4>
1456 <b>DateTimeVisitor</b>(<i></i>) 1454 <b>DateTimeVisitor</b>(<i></i>)
1457
1458 <p> 1455 <p>
1459 Constructor 1456 Constructor
1460 </p> 1457 </p>
1458
1461 <a NAME="DateTimeVisitor.__getFromKeywords" ID="DateTimeVisitor.__getFromKeywords"></a> 1459 <a NAME="DateTimeVisitor.__getFromKeywords" ID="DateTimeVisitor.__getFromKeywords"></a>
1462 <h4>DateTimeVisitor.__getFromKeywords</h4> 1460 <h4>DateTimeVisitor.__getFromKeywords</h4>
1463 <b>__getFromKeywords</b>(<i>keywords, name</i>) 1461 <b>__getFromKeywords</b>(<i>keywords, name</i>)
1464
1465 <p> 1462 <p>
1466 Private method to get a keyword node given its name. 1463 Private method to get a keyword node given its name.
1467 </p> 1464 </p>
1465
1468 <dl> 1466 <dl>
1469 1467
1470 <dt><i>keywords</i> (list of ast.AST)</dt> 1468 <dt><i>keywords</i> (list of ast.AST)</dt>
1471 <dd> 1469 <dd>
1472 list of keyword argument nodes 1470 list of keyword argument nodes
1489 </dd> 1487 </dd>
1490 </dl> 1488 </dl>
1491 <a NAME="DateTimeVisitor.visit_Call" ID="DateTimeVisitor.visit_Call"></a> 1489 <a NAME="DateTimeVisitor.visit_Call" ID="DateTimeVisitor.visit_Call"></a>
1492 <h4>DateTimeVisitor.visit_Call</h4> 1490 <h4>DateTimeVisitor.visit_Call</h4>
1493 <b>visit_Call</b>(<i>node</i>) 1491 <b>visit_Call</b>(<i>node</i>)
1494
1495 <p> 1492 <p>
1496 Public method to handle a function call. 1493 Public method to handle a function call.
1497 </p> 1494 </p>
1498 <p> 1495 <p>
1499 Every datetime related function call is check for use of the naive 1496 Every datetime related function call is check for use of the naive
1500 variant (i.e. use without TZ info). 1497 variant (i.e. use without TZ info).
1501 </p> 1498 </p>
1499
1502 <dl> 1500 <dl>
1503 1501
1504 <dt><i>node</i> (ast.Call)</dt> 1502 <dt><i>node</i> (ast.Call)</dt>
1505 <dd> 1503 <dd>
1506 reference to the node to be processed 1504 reference to the node to be processed
1509 <div align="right"><a href="#top">Up</a></div> 1507 <div align="right"><a href="#top">Up</a></div>
1510 <hr /> 1508 <hr />
1511 <hr /> 1509 <hr />
1512 <a NAME="M520NameFinder" ID="M520NameFinder"></a> 1510 <a NAME="M520NameFinder" ID="M520NameFinder"></a>
1513 <h2>M520NameFinder</h2> 1511 <h2>M520NameFinder</h2>
1514
1515 <p> 1512 <p>
1516 Class to extract a name out of a tree of nodes ignoring names defined within the 1513 Class to extract a name out of a tree of nodes ignoring names defined within the
1517 local scope of a comprehension. 1514 local scope of a comprehension.
1518 </p> 1515 </p>
1516
1519 <h3>Derived from</h3> 1517 <h3>Derived from</h3>
1520 NameFinder 1518 NameFinder
1521 <h3>Class Attributes</h3> 1519 <h3>Class Attributes</h3>
1522
1523 <table> 1520 <table>
1524 <tr><td>None</td></tr> 1521 <tr><td>None</td></tr>
1525 </table> 1522 </table>
1523
1526 <h3>Class Methods</h3> 1524 <h3>Class Methods</h3>
1527
1528 <table> 1525 <table>
1529 <tr><td>None</td></tr> 1526 <tr><td>None</td></tr>
1530 </table> 1527 </table>
1528
1531 <h3>Methods</h3> 1529 <h3>Methods</h3>
1532 1530 <table>
1533 <table>
1534
1535 <tr> 1531 <tr>
1536 <td><a href="#M520NameFinder.visit_DictComp">visit_DictComp</a></td> 1532 <td><a href="#M520NameFinder.visit_DictComp">visit_DictComp</a></td>
1537 <td>Public method to handle a dictionary comprehension.</td> 1533 <td>Public method to handle a dictionary comprehension.</td>
1538 </tr> 1534 </tr>
1539 <tr> 1535 <tr>
1551 <tr> 1547 <tr>
1552 <td><a href="#M520NameFinder.visit_comprehension">visit_comprehension</a></td> 1548 <td><a href="#M520NameFinder.visit_comprehension">visit_comprehension</a></td>
1553 <td>Public method to handle the 'for' of a comprehension.</td> 1549 <td>Public method to handle the 'for' of a comprehension.</td>
1554 </tr> 1550 </tr>
1555 </table> 1551 </table>
1552
1556 <h3>Static Methods</h3> 1553 <h3>Static Methods</h3>
1557
1558 <table> 1554 <table>
1559 <tr><td>None</td></tr> 1555 <tr><td>None</td></tr>
1560 </table> 1556 </table>
1557
1561 1558
1562 <a NAME="M520NameFinder.visit_DictComp" ID="M520NameFinder.visit_DictComp"></a> 1559 <a NAME="M520NameFinder.visit_DictComp" ID="M520NameFinder.visit_DictComp"></a>
1563 <h4>M520NameFinder.visit_DictComp</h4> 1560 <h4>M520NameFinder.visit_DictComp</h4>
1564 <b>visit_DictComp</b>(<i>node</i>) 1561 <b>visit_DictComp</b>(<i>node</i>)
1565
1566 <p> 1562 <p>
1567 Public method to handle a dictionary comprehension. 1563 Public method to handle a dictionary comprehension.
1568 </p> 1564 </p>
1565
1569 <dl> 1566 <dl>
1570 1567
1571 <dt><i>node</i> (TYPE)</dt> 1568 <dt><i>node</i> (TYPE)</dt>
1572 <dd> 1569 <dd>
1573 reference to the node to be processed 1570 reference to the node to be processed
1574 </dd> 1571 </dd>
1575 </dl> 1572 </dl>
1576 <a NAME="M520NameFinder.visit_GeneratorExp" ID="M520NameFinder.visit_GeneratorExp"></a> 1573 <a NAME="M520NameFinder.visit_GeneratorExp" ID="M520NameFinder.visit_GeneratorExp"></a>
1577 <h4>M520NameFinder.visit_GeneratorExp</h4> 1574 <h4>M520NameFinder.visit_GeneratorExp</h4>
1578 <b>visit_GeneratorExp</b>(<i>node</i>) 1575 <b>visit_GeneratorExp</b>(<i>node</i>)
1579
1580 <p> 1576 <p>
1581 Public method to handle a generator expressions. 1577 Public method to handle a generator expressions.
1582 </p> 1578 </p>
1579
1583 <dl> 1580 <dl>
1584 1581
1585 <dt><i>node</i> (ast.GeneratorExp)</dt> 1582 <dt><i>node</i> (ast.GeneratorExp)</dt>
1586 <dd> 1583 <dd>
1587 reference to the node to be processed 1584 reference to the node to be processed
1588 </dd> 1585 </dd>
1589 </dl> 1586 </dl>
1590 <a NAME="M520NameFinder.visit_Lambda" ID="M520NameFinder.visit_Lambda"></a> 1587 <a NAME="M520NameFinder.visit_Lambda" ID="M520NameFinder.visit_Lambda"></a>
1591 <h4>M520NameFinder.visit_Lambda</h4> 1588 <h4>M520NameFinder.visit_Lambda</h4>
1592 <b>visit_Lambda</b>(<i>node</i>) 1589 <b>visit_Lambda</b>(<i>node</i>)
1593
1594 <p> 1590 <p>
1595 Public method to handle a Lambda function. 1591 Public method to handle a Lambda function.
1596 </p> 1592 </p>
1593
1597 <dl> 1594 <dl>
1598 1595
1599 <dt><i>node</i> (ast.Lambda)</dt> 1596 <dt><i>node</i> (ast.Lambda)</dt>
1600 <dd> 1597 <dd>
1601 reference to the node to be processed 1598 reference to the node to be processed
1602 </dd> 1599 </dd>
1603 </dl> 1600 </dl>
1604 <a NAME="M520NameFinder.visit_ListComp" ID="M520NameFinder.visit_ListComp"></a> 1601 <a NAME="M520NameFinder.visit_ListComp" ID="M520NameFinder.visit_ListComp"></a>
1605 <h4>M520NameFinder.visit_ListComp</h4> 1602 <h4>M520NameFinder.visit_ListComp</h4>
1606 <b>visit_ListComp</b>(<i>node</i>) 1603 <b>visit_ListComp</b>(<i>node</i>)
1607
1608 <p> 1604 <p>
1609 Public method to handle a list comprehension. 1605 Public method to handle a list comprehension.
1610 </p> 1606 </p>
1607
1611 <dl> 1608 <dl>
1612 1609
1613 <dt><i>node</i> (TYPE)</dt> 1610 <dt><i>node</i> (TYPE)</dt>
1614 <dd> 1611 <dd>
1615 reference to the node to be processed 1612 reference to the node to be processed
1616 </dd> 1613 </dd>
1617 </dl> 1614 </dl>
1618 <a NAME="M520NameFinder.visit_comprehension" ID="M520NameFinder.visit_comprehension"></a> 1615 <a NAME="M520NameFinder.visit_comprehension" ID="M520NameFinder.visit_comprehension"></a>
1619 <h4>M520NameFinder.visit_comprehension</h4> 1616 <h4>M520NameFinder.visit_comprehension</h4>
1620 <b>visit_comprehension</b>(<i>node</i>) 1617 <b>visit_comprehension</b>(<i>node</i>)
1621
1622 <p> 1618 <p>
1623 Public method to handle the 'for' of a comprehension. 1619 Public method to handle the 'for' of a comprehension.
1624 </p> 1620 </p>
1621
1625 <dl> 1622 <dl>
1626 1623
1627 <dt><i>node</i> (ast.comprehension)</dt> 1624 <dt><i>node</i> (ast.comprehension)</dt>
1628 <dd> 1625 <dd>
1629 reference to the node to be processed 1626 reference to the node to be processed
1632 <div align="right"><a href="#top">Up</a></div> 1629 <div align="right"><a href="#top">Up</a></div>
1633 <hr /> 1630 <hr />
1634 <hr /> 1631 <hr />
1635 <a NAME="MiscellaneousChecker" ID="MiscellaneousChecker"></a> 1632 <a NAME="MiscellaneousChecker" ID="MiscellaneousChecker"></a>
1636 <h2>MiscellaneousChecker</h2> 1633 <h2>MiscellaneousChecker</h2>
1637
1638 <p> 1634 <p>
1639 Class implementing a checker for miscellaneous checks. 1635 Class implementing a checker for miscellaneous checks.
1640 </p> 1636 </p>
1637
1641 <h3>Derived from</h3> 1638 <h3>Derived from</h3>
1642 None 1639 None
1643 <h3>Class Attributes</h3> 1640 <h3>Class Attributes</h3>
1644 1641 <table>
1645 <table> 1642 <tr><td>BuiltinsWhiteList</td></tr>
1646 <tr><td>BuiltinsWhiteList</td></tr><tr><td>Codes</td></tr><tr><td>FormatFieldRegex</td></tr><tr><td>Formatter</td></tr> 1643 <tr><td>Codes</td></tr>
1647 </table> 1644 <tr><td>FormatFieldRegex</td></tr>
1645 <tr><td>Formatter</td></tr>
1646 </table>
1647
1648 <h3>Class Methods</h3> 1648 <h3>Class Methods</h3>
1649
1650 <table> 1649 <table>
1651 <tr><td>None</td></tr> 1650 <tr><td>None</td></tr>
1652 </table> 1651 </table>
1652
1653 <h3>Methods</h3> 1653 <h3>Methods</h3>
1654 1654 <table>
1655 <table>
1656
1657 <tr> 1655 <tr>
1658 <td><a href="#MiscellaneousChecker.__init__">MiscellaneousChecker</a></td> 1656 <td><a href="#MiscellaneousChecker.__init__">MiscellaneousChecker</a></td>
1659 <td>Constructor</td> 1657 <td>Constructor</td>
1660 </tr> 1658 </tr>
1661 <tr> 1659 <tr>
1769 <tr> 1767 <tr>
1770 <td><a href="#MiscellaneousChecker.run">run</a></td> 1768 <td><a href="#MiscellaneousChecker.run">run</a></td>
1771 <td>Public method to check the given source against miscellaneous conditions.</td> 1769 <td>Public method to check the given source against miscellaneous conditions.</td>
1772 </tr> 1770 </tr>
1773 </table> 1771 </table>
1772
1774 <h3>Static Methods</h3> 1773 <h3>Static Methods</h3>
1775
1776 <table> 1774 <table>
1777 <tr><td>None</td></tr> 1775 <tr><td>None</td></tr>
1778 </table> 1776 </table>
1777
1779 1778
1780 <a NAME="MiscellaneousChecker.__init__" ID="MiscellaneousChecker.__init__"></a> 1779 <a NAME="MiscellaneousChecker.__init__" ID="MiscellaneousChecker.__init__"></a>
1781 <h4>MiscellaneousChecker (Constructor)</h4> 1780 <h4>MiscellaneousChecker (Constructor)</h4>
1782 <b>MiscellaneousChecker</b>(<i>source, filename, tree, select, ignore, expected, repeat, args</i>) 1781 <b>MiscellaneousChecker</b>(<i>source, filename, tree, select, ignore, expected, repeat, args</i>)
1783
1784 <p> 1782 <p>
1785 Constructor 1783 Constructor
1786 </p> 1784 </p>
1785
1787 <dl> 1786 <dl>
1788 1787
1789 <dt><i>source</i> (list of str)</dt> 1788 <dt><i>source</i> (list of str)</dt>
1790 <dd> 1789 <dd>
1791 source code to be checked 1790 source code to be checked
1820 </dd> 1819 </dd>
1821 </dl> 1820 </dl>
1822 <a NAME="MiscellaneousChecker.__checkBugBear" ID="MiscellaneousChecker.__checkBugBear"></a> 1821 <a NAME="MiscellaneousChecker.__checkBugBear" ID="MiscellaneousChecker.__checkBugBear"></a>
1823 <h4>MiscellaneousChecker.__checkBugBear</h4> 1822 <h4>MiscellaneousChecker.__checkBugBear</h4>
1824 <b>__checkBugBear</b>(<i></i>) 1823 <b>__checkBugBear</b>(<i></i>)
1825
1826 <p> 1824 <p>
1827 Private method for bugbear checks. 1825 Private method for bugbear checks.
1828 </p> 1826 </p>
1827
1829 <a NAME="MiscellaneousChecker.__checkBuiltins" ID="MiscellaneousChecker.__checkBuiltins"></a> 1828 <a NAME="MiscellaneousChecker.__checkBuiltins" ID="MiscellaneousChecker.__checkBuiltins"></a>
1830 <h4>MiscellaneousChecker.__checkBuiltins</h4> 1829 <h4>MiscellaneousChecker.__checkBuiltins</h4>
1831 <b>__checkBuiltins</b>(<i></i>) 1830 <b>__checkBuiltins</b>(<i></i>)
1832
1833 <p> 1831 <p>
1834 Private method to check, if built-ins are shadowed. 1832 Private method to check, if built-ins are shadowed.
1835 </p> 1833 </p>
1834
1836 <a NAME="MiscellaneousChecker.__checkCoding" ID="MiscellaneousChecker.__checkCoding"></a> 1835 <a NAME="MiscellaneousChecker.__checkCoding" ID="MiscellaneousChecker.__checkCoding"></a>
1837 <h4>MiscellaneousChecker.__checkCoding</h4> 1836 <h4>MiscellaneousChecker.__checkCoding</h4>
1838 <b>__checkCoding</b>(<i></i>) 1837 <b>__checkCoding</b>(<i></i>)
1839
1840 <p> 1838 <p>
1841 Private method to check the presence of a coding line and valid 1839 Private method to check the presence of a coding line and valid
1842 encodings. 1840 encodings.
1843 </p> 1841 </p>
1842
1844 <a NAME="MiscellaneousChecker.__checkCommentedCode" ID="MiscellaneousChecker.__checkCommentedCode"></a> 1843 <a NAME="MiscellaneousChecker.__checkCommentedCode" ID="MiscellaneousChecker.__checkCommentedCode"></a>
1845 <h4>MiscellaneousChecker.__checkCommentedCode</h4> 1844 <h4>MiscellaneousChecker.__checkCommentedCode</h4>
1846 <b>__checkCommentedCode</b>(<i></i>) 1845 <b>__checkCommentedCode</b>(<i></i>)
1847
1848 <p> 1846 <p>
1849 Private method to check for commented code. 1847 Private method to check for commented code.
1850 </p> 1848 </p>
1849
1851 <a NAME="MiscellaneousChecker.__checkComprehensions" ID="MiscellaneousChecker.__checkComprehensions"></a> 1850 <a NAME="MiscellaneousChecker.__checkComprehensions" ID="MiscellaneousChecker.__checkComprehensions"></a>
1852 <h4>MiscellaneousChecker.__checkComprehensions</h4> 1851 <h4>MiscellaneousChecker.__checkComprehensions</h4>
1853 <b>__checkComprehensions</b>(<i></i>) 1852 <b>__checkComprehensions</b>(<i></i>)
1854
1855 <p> 1853 <p>
1856 Private method to check some comprehension related things. 1854 Private method to check some comprehension related things.
1857 </p> 1855 </p>
1858 <p> 1856 <p>
1859 This method is adapted from: flake8-comprehensions v3.14.0 1857 This method is adapted from: flake8-comprehensions v3.14.0
1860 Original: Copyright (c) 2017 Adam Johnson 1858 Original: Copyright (c) 2017 Adam Johnson
1861 </p> 1859 </p>
1860
1862 <a NAME="MiscellaneousChecker.__checkCopyright" ID="MiscellaneousChecker.__checkCopyright"></a> 1861 <a NAME="MiscellaneousChecker.__checkCopyright" ID="MiscellaneousChecker.__checkCopyright"></a>
1863 <h4>MiscellaneousChecker.__checkCopyright</h4> 1862 <h4>MiscellaneousChecker.__checkCopyright</h4>
1864 <b>__checkCopyright</b>(<i></i>) 1863 <b>__checkCopyright</b>(<i></i>)
1865
1866 <p> 1864 <p>
1867 Private method to check the presence of a copyright statement. 1865 Private method to check the presence of a copyright statement.
1868 </p> 1866 </p>
1867
1869 <a NAME="MiscellaneousChecker.__checkDateTime" ID="MiscellaneousChecker.__checkDateTime"></a> 1868 <a NAME="MiscellaneousChecker.__checkDateTime" ID="MiscellaneousChecker.__checkDateTime"></a>
1870 <h4>MiscellaneousChecker.__checkDateTime</h4> 1869 <h4>MiscellaneousChecker.__checkDateTime</h4>
1871 <b>__checkDateTime</b>(<i></i>) 1870 <b>__checkDateTime</b>(<i></i>)
1872
1873 <p> 1871 <p>
1874 Private method to check use of naive datetime functions. 1872 Private method to check use of naive datetime functions.
1875 </p> 1873 </p>
1874
1876 <a NAME="MiscellaneousChecker.__checkDictWithSortedKeys" ID="MiscellaneousChecker.__checkDictWithSortedKeys"></a> 1875 <a NAME="MiscellaneousChecker.__checkDictWithSortedKeys" ID="MiscellaneousChecker.__checkDictWithSortedKeys"></a>
1877 <h4>MiscellaneousChecker.__checkDictWithSortedKeys</h4> 1876 <h4>MiscellaneousChecker.__checkDictWithSortedKeys</h4>
1878 <b>__checkDictWithSortedKeys</b>(<i></i>) 1877 <b>__checkDictWithSortedKeys</b>(<i></i>)
1879
1880 <p> 1878 <p>
1881 Private method to check, if dictionary keys appear in sorted order. 1879 Private method to check, if dictionary keys appear in sorted order.
1882 </p> 1880 </p>
1881
1883 <a NAME="MiscellaneousChecker.__checkExplicitStringConcat" ID="MiscellaneousChecker.__checkExplicitStringConcat"></a> 1882 <a NAME="MiscellaneousChecker.__checkExplicitStringConcat" ID="MiscellaneousChecker.__checkExplicitStringConcat"></a>
1884 <h4>MiscellaneousChecker.__checkExplicitStringConcat</h4> 1883 <h4>MiscellaneousChecker.__checkExplicitStringConcat</h4>
1885 <b>__checkExplicitStringConcat</b>(<i></i>) 1884 <b>__checkExplicitStringConcat</b>(<i></i>)
1886
1887 <p> 1885 <p>
1888 Private method to check for explicitly concatenated strings. 1886 Private method to check for explicitly concatenated strings.
1889 </p> 1887 </p>
1888
1890 <a NAME="MiscellaneousChecker.__checkFormatString" ID="MiscellaneousChecker.__checkFormatString"></a> 1889 <a NAME="MiscellaneousChecker.__checkFormatString" ID="MiscellaneousChecker.__checkFormatString"></a>
1891 <h4>MiscellaneousChecker.__checkFormatString</h4> 1890 <h4>MiscellaneousChecker.__checkFormatString</h4>
1892 <b>__checkFormatString</b>(<i></i>) 1891 <b>__checkFormatString</b>(<i></i>)
1893
1894 <p> 1892 <p>
1895 Private method to check string format strings. 1893 Private method to check string format strings.
1896 </p> 1894 </p>
1895
1897 <a NAME="MiscellaneousChecker.__checkFuture" ID="MiscellaneousChecker.__checkFuture"></a> 1896 <a NAME="MiscellaneousChecker.__checkFuture" ID="MiscellaneousChecker.__checkFuture"></a>
1898 <h4>MiscellaneousChecker.__checkFuture</h4> 1897 <h4>MiscellaneousChecker.__checkFuture</h4>
1899 <b>__checkFuture</b>(<i></i>) 1898 <b>__checkFuture</b>(<i></i>)
1900
1901 <p> 1899 <p>
1902 Private method to check the __future__ imports. 1900 Private method to check the __future__ imports.
1903 </p> 1901 </p>
1902
1904 <a NAME="MiscellaneousChecker.__checkGettext" ID="MiscellaneousChecker.__checkGettext"></a> 1903 <a NAME="MiscellaneousChecker.__checkGettext" ID="MiscellaneousChecker.__checkGettext"></a>
1905 <h4>MiscellaneousChecker.__checkGettext</h4> 1904 <h4>MiscellaneousChecker.__checkGettext</h4>
1906 <b>__checkGettext</b>(<i></i>) 1905 <b>__checkGettext</b>(<i></i>)
1907
1908 <p> 1906 <p>
1909 Private method to check the 'gettext' import statement. 1907 Private method to check the 'gettext' import statement.
1910 </p> 1908 </p>
1909
1911 <a NAME="MiscellaneousChecker.__checkImplicitStringConcat" ID="MiscellaneousChecker.__checkImplicitStringConcat"></a> 1910 <a NAME="MiscellaneousChecker.__checkImplicitStringConcat" ID="MiscellaneousChecker.__checkImplicitStringConcat"></a>
1912 <h4>MiscellaneousChecker.__checkImplicitStringConcat</h4> 1911 <h4>MiscellaneousChecker.__checkImplicitStringConcat</h4>
1913 <b>__checkImplicitStringConcat</b>(<i></i>) 1912 <b>__checkImplicitStringConcat</b>(<i></i>)
1914
1915 <p> 1913 <p>
1916 Private method to check for implicitly concatenated strings. 1914 Private method to check for implicitly concatenated strings.
1917 </p> 1915 </p>
1916
1918 <a NAME="MiscellaneousChecker.__checkLineContinuation" ID="MiscellaneousChecker.__checkLineContinuation"></a> 1917 <a NAME="MiscellaneousChecker.__checkLineContinuation" ID="MiscellaneousChecker.__checkLineContinuation"></a>
1919 <h4>MiscellaneousChecker.__checkLineContinuation</h4> 1918 <h4>MiscellaneousChecker.__checkLineContinuation</h4>
1920 <b>__checkLineContinuation</b>(<i></i>) 1919 <b>__checkLineContinuation</b>(<i></i>)
1921
1922 <p> 1920 <p>
1923 Private method to check line continuation using backslash. 1921 Private method to check line continuation using backslash.
1924 </p> 1922 </p>
1923
1925 <a NAME="MiscellaneousChecker.__checkMutableDefault" ID="MiscellaneousChecker.__checkMutableDefault"></a> 1924 <a NAME="MiscellaneousChecker.__checkMutableDefault" ID="MiscellaneousChecker.__checkMutableDefault"></a>
1926 <h4>MiscellaneousChecker.__checkMutableDefault</h4> 1925 <h4>MiscellaneousChecker.__checkMutableDefault</h4>
1927 <b>__checkMutableDefault</b>(<i></i>) 1926 <b>__checkMutableDefault</b>(<i></i>)
1928
1929 <p> 1927 <p>
1930 Private method to check for use of mutable types as default arguments. 1928 Private method to check for use of mutable types as default arguments.
1931 </p> 1929 </p>
1930
1932 <a NAME="MiscellaneousChecker.__checkPep3101" ID="MiscellaneousChecker.__checkPep3101"></a> 1931 <a NAME="MiscellaneousChecker.__checkPep3101" ID="MiscellaneousChecker.__checkPep3101"></a>
1933 <h4>MiscellaneousChecker.__checkPep3101</h4> 1932 <h4>MiscellaneousChecker.__checkPep3101</h4>
1934 <b>__checkPep3101</b>(<i></i>) 1933 <b>__checkPep3101</b>(<i></i>)
1935
1936 <p> 1934 <p>
1937 Private method to check for old style string formatting. 1935 Private method to check for old style string formatting.
1938 </p> 1936 </p>
1937
1939 <a NAME="MiscellaneousChecker.__checkPrintStatements" ID="MiscellaneousChecker.__checkPrintStatements"></a> 1938 <a NAME="MiscellaneousChecker.__checkPrintStatements" ID="MiscellaneousChecker.__checkPrintStatements"></a>
1940 <h4>MiscellaneousChecker.__checkPrintStatements</h4> 1939 <h4>MiscellaneousChecker.__checkPrintStatements</h4>
1941 <b>__checkPrintStatements</b>(<i></i>) 1940 <b>__checkPrintStatements</b>(<i></i>)
1942
1943 <p> 1941 <p>
1944 Private method to check for print statements. 1942 Private method to check for print statements.
1945 </p> 1943 </p>
1944
1946 <a NAME="MiscellaneousChecker.__checkProperties" ID="MiscellaneousChecker.__checkProperties"></a> 1945 <a NAME="MiscellaneousChecker.__checkProperties" ID="MiscellaneousChecker.__checkProperties"></a>
1947 <h4>MiscellaneousChecker.__checkProperties</h4> 1946 <h4>MiscellaneousChecker.__checkProperties</h4>
1948 <b>__checkProperties</b>(<i></i>) 1947 <b>__checkProperties</b>(<i></i>)
1949
1950 <p> 1948 <p>
1951 Private method to check for issue with property related methods. 1949 Private method to check for issue with property related methods.
1952 </p> 1950 </p>
1951
1953 <a NAME="MiscellaneousChecker.__checkReturn" ID="MiscellaneousChecker.__checkReturn"></a> 1952 <a NAME="MiscellaneousChecker.__checkReturn" ID="MiscellaneousChecker.__checkReturn"></a>
1954 <h4>MiscellaneousChecker.__checkReturn</h4> 1953 <h4>MiscellaneousChecker.__checkReturn</h4>
1955 <b>__checkReturn</b>(<i></i>) 1954 <b>__checkReturn</b>(<i></i>)
1956
1957 <p> 1955 <p>
1958 Private method to check return statements. 1956 Private method to check return statements.
1959 </p> 1957 </p>
1958
1960 <a NAME="MiscellaneousChecker.__checkSysVersion" ID="MiscellaneousChecker.__checkSysVersion"></a> 1959 <a NAME="MiscellaneousChecker.__checkSysVersion" ID="MiscellaneousChecker.__checkSysVersion"></a>
1961 <h4>MiscellaneousChecker.__checkSysVersion</h4> 1960 <h4>MiscellaneousChecker.__checkSysVersion</h4>
1962 <b>__checkSysVersion</b>(<i></i>) 1961 <b>__checkSysVersion</b>(<i></i>)
1963
1964 <p> 1962 <p>
1965 Private method to check the use of sys.version and sys.version_info. 1963 Private method to check the use of sys.version and sys.version_info.
1966 </p> 1964 </p>
1965
1967 <a NAME="MiscellaneousChecker.__checkTuple" ID="MiscellaneousChecker.__checkTuple"></a> 1966 <a NAME="MiscellaneousChecker.__checkTuple" ID="MiscellaneousChecker.__checkTuple"></a>
1968 <h4>MiscellaneousChecker.__checkTuple</h4> 1967 <h4>MiscellaneousChecker.__checkTuple</h4>
1969 <b>__checkTuple</b>(<i></i>) 1968 <b>__checkTuple</b>(<i></i>)
1970
1971 <p> 1969 <p>
1972 Private method to check for one element tuples. 1970 Private method to check for one element tuples.
1973 </p> 1971 </p>
1972
1974 <a NAME="MiscellaneousChecker.__dictShouldBeChecked" ID="MiscellaneousChecker.__dictShouldBeChecked"></a> 1973 <a NAME="MiscellaneousChecker.__dictShouldBeChecked" ID="MiscellaneousChecker.__dictShouldBeChecked"></a>
1975 <h4>MiscellaneousChecker.__dictShouldBeChecked</h4> 1974 <h4>MiscellaneousChecker.__dictShouldBeChecked</h4>
1976 <b>__dictShouldBeChecked</b>(<i>node</i>) 1975 <b>__dictShouldBeChecked</b>(<i>node</i>)
1977
1978 <p> 1976 <p>
1979 Private function to test, if the node should be checked. 1977 Private function to test, if the node should be checked.
1980 </p> 1978 </p>
1979
1981 <dl> 1980 <dl>
1982 1981
1983 <dt><i>node</i> (ast.Dict)</dt> 1982 <dt><i>node</i> (ast.Dict)</dt>
1984 <dd> 1983 <dd>
1985 reference to the AST node 1984 reference to the AST node
1998 </dd> 1997 </dd>
1999 </dl> 1998 </dl>
2000 <a NAME="MiscellaneousChecker.__error" ID="MiscellaneousChecker.__error"></a> 1999 <a NAME="MiscellaneousChecker.__error" ID="MiscellaneousChecker.__error"></a>
2001 <h4>MiscellaneousChecker.__error</h4> 2000 <h4>MiscellaneousChecker.__error</h4>
2002 <b>__error</b>(<i>lineNumber, offset, code, *args</i>) 2001 <b>__error</b>(<i>lineNumber, offset, code, *args</i>)
2003
2004 <p> 2002 <p>
2005 Private method to record an issue. 2003 Private method to record an issue.
2006 </p> 2004 </p>
2005
2007 <dl> 2006 <dl>
2008 2007
2009 <dt><i>lineNumber</i> (int)</dt> 2008 <dt><i>lineNumber</i> (int)</dt>
2010 <dd> 2009 <dd>
2011 line number of the issue 2010 line number of the issue
2024 </dd> 2023 </dd>
2025 </dl> 2024 </dl>
2026 <a NAME="MiscellaneousChecker.__getCoding" ID="MiscellaneousChecker.__getCoding"></a> 2025 <a NAME="MiscellaneousChecker.__getCoding" ID="MiscellaneousChecker.__getCoding"></a>
2027 <h4>MiscellaneousChecker.__getCoding</h4> 2026 <h4>MiscellaneousChecker.__getCoding</h4>
2028 <b>__getCoding</b>(<i></i>) 2027 <b>__getCoding</b>(<i></i>)
2029
2030 <p> 2028 <p>
2031 Private method to get the defined coding of the source. 2029 Private method to get the defined coding of the source.
2032 </p> 2030 </p>
2031
2033 <dl> 2032 <dl>
2034 <dt>Return:</dt> 2033 <dt>Return:</dt>
2035 <dd> 2034 <dd>
2036 tuple containing the line number and the coding 2035 tuple containing the line number and the coding
2037 </dd> 2036 </dd>
2043 </dd> 2042 </dd>
2044 </dl> 2043 </dl>
2045 <a NAME="MiscellaneousChecker.__getFields" ID="MiscellaneousChecker.__getFields"></a> 2044 <a NAME="MiscellaneousChecker.__getFields" ID="MiscellaneousChecker.__getFields"></a>
2046 <h4>MiscellaneousChecker.__getFields</h4> 2045 <h4>MiscellaneousChecker.__getFields</h4>
2047 <b>__getFields</b>(<i>string</i>) 2046 <b>__getFields</b>(<i>string</i>)
2048
2049 <p> 2047 <p>
2050 Private method to extract the format field information. 2048 Private method to extract the format field information.
2051 </p> 2049 </p>
2050
2052 <dl> 2051 <dl>
2053 2052
2054 <dt><i>string</i> (str)</dt> 2053 <dt><i>string</i> (str)</dt>
2055 <dd> 2054 <dd>
2056 format string to be parsed 2055 format string to be parsed
2070 </dd> 2069 </dd>
2071 </dl> 2070 </dl>
2072 <a NAME="MiscellaneousChecker.__ignoreCode" ID="MiscellaneousChecker.__ignoreCode"></a> 2071 <a NAME="MiscellaneousChecker.__ignoreCode" ID="MiscellaneousChecker.__ignoreCode"></a>
2073 <h4>MiscellaneousChecker.__ignoreCode</h4> 2072 <h4>MiscellaneousChecker.__ignoreCode</h4>
2074 <b>__ignoreCode</b>(<i>code</i>) 2073 <b>__ignoreCode</b>(<i>code</i>)
2075
2076 <p> 2074 <p>
2077 Private method to check if the message code should be ignored. 2075 Private method to check if the message code should be ignored.
2078 </p> 2076 </p>
2077
2079 <dl> 2078 <dl>
2080 2079
2081 <dt><i>code</i> (str)</dt> 2080 <dt><i>code</i> (str)</dt>
2082 <dd> 2081 <dd>
2083 message code to check for 2082 message code to check for
2096 </dd> 2095 </dd>
2097 </dl> 2096 </dl>
2098 <a NAME="MiscellaneousChecker.__isImplicitStringConcat" ID="MiscellaneousChecker.__isImplicitStringConcat"></a> 2097 <a NAME="MiscellaneousChecker.__isImplicitStringConcat" ID="MiscellaneousChecker.__isImplicitStringConcat"></a>
2099 <h4>MiscellaneousChecker.__isImplicitStringConcat</h4> 2098 <h4>MiscellaneousChecker.__isImplicitStringConcat</h4>
2100 <b>__isImplicitStringConcat</b>(<i>first, second</i>) 2099 <b>__isImplicitStringConcat</b>(<i>first, second</i>)
2101
2102 <p> 2100 <p>
2103 Private method to check, if the given strings indicate an implicit string 2101 Private method to check, if the given strings indicate an implicit string
2104 concatenation. 2102 concatenation.
2105 </p> 2103 </p>
2104
2106 <dl> 2105 <dl>
2107 2106
2108 <dt><i>first</i> (tuple)</dt> 2107 <dt><i>first</i> (tuple)</dt>
2109 <dd> 2108 <dd>
2110 first token 2109 first token
2127 </dd> 2126 </dd>
2128 </dl> 2127 </dl>
2129 <a NAME="MiscellaneousChecker.run" ID="MiscellaneousChecker.run"></a> 2128 <a NAME="MiscellaneousChecker.run" ID="MiscellaneousChecker.run"></a>
2130 <h4>MiscellaneousChecker.run</h4> 2129 <h4>MiscellaneousChecker.run</h4>
2131 <b>run</b>(<i></i>) 2130 <b>run</b>(<i></i>)
2132
2133 <p> 2131 <p>
2134 Public method to check the given source against miscellaneous 2132 Public method to check the given source against miscellaneous
2135 conditions. 2133 conditions.
2136 </p> 2134 </p>
2135
2137 <div align="right"><a href="#top">Up</a></div> 2136 <div align="right"><a href="#top">Up</a></div>
2138 <hr /> 2137 <hr />
2139 <hr /> 2138 <hr />
2140 <a NAME="NameFinder" ID="NameFinder"></a> 2139 <a NAME="NameFinder" ID="NameFinder"></a>
2141 <h2>NameFinder</h2> 2140 <h2>NameFinder</h2>
2142
2143 <p> 2141 <p>
2144 Class to extract a name out of a tree of nodes. 2142 Class to extract a name out of a tree of nodes.
2145 </p> 2143 </p>
2144
2146 <h3>Derived from</h3> 2145 <h3>Derived from</h3>
2147 ast.NodeVisitor 2146 ast.NodeVisitor
2148 <h3>Class Attributes</h3> 2147 <h3>Class Attributes</h3>
2149
2150 <table> 2148 <table>
2151 <tr><td>None</td></tr> 2149 <tr><td>None</td></tr>
2152 </table> 2150 </table>
2151
2153 <h3>Class Methods</h3> 2152 <h3>Class Methods</h3>
2154
2155 <table> 2153 <table>
2156 <tr><td>None</td></tr> 2154 <tr><td>None</td></tr>
2157 </table> 2155 </table>
2156
2158 <h3>Methods</h3> 2157 <h3>Methods</h3>
2159 2158 <table>
2160 <table>
2161
2162 <tr> 2159 <tr>
2163 <td><a href="#NameFinder.__init__">NameFinder</a></td> 2160 <td><a href="#NameFinder.__init__">NameFinder</a></td>
2164 <td>Constructor</td> 2161 <td>Constructor</td>
2165 </tr> 2162 </tr>
2166 <tr> 2163 <tr>
2174 <tr> 2171 <tr>
2175 <td><a href="#NameFinder.visit_Name">visit_Name</a></td> 2172 <td><a href="#NameFinder.visit_Name">visit_Name</a></td>
2176 <td>Public method to handle 'Name' nodes.</td> 2173 <td>Public method to handle 'Name' nodes.</td>
2177 </tr> 2174 </tr>
2178 </table> 2175 </table>
2176
2179 <h3>Static Methods</h3> 2177 <h3>Static Methods</h3>
2180
2181 <table> 2178 <table>
2182 <tr><td>None</td></tr> 2179 <tr><td>None</td></tr>
2183 </table> 2180 </table>
2181
2184 2182
2185 <a NAME="NameFinder.__init__" ID="NameFinder.__init__"></a> 2183 <a NAME="NameFinder.__init__" ID="NameFinder.__init__"></a>
2186 <h4>NameFinder (Constructor)</h4> 2184 <h4>NameFinder (Constructor)</h4>
2187 <b>NameFinder</b>(<i></i>) 2185 <b>NameFinder</b>(<i></i>)
2188
2189 <p> 2186 <p>
2190 Constructor 2187 Constructor
2191 </p> 2188 </p>
2189
2192 <a NAME="NameFinder.getNames" ID="NameFinder.getNames"></a> 2190 <a NAME="NameFinder.getNames" ID="NameFinder.getNames"></a>
2193 <h4>NameFinder.getNames</h4> 2191 <h4>NameFinder.getNames</h4>
2194 <b>getNames</b>(<i></i>) 2192 <b>getNames</b>(<i></i>)
2195
2196 <p> 2193 <p>
2197 Public method to return the extracted names and Name nodes. 2194 Public method to return the extracted names and Name nodes.
2198 </p> 2195 </p>
2196
2199 <dl> 2197 <dl>
2200 <dt>Return:</dt> 2198 <dt>Return:</dt>
2201 <dd> 2199 <dd>
2202 dictionary containing the names as keys and the list of nodes 2200 dictionary containing the names as keys and the list of nodes
2203 </dd> 2201 </dd>
2209 </dd> 2207 </dd>
2210 </dl> 2208 </dl>
2211 <a NAME="NameFinder.visit" ID="NameFinder.visit"></a> 2209 <a NAME="NameFinder.visit" ID="NameFinder.visit"></a>
2212 <h4>NameFinder.visit</h4> 2210 <h4>NameFinder.visit</h4>
2213 <b>visit</b>(<i>node</i>) 2211 <b>visit</b>(<i>node</i>)
2214
2215 <p> 2212 <p>
2216 Public method to traverse a given AST node. 2213 Public method to traverse a given AST node.
2217 </p> 2214 </p>
2215
2218 <dl> 2216 <dl>
2219 2217
2220 <dt><i>node</i> (ast.Node)</dt> 2218 <dt><i>node</i> (ast.Node)</dt>
2221 <dd> 2219 <dd>
2222 AST node to be traversed 2220 AST node to be traversed
2235 </dd> 2233 </dd>
2236 </dl> 2234 </dl>
2237 <a NAME="NameFinder.visit_Name" ID="NameFinder.visit_Name"></a> 2235 <a NAME="NameFinder.visit_Name" ID="NameFinder.visit_Name"></a>
2238 <h4>NameFinder.visit_Name</h4> 2236 <h4>NameFinder.visit_Name</h4>
2239 <b>visit_Name</b>(<i>node</i>) 2237 <b>visit_Name</b>(<i>node</i>)
2240
2241 <p> 2238 <p>
2242 Public method to handle 'Name' nodes. 2239 Public method to handle 'Name' nodes.
2243 </p> 2240 </p>
2241
2244 <dl> 2242 <dl>
2245 2243
2246 <dt><i>node</i> (ast.Name)</dt> 2244 <dt><i>node</i> (ast.Name)</dt>
2247 <dd> 2245 <dd>
2248 reference to the node to be processed 2246 reference to the node to be processed
2251 <div align="right"><a href="#top">Up</a></div> 2249 <div align="right"><a href="#top">Up</a></div>
2252 <hr /> 2250 <hr />
2253 <hr /> 2251 <hr />
2254 <a NAME="ReturnVisitor" ID="ReturnVisitor"></a> 2252 <a NAME="ReturnVisitor" ID="ReturnVisitor"></a>
2255 <h2>ReturnVisitor</h2> 2253 <h2>ReturnVisitor</h2>
2256
2257 <p> 2254 <p>
2258 Class implementing a node visitor to check return statements. 2255 Class implementing a node visitor to check return statements.
2259 </p> 2256 </p>
2257
2260 <h3>Derived from</h3> 2258 <h3>Derived from</h3>
2261 ast.NodeVisitor 2259 ast.NodeVisitor
2262 <h3>Class Attributes</h3> 2260 <h3>Class Attributes</h3>
2263 2261 <table>
2264 <table> 2262 <tr><td>Assigns</td></tr>
2265 <tr><td>Assigns</td></tr><tr><td>Refs</td></tr><tr><td>Returns</td></tr> 2263 <tr><td>Refs</td></tr>
2266 </table> 2264 <tr><td>Returns</td></tr>
2265 </table>
2266
2267 <h3>Class Methods</h3> 2267 <h3>Class Methods</h3>
2268
2269 <table> 2268 <table>
2270 <tr><td>None</td></tr> 2269 <tr><td>None</td></tr>
2271 </table> 2270 </table>
2271
2272 <h3>Methods</h3> 2272 <h3>Methods</h3>
2273 2273 <table>
2274 <table>
2275
2276 <tr> 2274 <tr>
2277 <td><a href="#ReturnVisitor.__init__">ReturnVisitor</a></td> 2275 <td><a href="#ReturnVisitor.__init__">ReturnVisitor</a></td>
2278 <td>Constructor</td> 2276 <td>Constructor</td>
2279 </tr> 2277 </tr>
2280 <tr> 2278 <tr>
2368 <tr> 2366 <tr>
2369 <td><a href="#ReturnVisitor.visit_While">visit_While</a></td> 2367 <td><a href="#ReturnVisitor.visit_While">visit_While</a></td>
2370 <td>Public method to handle a while loop.</td> 2368 <td>Public method to handle a while loop.</td>
2371 </tr> 2369 </tr>
2372 </table> 2370 </table>
2371
2373 <h3>Static Methods</h3> 2372 <h3>Static Methods</h3>
2374
2375 <table> 2373 <table>
2376 <tr><td>None</td></tr> 2374 <tr><td>None</td></tr>
2377 </table> 2375 </table>
2376
2378 2377
2379 <a NAME="ReturnVisitor.__init__" ID="ReturnVisitor.__init__"></a> 2378 <a NAME="ReturnVisitor.__init__" ID="ReturnVisitor.__init__"></a>
2380 <h4>ReturnVisitor (Constructor)</h4> 2379 <h4>ReturnVisitor (Constructor)</h4>
2381 <b>ReturnVisitor</b>(<i></i>) 2380 <b>ReturnVisitor</b>(<i></i>)
2382
2383 <p> 2381 <p>
2384 Constructor 2382 Constructor
2385 </p> 2383 </p>
2384
2386 <a NAME="ReturnVisitor.__checkFunction" ID="ReturnVisitor.__checkFunction"></a> 2385 <a NAME="ReturnVisitor.__checkFunction" ID="ReturnVisitor.__checkFunction"></a>
2387 <h4>ReturnVisitor.__checkFunction</h4> 2386 <h4>ReturnVisitor.__checkFunction</h4>
2388 <b>__checkFunction</b>(<i>node</i>) 2387 <b>__checkFunction</b>(<i>node</i>)
2389
2390 <p> 2388 <p>
2391 Private method to check a function definition node. 2389 Private method to check a function definition node.
2392 </p> 2390 </p>
2391
2393 <dl> 2392 <dl>
2394 2393
2395 <dt><i>node</i> (ast.AsyncFunctionDef or ast.FunctionDef)</dt> 2394 <dt><i>node</i> (ast.AsyncFunctionDef or ast.FunctionDef)</dt>
2396 <dd> 2395 <dd>
2397 reference to the node to check 2396 reference to the node to check
2398 </dd> 2397 </dd>
2399 </dl> 2398 </dl>
2400 <a NAME="ReturnVisitor.__checkImplicitReturn" ID="ReturnVisitor.__checkImplicitReturn"></a> 2399 <a NAME="ReturnVisitor.__checkImplicitReturn" ID="ReturnVisitor.__checkImplicitReturn"></a>
2401 <h4>ReturnVisitor.__checkImplicitReturn</h4> 2400 <h4>ReturnVisitor.__checkImplicitReturn</h4>
2402 <b>__checkImplicitReturn</b>(<i>node</i>) 2401 <b>__checkImplicitReturn</b>(<i>node</i>)
2403
2404 <p> 2402 <p>
2405 Private method to check for an implicit return statement. 2403 Private method to check for an implicit return statement.
2406 </p> 2404 </p>
2405
2407 <dl> 2406 <dl>
2408 2407
2409 <dt><i>node</i> (ast.AST)</dt> 2408 <dt><i>node</i> (ast.AST)</dt>
2410 <dd> 2409 <dd>
2411 reference to the node to check 2410 reference to the node to check
2412 </dd> 2411 </dd>
2413 </dl> 2412 </dl>
2414 <a NAME="ReturnVisitor.__checkImplicitReturnValue" ID="ReturnVisitor.__checkImplicitReturnValue"></a> 2413 <a NAME="ReturnVisitor.__checkImplicitReturnValue" ID="ReturnVisitor.__checkImplicitReturnValue"></a>
2415 <h4>ReturnVisitor.__checkImplicitReturnValue</h4> 2414 <h4>ReturnVisitor.__checkImplicitReturnValue</h4>
2416 <b>__checkImplicitReturnValue</b>(<i></i>) 2415 <b>__checkImplicitReturnValue</b>(<i></i>)
2417
2418 <p> 2416 <p>
2419 Private method to check for implicit return values. 2417 Private method to check for implicit return values.
2420 </p> 2418 </p>
2419
2421 <a NAME="ReturnVisitor.__checkUnnecessaryAssign" ID="ReturnVisitor.__checkUnnecessaryAssign"></a> 2420 <a NAME="ReturnVisitor.__checkUnnecessaryAssign" ID="ReturnVisitor.__checkUnnecessaryAssign"></a>
2422 <h4>ReturnVisitor.__checkUnnecessaryAssign</h4> 2421 <h4>ReturnVisitor.__checkUnnecessaryAssign</h4>
2423 <b>__checkUnnecessaryAssign</b>(<i>node</i>) 2422 <b>__checkUnnecessaryAssign</b>(<i>node</i>)
2424
2425 <p> 2423 <p>
2426 Private method to check for an unnecessary assign statement. 2424 Private method to check for an unnecessary assign statement.
2427 </p> 2425 </p>
2426
2428 <dl> 2427 <dl>
2429 2428
2430 <dt><i>node</i> (ast.AST)</dt> 2429 <dt><i>node</i> (ast.AST)</dt>
2431 <dd> 2430 <dd>
2432 reference to the node to check 2431 reference to the node to check
2433 </dd> 2432 </dd>
2434 </dl> 2433 </dl>
2435 <a NAME="ReturnVisitor.__checkUnnecessaryReturnNone" ID="ReturnVisitor.__checkUnnecessaryReturnNone"></a> 2434 <a NAME="ReturnVisitor.__checkUnnecessaryReturnNone" ID="ReturnVisitor.__checkUnnecessaryReturnNone"></a>
2436 <h4>ReturnVisitor.__checkUnnecessaryReturnNone</h4> 2435 <h4>ReturnVisitor.__checkUnnecessaryReturnNone</h4>
2437 <b>__checkUnnecessaryReturnNone</b>(<i></i>) 2436 <b>__checkUnnecessaryReturnNone</b>(<i></i>)
2438
2439 <p> 2437 <p>
2440 Private method to check for an unnecessary 'return None' statement. 2438 Private method to check for an unnecessary 'return None' statement.
2441 </p> 2439 </p>
2440
2442 <a NAME="ReturnVisitor.__hasRefsBeforeNextAssign" ID="ReturnVisitor.__hasRefsBeforeNextAssign"></a> 2441 <a NAME="ReturnVisitor.__hasRefsBeforeNextAssign" ID="ReturnVisitor.__hasRefsBeforeNextAssign"></a>
2443 <h4>ReturnVisitor.__hasRefsBeforeNextAssign</h4> 2442 <h4>ReturnVisitor.__hasRefsBeforeNextAssign</h4>
2444 <b>__hasRefsBeforeNextAssign</b>(<i>varname, returnLineno</i>) 2443 <b>__hasRefsBeforeNextAssign</b>(<i>varname, returnLineno</i>)
2445
2446 <p> 2444 <p>
2447 Private method to check for references before a following assign 2445 Private method to check for references before a following assign
2448 statement. 2446 statement.
2449 </p> 2447 </p>
2448
2450 <dl> 2449 <dl>
2451 2450
2452 <dt><i>varname</i> (str)</dt> 2451 <dt><i>varname</i> (str)</dt>
2453 <dd> 2452 <dd>
2454 variable name to check for 2453 variable name to check for
2471 </dd> 2470 </dd>
2472 </dl> 2471 </dl>
2473 <a NAME="ReturnVisitor.__isFalse" ID="ReturnVisitor.__isFalse"></a> 2472 <a NAME="ReturnVisitor.__isFalse" ID="ReturnVisitor.__isFalse"></a>
2474 <h4>ReturnVisitor.__isFalse</h4> 2473 <h4>ReturnVisitor.__isFalse</h4>
2475 <b>__isFalse</b>(<i>node</i>) 2474 <b>__isFalse</b>(<i>node</i>)
2476
2477 <p> 2475 <p>
2478 Private method to check, if a node value is False. 2476 Private method to check, if a node value is False.
2479 </p> 2477 </p>
2478
2480 <dl> 2479 <dl>
2481 2480
2482 <dt><i>node</i> (ast.AST)</dt> 2481 <dt><i>node</i> (ast.AST)</dt>
2483 <dd> 2482 <dd>
2484 reference to the node to check 2483 reference to the node to check
2497 </dd> 2496 </dd>
2498 </dl> 2497 </dl>
2499 <a NAME="ReturnVisitor.__isNone" ID="ReturnVisitor.__isNone"></a> 2498 <a NAME="ReturnVisitor.__isNone" ID="ReturnVisitor.__isNone"></a>
2500 <h4>ReturnVisitor.__isNone</h4> 2499 <h4>ReturnVisitor.__isNone</h4>
2501 <b>__isNone</b>(<i>node</i>) 2500 <b>__isNone</b>(<i>node</i>)
2502
2503 <p> 2501 <p>
2504 Private method to check, if a node value is None. 2502 Private method to check, if a node value is None.
2505 </p> 2503 </p>
2504
2506 <dl> 2505 <dl>
2507 2506
2508 <dt><i>node</i> (ast.AST)</dt> 2507 <dt><i>node</i> (ast.AST)</dt>
2509 <dd> 2508 <dd>
2510 reference to the node to check 2509 reference to the node to check
2523 </dd> 2522 </dd>
2524 </dl> 2523 </dl>
2525 <a NAME="ReturnVisitor.__resultExists" ID="ReturnVisitor.__resultExists"></a> 2524 <a NAME="ReturnVisitor.__resultExists" ID="ReturnVisitor.__resultExists"></a>
2526 <h4>ReturnVisitor.__resultExists</h4> 2525 <h4>ReturnVisitor.__resultExists</h4>
2527 <b>__resultExists</b>(<i></i>) 2526 <b>__resultExists</b>(<i></i>)
2528
2529 <p> 2527 <p>
2530 Private method to check the existance of a return result. 2528 Private method to check the existance of a return result.
2531 </p> 2529 </p>
2530
2532 <dl> 2531 <dl>
2533 <dt>Return:</dt> 2532 <dt>Return:</dt>
2534 <dd> 2533 <dd>
2535 flag indicating the existence of a return result 2534 flag indicating the existence of a return result
2536 </dd> 2535 </dd>
2542 </dd> 2541 </dd>
2543 </dl> 2542 </dl>
2544 <a NAME="ReturnVisitor.__visitAssignTarget" ID="ReturnVisitor.__visitAssignTarget"></a> 2543 <a NAME="ReturnVisitor.__visitAssignTarget" ID="ReturnVisitor.__visitAssignTarget"></a>
2545 <h4>ReturnVisitor.__visitAssignTarget</h4> 2544 <h4>ReturnVisitor.__visitAssignTarget</h4>
2546 <b>__visitAssignTarget</b>(<i>node</i>) 2545 <b>__visitAssignTarget</b>(<i>node</i>)
2547
2548 <p> 2546 <p>
2549 Private method to handle an assign target node. 2547 Private method to handle an assign target node.
2550 </p> 2548 </p>
2549
2551 <dl> 2550 <dl>
2552 2551
2553 <dt><i>node</i> (ast.AST)</dt> 2552 <dt><i>node</i> (ast.AST)</dt>
2554 <dd> 2553 <dd>
2555 reference to the node to handle 2554 reference to the node to handle
2556 </dd> 2555 </dd>
2557 </dl> 2556 </dl>
2558 <a NAME="ReturnVisitor.__visitLoop" ID="ReturnVisitor.__visitLoop"></a> 2557 <a NAME="ReturnVisitor.__visitLoop" ID="ReturnVisitor.__visitLoop"></a>
2559 <h4>ReturnVisitor.__visitLoop</h4> 2558 <h4>ReturnVisitor.__visitLoop</h4>
2560 <b>__visitLoop</b>(<i>node</i>) 2559 <b>__visitLoop</b>(<i>node</i>)
2561
2562 <p> 2560 <p>
2563 Private method to handle loop nodes. 2561 Private method to handle loop nodes.
2564 </p> 2562 </p>
2563
2565 <dl> 2564 <dl>
2566 2565
2567 <dt><i>node</i> (ast.For, ast.AsyncFor or ast.While)</dt> 2566 <dt><i>node</i> (ast.For, ast.AsyncFor or ast.While)</dt>
2568 <dd> 2567 <dd>
2569 reference to the loop node to handle 2568 reference to the loop node to handle
2570 </dd> 2569 </dd>
2571 </dl> 2570 </dl>
2572 <a NAME="ReturnVisitor.__visitWithStack" ID="ReturnVisitor.__visitWithStack"></a> 2571 <a NAME="ReturnVisitor.__visitWithStack" ID="ReturnVisitor.__visitWithStack"></a>
2573 <h4>ReturnVisitor.__visitWithStack</h4> 2572 <h4>ReturnVisitor.__visitWithStack</h4>
2574 <b>__visitWithStack</b>(<i>node</i>) 2573 <b>__visitWithStack</b>(<i>node</i>)
2575
2576 <p> 2574 <p>
2577 Private method to traverse a given function node using a stack. 2575 Private method to traverse a given function node using a stack.
2578 </p> 2576 </p>
2577
2579 <dl> 2578 <dl>
2580 2579
2581 <dt><i>node</i> (ast.FunctionDef or ast.AsyncFunctionDef)</dt> 2580 <dt><i>node</i> (ast.FunctionDef or ast.AsyncFunctionDef)</dt>
2582 <dd> 2581 <dd>
2583 AST node to be traversed 2582 AST node to be traversed
2584 </dd> 2583 </dd>
2585 </dl> 2584 </dl>
2586 <a NAME="ReturnVisitor.assigns" ID="ReturnVisitor.assigns"></a> 2585 <a NAME="ReturnVisitor.assigns" ID="ReturnVisitor.assigns"></a>
2587 <h4>ReturnVisitor.assigns</h4> 2586 <h4>ReturnVisitor.assigns</h4>
2588 <b>assigns</b>(<i></i>) 2587 <b>assigns</b>(<i></i>)
2589
2590 <p> 2588 <p>
2591 Public method to get the Assign nodes. 2589 Public method to get the Assign nodes.
2592 </p> 2590 </p>
2591
2593 <dl> 2592 <dl>
2594 <dt>Return:</dt> 2593 <dt>Return:</dt>
2595 <dd> 2594 <dd>
2596 dictionary containing the node name as key and line number 2595 dictionary containing the node name as key and line number
2597 as value 2596 as value
2604 </dd> 2603 </dd>
2605 </dl> 2604 </dl>
2606 <a NAME="ReturnVisitor.refs" ID="ReturnVisitor.refs"></a> 2605 <a NAME="ReturnVisitor.refs" ID="ReturnVisitor.refs"></a>
2607 <h4>ReturnVisitor.refs</h4> 2606 <h4>ReturnVisitor.refs</h4>
2608 <b>refs</b>(<i></i>) 2607 <b>refs</b>(<i></i>)
2609
2610 <p> 2608 <p>
2611 Public method to get the References nodes. 2609 Public method to get the References nodes.
2612 </p> 2610 </p>
2611
2613 <dl> 2612 <dl>
2614 <dt>Return:</dt> 2613 <dt>Return:</dt>
2615 <dd> 2614 <dd>
2616 dictionary containing the node name as key and line number 2615 dictionary containing the node name as key and line number
2617 as value 2616 as value
2624 </dd> 2623 </dd>
2625 </dl> 2624 </dl>
2626 <a NAME="ReturnVisitor.returns" ID="ReturnVisitor.returns"></a> 2625 <a NAME="ReturnVisitor.returns" ID="ReturnVisitor.returns"></a>
2627 <h4>ReturnVisitor.returns</h4> 2626 <h4>ReturnVisitor.returns</h4>
2628 <b>returns</b>(<i></i>) 2627 <b>returns</b>(<i></i>)
2629
2630 <p> 2628 <p>
2631 Public method to get the Return nodes. 2629 Public method to get the Return nodes.
2632 </p> 2630 </p>
2631
2633 <dl> 2632 <dl>
2634 <dt>Return:</dt> 2633 <dt>Return:</dt>
2635 <dd> 2634 <dd>
2636 dictionary containing the node name as key and line number 2635 dictionary containing the node name as key and line number
2637 as value 2636 as value
2644 </dd> 2643 </dd>
2645 </dl> 2644 </dl>
2646 <a NAME="ReturnVisitor.visit_Assign" ID="ReturnVisitor.visit_Assign"></a> 2645 <a NAME="ReturnVisitor.visit_Assign" ID="ReturnVisitor.visit_Assign"></a>
2647 <h4>ReturnVisitor.visit_Assign</h4> 2646 <h4>ReturnVisitor.visit_Assign</h4>
2648 <b>visit_Assign</b>(<i>node</i>) 2647 <b>visit_Assign</b>(<i>node</i>)
2649
2650 <p> 2648 <p>
2651 Public method to handle an assign node. 2649 Public method to handle an assign node.
2652 </p> 2650 </p>
2651
2653 <dl> 2652 <dl>
2654 2653
2655 <dt><i>node</i> (ast.Assign)</dt> 2654 <dt><i>node</i> (ast.Assign)</dt>
2656 <dd> 2655 <dd>
2657 reference to the node to handle 2656 reference to the node to handle
2658 </dd> 2657 </dd>
2659 </dl> 2658 </dl>
2660 <a NAME="ReturnVisitor.visit_AsyncFor" ID="ReturnVisitor.visit_AsyncFor"></a> 2659 <a NAME="ReturnVisitor.visit_AsyncFor" ID="ReturnVisitor.visit_AsyncFor"></a>
2661 <h4>ReturnVisitor.visit_AsyncFor</h4> 2660 <h4>ReturnVisitor.visit_AsyncFor</h4>
2662 <b>visit_AsyncFor</b>(<i>node</i>) 2661 <b>visit_AsyncFor</b>(<i>node</i>)
2663
2664 <p> 2662 <p>
2665 Public method to handle an async for loop. 2663 Public method to handle an async for loop.
2666 </p> 2664 </p>
2665
2667 <dl> 2666 <dl>
2668 2667
2669 <dt><i>node</i> (ast.AsyncFor)</dt> 2668 <dt><i>node</i> (ast.AsyncFor)</dt>
2670 <dd> 2669 <dd>
2671 reference to the async for node to handle 2670 reference to the async for node to handle
2672 </dd> 2671 </dd>
2673 </dl> 2672 </dl>
2674 <a NAME="ReturnVisitor.visit_AsyncFunctionDef" ID="ReturnVisitor.visit_AsyncFunctionDef"></a> 2673 <a NAME="ReturnVisitor.visit_AsyncFunctionDef" ID="ReturnVisitor.visit_AsyncFunctionDef"></a>
2675 <h4>ReturnVisitor.visit_AsyncFunctionDef</h4> 2674 <h4>ReturnVisitor.visit_AsyncFunctionDef</h4>
2676 <b>visit_AsyncFunctionDef</b>(<i>node</i>) 2675 <b>visit_AsyncFunctionDef</b>(<i>node</i>)
2677
2678 <p> 2676 <p>
2679 Public method to handle a function definition. 2677 Public method to handle a function definition.
2680 </p> 2678 </p>
2679
2681 <dl> 2680 <dl>
2682 2681
2683 <dt><i>node</i> (ast.AsyncFunctionDef)</dt> 2682 <dt><i>node</i> (ast.AsyncFunctionDef)</dt>
2684 <dd> 2683 <dd>
2685 reference to the node to handle 2684 reference to the node to handle
2686 </dd> 2685 </dd>
2687 </dl> 2686 </dl>
2688 <a NAME="ReturnVisitor.visit_For" ID="ReturnVisitor.visit_For"></a> 2687 <a NAME="ReturnVisitor.visit_For" ID="ReturnVisitor.visit_For"></a>
2689 <h4>ReturnVisitor.visit_For</h4> 2688 <h4>ReturnVisitor.visit_For</h4>
2690 <b>visit_For</b>(<i>node</i>) 2689 <b>visit_For</b>(<i>node</i>)
2691
2692 <p> 2690 <p>
2693 Public method to handle a for loop. 2691 Public method to handle a for loop.
2694 </p> 2692 </p>
2693
2695 <dl> 2694 <dl>
2696 2695
2697 <dt><i>node</i> (ast.For)</dt> 2696 <dt><i>node</i> (ast.For)</dt>
2698 <dd> 2697 <dd>
2699 reference to the for node to handle 2698 reference to the for node to handle
2700 </dd> 2699 </dd>
2701 </dl> 2700 </dl>
2702 <a NAME="ReturnVisitor.visit_FunctionDef" ID="ReturnVisitor.visit_FunctionDef"></a> 2701 <a NAME="ReturnVisitor.visit_FunctionDef" ID="ReturnVisitor.visit_FunctionDef"></a>
2703 <h4>ReturnVisitor.visit_FunctionDef</h4> 2702 <h4>ReturnVisitor.visit_FunctionDef</h4>
2704 <b>visit_FunctionDef</b>(<i>node</i>) 2703 <b>visit_FunctionDef</b>(<i>node</i>)
2705
2706 <p> 2704 <p>
2707 Public method to handle a function definition. 2705 Public method to handle a function definition.
2708 </p> 2706 </p>
2707
2709 <dl> 2708 <dl>
2710 2709
2711 <dt><i>node</i> (ast.FunctionDef)</dt> 2710 <dt><i>node</i> (ast.FunctionDef)</dt>
2712 <dd> 2711 <dd>
2713 reference to the node to handle 2712 reference to the node to handle
2714 </dd> 2713 </dd>
2715 </dl> 2714 </dl>
2716 <a NAME="ReturnVisitor.visit_Name" ID="ReturnVisitor.visit_Name"></a> 2715 <a NAME="ReturnVisitor.visit_Name" ID="ReturnVisitor.visit_Name"></a>
2717 <h4>ReturnVisitor.visit_Name</h4> 2716 <h4>ReturnVisitor.visit_Name</h4>
2718 <b>visit_Name</b>(<i>node</i>) 2717 <b>visit_Name</b>(<i>node</i>)
2719
2720 <p> 2718 <p>
2721 Public method to handle a name node. 2719 Public method to handle a name node.
2722 </p> 2720 </p>
2721
2723 <dl> 2722 <dl>
2724 2723
2725 <dt><i>node</i> (ast.Name)</dt> 2724 <dt><i>node</i> (ast.Name)</dt>
2726 <dd> 2725 <dd>
2727 reference to the node to handle 2726 reference to the node to handle
2728 </dd> 2727 </dd>
2729 </dl> 2728 </dl>
2730 <a NAME="ReturnVisitor.visit_Return" ID="ReturnVisitor.visit_Return"></a> 2729 <a NAME="ReturnVisitor.visit_Return" ID="ReturnVisitor.visit_Return"></a>
2731 <h4>ReturnVisitor.visit_Return</h4> 2730 <h4>ReturnVisitor.visit_Return</h4>
2732 <b>visit_Return</b>(<i>node</i>) 2731 <b>visit_Return</b>(<i>node</i>)
2733
2734 <p> 2732 <p>
2735 Public method to handle a return node. 2733 Public method to handle a return node.
2736 </p> 2734 </p>
2735
2737 <dl> 2736 <dl>
2738 2737
2739 <dt><i>node</i> (ast.Return)</dt> 2738 <dt><i>node</i> (ast.Return)</dt>
2740 <dd> 2739 <dd>
2741 reference to the node to handle 2740 reference to the node to handle
2742 </dd> 2741 </dd>
2743 </dl> 2742 </dl>
2744 <a NAME="ReturnVisitor.visit_While" ID="ReturnVisitor.visit_While"></a> 2743 <a NAME="ReturnVisitor.visit_While" ID="ReturnVisitor.visit_While"></a>
2745 <h4>ReturnVisitor.visit_While</h4> 2744 <h4>ReturnVisitor.visit_While</h4>
2746 <b>visit_While</b>(<i>node</i>) 2745 <b>visit_While</b>(<i>node</i>)
2747
2748 <p> 2746 <p>
2749 Public method to handle a while loop. 2747 Public method to handle a while loop.
2750 </p> 2748 </p>
2749
2751 <dl> 2750 <dl>
2752 2751
2753 <dt><i>node</i> (ast.While)</dt> 2752 <dt><i>node</i> (ast.While)</dt>
2754 <dd> 2753 <dd>
2755 reference to the while node to handle 2754 reference to the while node to handle
2758 <div align="right"><a href="#top">Up</a></div> 2757 <div align="right"><a href="#top">Up</a></div>
2759 <hr /> 2758 <hr />
2760 <hr /> 2759 <hr />
2761 <a NAME="SysVersionVisitor" ID="SysVersionVisitor"></a> 2760 <a NAME="SysVersionVisitor" ID="SysVersionVisitor"></a>
2762 <h2>SysVersionVisitor</h2> 2761 <h2>SysVersionVisitor</h2>
2763
2764 <p> 2762 <p>
2765 Class implementing a node visitor to check the use of sys.version and 2763 Class implementing a node visitor to check the use of sys.version and
2766 sys.version_info. 2764 sys.version_info.
2767 </p> 2765 </p>
2768 <p> 2766 <p>
2769 Note: This class is modeled after flake8-2020 checker. 2767 Note: This class is modeled after flake8-2020 checker.
2770 </p> 2768 </p>
2769
2771 <h3>Derived from</h3> 2770 <h3>Derived from</h3>
2772 ast.NodeVisitor 2771 ast.NodeVisitor
2773 <h3>Class Attributes</h3> 2772 <h3>Class Attributes</h3>
2774
2775 <table> 2773 <table>
2776 <tr><td>None</td></tr> 2774 <tr><td>None</td></tr>
2777 </table> 2775 </table>
2776
2778 <h3>Class Methods</h3> 2777 <h3>Class Methods</h3>
2779
2780 <table> 2778 <table>
2781 <tr><td>None</td></tr> 2779 <tr><td>None</td></tr>
2782 </table> 2780 </table>
2781
2783 <h3>Methods</h3> 2782 <h3>Methods</h3>
2784 2783 <table>
2785 <table>
2786
2787 <tr> 2784 <tr>
2788 <td><a href="#SysVersionVisitor.__init__">SysVersionVisitor</a></td> 2785 <td><a href="#SysVersionVisitor.__init__">SysVersionVisitor</a></td>
2789 <td>Constructor</td> 2786 <td>Constructor</td>
2790 </tr> 2787 </tr>
2791 <tr> 2788 <tr>
2815 <tr> 2812 <tr>
2816 <td><a href="#SysVersionVisitor.visit_Subscript">visit_Subscript</a></td> 2813 <td><a href="#SysVersionVisitor.visit_Subscript">visit_Subscript</a></td>
2817 <td>Public method to handle a subscript.</td> 2814 <td>Public method to handle a subscript.</td>
2818 </tr> 2815 </tr>
2819 </table> 2816 </table>
2817
2820 <h3>Static Methods</h3> 2818 <h3>Static Methods</h3>
2821
2822 <table> 2819 <table>
2823 <tr><td>None</td></tr> 2820 <tr><td>None</td></tr>
2824 </table> 2821 </table>
2822
2825 2823
2826 <a NAME="SysVersionVisitor.__init__" ID="SysVersionVisitor.__init__"></a> 2824 <a NAME="SysVersionVisitor.__init__" ID="SysVersionVisitor.__init__"></a>
2827 <h4>SysVersionVisitor (Constructor)</h4> 2825 <h4>SysVersionVisitor (Constructor)</h4>
2828 <b>SysVersionVisitor</b>(<i></i>) 2826 <b>SysVersionVisitor</b>(<i></i>)
2829
2830 <p> 2827 <p>
2831 Constructor 2828 Constructor
2832 </p> 2829 </p>
2830
2833 <a NAME="SysVersionVisitor.__isSys" ID="SysVersionVisitor.__isSys"></a> 2831 <a NAME="SysVersionVisitor.__isSys" ID="SysVersionVisitor.__isSys"></a>
2834 <h4>SysVersionVisitor.__isSys</h4> 2832 <h4>SysVersionVisitor.__isSys</h4>
2835 <b>__isSys</b>(<i>attr, node</i>) 2833 <b>__isSys</b>(<i>attr, node</i>)
2836
2837 <p> 2834 <p>
2838 Private method to check for a reference to sys attribute. 2835 Private method to check for a reference to sys attribute.
2839 </p> 2836 </p>
2837
2840 <dl> 2838 <dl>
2841 2839
2842 <dt><i>attr</i> (str)</dt> 2840 <dt><i>attr</i> (str)</dt>
2843 <dd> 2841 <dd>
2844 attribute name 2842 attribute name
2861 </dd> 2859 </dd>
2862 </dl> 2860 </dl>
2863 <a NAME="SysVersionVisitor.__isSysVersionUpperSlice" ID="SysVersionVisitor.__isSysVersionUpperSlice"></a> 2861 <a NAME="SysVersionVisitor.__isSysVersionUpperSlice" ID="SysVersionVisitor.__isSysVersionUpperSlice"></a>
2864 <h4>SysVersionVisitor.__isSysVersionUpperSlice</h4> 2862 <h4>SysVersionVisitor.__isSysVersionUpperSlice</h4>
2865 <b>__isSysVersionUpperSlice</b>(<i>node, n</i>) 2863 <b>__isSysVersionUpperSlice</b>(<i>node, n</i>)
2866
2867 <p> 2864 <p>
2868 Private method to check the upper slice of sys.version. 2865 Private method to check the upper slice of sys.version.
2869 </p> 2866 </p>
2867
2870 <dl> 2868 <dl>
2871 2869
2872 <dt><i>node</i> (ast.Node)</dt> 2870 <dt><i>node</i> (ast.Node)</dt>
2873 <dd> 2871 <dd>
2874 reference to the node to be checked 2872 reference to the node to be checked
2891 </dd> 2889 </dd>
2892 </dl> 2890 </dl>
2893 <a NAME="SysVersionVisitor.visit_Attribute" ID="SysVersionVisitor.visit_Attribute"></a> 2891 <a NAME="SysVersionVisitor.visit_Attribute" ID="SysVersionVisitor.visit_Attribute"></a>
2894 <h4>SysVersionVisitor.visit_Attribute</h4> 2892 <h4>SysVersionVisitor.visit_Attribute</h4>
2895 <b>visit_Attribute</b>(<i>node</i>) 2893 <b>visit_Attribute</b>(<i>node</i>)
2896
2897 <p> 2894 <p>
2898 Public method to handle an attribute. 2895 Public method to handle an attribute.
2899 </p> 2896 </p>
2897
2900 <dl> 2898 <dl>
2901 2899
2902 <dt><i>node</i> (ast.Attribute)</dt> 2900 <dt><i>node</i> (ast.Attribute)</dt>
2903 <dd> 2901 <dd>
2904 reference to the node to be processed 2902 reference to the node to be processed
2905 </dd> 2903 </dd>
2906 </dl> 2904 </dl>
2907 <a NAME="SysVersionVisitor.visit_Compare" ID="SysVersionVisitor.visit_Compare"></a> 2905 <a NAME="SysVersionVisitor.visit_Compare" ID="SysVersionVisitor.visit_Compare"></a>
2908 <h4>SysVersionVisitor.visit_Compare</h4> 2906 <h4>SysVersionVisitor.visit_Compare</h4>
2909 <b>visit_Compare</b>(<i>node</i>) 2907 <b>visit_Compare</b>(<i>node</i>)
2910
2911 <p> 2908 <p>
2912 Public method to handle a comparison. 2909 Public method to handle a comparison.
2913 </p> 2910 </p>
2911
2914 <dl> 2912 <dl>
2915 2913
2916 <dt><i>node</i> (ast.Compare)</dt> 2914 <dt><i>node</i> (ast.Compare)</dt>
2917 <dd> 2915 <dd>
2918 reference to the node to be processed 2916 reference to the node to be processed
2919 </dd> 2917 </dd>
2920 </dl> 2918 </dl>
2921 <a NAME="SysVersionVisitor.visit_ImportFrom" ID="SysVersionVisitor.visit_ImportFrom"></a> 2919 <a NAME="SysVersionVisitor.visit_ImportFrom" ID="SysVersionVisitor.visit_ImportFrom"></a>
2922 <h4>SysVersionVisitor.visit_ImportFrom</h4> 2920 <h4>SysVersionVisitor.visit_ImportFrom</h4>
2923 <b>visit_ImportFrom</b>(<i>node</i>) 2921 <b>visit_ImportFrom</b>(<i>node</i>)
2924
2925 <p> 2922 <p>
2926 Public method to handle a from ... import ... statement. 2923 Public method to handle a from ... import ... statement.
2927 </p> 2924 </p>
2925
2928 <dl> 2926 <dl>
2929 2927
2930 <dt><i>node</i> (ast.ImportFrom)</dt> 2928 <dt><i>node</i> (ast.ImportFrom)</dt>
2931 <dd> 2929 <dd>
2932 reference to the node to be processed 2930 reference to the node to be processed
2933 </dd> 2931 </dd>
2934 </dl> 2932 </dl>
2935 <a NAME="SysVersionVisitor.visit_Name" ID="SysVersionVisitor.visit_Name"></a> 2933 <a NAME="SysVersionVisitor.visit_Name" ID="SysVersionVisitor.visit_Name"></a>
2936 <h4>SysVersionVisitor.visit_Name</h4> 2934 <h4>SysVersionVisitor.visit_Name</h4>
2937 <b>visit_Name</b>(<i>node</i>) 2935 <b>visit_Name</b>(<i>node</i>)
2938
2939 <p> 2936 <p>
2940 Public method to handle an name. 2937 Public method to handle an name.
2941 </p> 2938 </p>
2939
2942 <dl> 2940 <dl>
2943 2941
2944 <dt><i>node</i> (ast.Name)</dt> 2942 <dt><i>node</i> (ast.Name)</dt>
2945 <dd> 2943 <dd>
2946 reference to the node to be processed 2944 reference to the node to be processed
2947 </dd> 2945 </dd>
2948 </dl> 2946 </dl>
2949 <a NAME="SysVersionVisitor.visit_Subscript" ID="SysVersionVisitor.visit_Subscript"></a> 2947 <a NAME="SysVersionVisitor.visit_Subscript" ID="SysVersionVisitor.visit_Subscript"></a>
2950 <h4>SysVersionVisitor.visit_Subscript</h4> 2948 <h4>SysVersionVisitor.visit_Subscript</h4>
2951 <b>visit_Subscript</b>(<i>node</i>) 2949 <b>visit_Subscript</b>(<i>node</i>)
2952
2953 <p> 2950 <p>
2954 Public method to handle a subscript. 2951 Public method to handle a subscript.
2955 </p> 2952 </p>
2953
2956 <dl> 2954 <dl>
2957 2955
2958 <dt><i>node</i> (ast.Subscript)</dt> 2956 <dt><i>node</i> (ast.Subscript)</dt>
2959 <dd> 2957 <dd>
2960 reference to the node to be processed 2958 reference to the node to be processed
2963 <div align="right"><a href="#top">Up</a></div> 2961 <div align="right"><a href="#top">Up</a></div>
2964 <hr /> 2962 <hr />
2965 <hr /> 2963 <hr />
2966 <a NAME="TextVisitor" ID="TextVisitor"></a> 2964 <a NAME="TextVisitor" ID="TextVisitor"></a>
2967 <h2>TextVisitor</h2> 2965 <h2>TextVisitor</h2>
2968
2969 <p> 2966 <p>
2970 Class implementing a node visitor for bytes and str instances. 2967 Class implementing a node visitor for bytes and str instances.
2971 </p> 2968 </p>
2972 <p> 2969 <p>
2973 It tries to detect docstrings as string of the first expression of each 2970 It tries to detect docstrings as string of the first expression of each
2974 module, class or function. 2971 module, class or function.
2975 </p> 2972 </p>
2973
2976 <h3>Derived from</h3> 2974 <h3>Derived from</h3>
2977 ast.NodeVisitor 2975 ast.NodeVisitor
2978 <h3>Class Attributes</h3> 2976 <h3>Class Attributes</h3>
2979
2980 <table> 2977 <table>
2981 <tr><td>None</td></tr> 2978 <tr><td>None</td></tr>
2982 </table> 2979 </table>
2980
2983 <h3>Class Methods</h3> 2981 <h3>Class Methods</h3>
2984
2985 <table> 2982 <table>
2986 <tr><td>None</td></tr> 2983 <tr><td>None</td></tr>
2987 </table> 2984 </table>
2985
2988 <h3>Methods</h3> 2986 <h3>Methods</h3>
2989 2987 <table>
2990 <table>
2991
2992 <tr> 2988 <tr>
2993 <td><a href="#TextVisitor.__init__">TextVisitor</a></td> 2989 <td><a href="#TextVisitor.__init__">TextVisitor</a></td>
2994 <td>Constructor</td> 2990 <td>Constructor</td>
2995 </tr> 2991 </tr>
2996 <tr> 2992 <tr>
3028 <tr> 3024 <tr>
3029 <td><a href="#TextVisitor.visit_Module">visit_Module</a></td> 3025 <td><a href="#TextVisitor.visit_Module">visit_Module</a></td>
3030 <td>Public method to handle a module.</td> 3026 <td>Public method to handle a module.</td>
3031 </tr> 3027 </tr>
3032 </table> 3028 </table>
3029
3033 <h3>Static Methods</h3> 3030 <h3>Static Methods</h3>
3034
3035 <table> 3031 <table>
3036 <tr><td>None</td></tr> 3032 <tr><td>None</td></tr>
3037 </table> 3033 </table>
3034
3038 3035
3039 <a NAME="TextVisitor.__init__" ID="TextVisitor.__init__"></a> 3036 <a NAME="TextVisitor.__init__" ID="TextVisitor.__init__"></a>
3040 <h4>TextVisitor (Constructor)</h4> 3037 <h4>TextVisitor (Constructor)</h4>
3041 <b>TextVisitor</b>(<i></i>) 3038 <b>TextVisitor</b>(<i></i>)
3042
3043 <p> 3039 <p>
3044 Constructor 3040 Constructor
3045 </p> 3041 </p>
3042
3046 <a NAME="TextVisitor.__addNode" ID="TextVisitor.__addNode"></a> 3043 <a NAME="TextVisitor.__addNode" ID="TextVisitor.__addNode"></a>
3047 <h4>TextVisitor.__addNode</h4> 3044 <h4>TextVisitor.__addNode</h4>
3048 <b>__addNode</b>(<i>node</i>) 3045 <b>__addNode</b>(<i>node</i>)
3049
3050 <p> 3046 <p>
3051 Private method to add a node to our list of nodes. 3047 Private method to add a node to our list of nodes.
3052 </p> 3048 </p>
3049
3053 <dl> 3050 <dl>
3054 3051
3055 <dt><i>node</i> (ast.AST)</dt> 3052 <dt><i>node</i> (ast.AST)</dt>
3056 <dd> 3053 <dd>
3057 reference to the node to add 3054 reference to the node to add
3058 </dd> 3055 </dd>
3059 </dl> 3056 </dl>
3060 <a NAME="TextVisitor.__visitBody" ID="TextVisitor.__visitBody"></a> 3057 <a NAME="TextVisitor.__visitBody" ID="TextVisitor.__visitBody"></a>
3061 <h4>TextVisitor.__visitBody</h4> 3058 <h4>TextVisitor.__visitBody</h4>
3062 <b>__visitBody</b>(<i>node</i>) 3059 <b>__visitBody</b>(<i>node</i>)
3063
3064 <p> 3060 <p>
3065 Private method to traverse the body of the node manually. 3061 Private method to traverse the body of the node manually.
3066 </p> 3062 </p>
3067 <p> 3063 <p>
3068 If the first node is an expression which contains a string or bytes it 3064 If the first node is an expression which contains a string or bytes it
3069 marks that as a docstring. 3065 marks that as a docstring.
3070 </p> 3066 </p>
3067
3071 <dl> 3068 <dl>
3072 3069
3073 <dt><i>node</i> (ast.AST)</dt> 3070 <dt><i>node</i> (ast.AST)</dt>
3074 <dd> 3071 <dd>
3075 reference to the node to traverse 3072 reference to the node to traverse
3076 </dd> 3073 </dd>
3077 </dl> 3074 </dl>
3078 <a NAME="TextVisitor.__visitDefinition" ID="TextVisitor.__visitDefinition"></a> 3075 <a NAME="TextVisitor.__visitDefinition" ID="TextVisitor.__visitDefinition"></a>
3079 <h4>TextVisitor.__visitDefinition</h4> 3076 <h4>TextVisitor.__visitDefinition</h4>
3080 <b>__visitDefinition</b>(<i>node</i>) 3077 <b>__visitDefinition</b>(<i>node</i>)
3081
3082 <p> 3078 <p>
3083 Private method handling class and function definitions. 3079 Private method handling class and function definitions.
3084 </p> 3080 </p>
3081
3085 <dl> 3082 <dl>
3086 3083
3087 <dt><i>node</i> (ast.FunctionDef, ast.AsyncFunctionDef or ast.ClassDef)</dt> 3084 <dt><i>node</i> (ast.FunctionDef, ast.AsyncFunctionDef or ast.ClassDef)</dt>
3088 <dd> 3085 <dd>
3089 reference to the node to handle 3086 reference to the node to handle
3090 </dd> 3087 </dd>
3091 </dl> 3088 </dl>
3092 <a NAME="TextVisitor.visit_AsyncFunctionDef" ID="TextVisitor.visit_AsyncFunctionDef"></a> 3089 <a NAME="TextVisitor.visit_AsyncFunctionDef" ID="TextVisitor.visit_AsyncFunctionDef"></a>
3093 <h4>TextVisitor.visit_AsyncFunctionDef</h4> 3090 <h4>TextVisitor.visit_AsyncFunctionDef</h4>
3094 <b>visit_AsyncFunctionDef</b>(<i>node</i>) 3091 <b>visit_AsyncFunctionDef</b>(<i>node</i>)
3095
3096 <p> 3092 <p>
3097 Public method to handle an asynchronous function definition. 3093 Public method to handle an asynchronous function definition.
3098 </p> 3094 </p>
3095
3099 <dl> 3096 <dl>
3100 3097
3101 <dt><i>node</i> (ast.AsyncFunctionDef)</dt> 3098 <dt><i>node</i> (ast.AsyncFunctionDef)</dt>
3102 <dd> 3099 <dd>
3103 reference to the node to handle 3100 reference to the node to handle
3104 </dd> 3101 </dd>
3105 </dl> 3102 </dl>
3106 <a NAME="TextVisitor.visit_Call" ID="TextVisitor.visit_Call"></a> 3103 <a NAME="TextVisitor.visit_Call" ID="TextVisitor.visit_Call"></a>
3107 <h4>TextVisitor.visit_Call</h4> 3104 <h4>TextVisitor.visit_Call</h4>
3108 <b>visit_Call</b>(<i>node</i>) 3105 <b>visit_Call</b>(<i>node</i>)
3109
3110 <p> 3106 <p>
3111 Public method to handle a function call. 3107 Public method to handle a function call.
3112 </p> 3108 </p>
3109
3113 <dl> 3110 <dl>
3114 3111
3115 <dt><i>node</i> (ast.Call)</dt> 3112 <dt><i>node</i> (ast.Call)</dt>
3116 <dd> 3113 <dd>
3117 reference to the node to handle 3114 reference to the node to handle
3118 </dd> 3115 </dd>
3119 </dl> 3116 </dl>
3120 <a NAME="TextVisitor.visit_ClassDef" ID="TextVisitor.visit_ClassDef"></a> 3117 <a NAME="TextVisitor.visit_ClassDef" ID="TextVisitor.visit_ClassDef"></a>
3121 <h4>TextVisitor.visit_ClassDef</h4> 3118 <h4>TextVisitor.visit_ClassDef</h4>
3122 <b>visit_ClassDef</b>(<i>node</i>) 3119 <b>visit_ClassDef</b>(<i>node</i>)
3123
3124 <p> 3120 <p>
3125 Public method to handle a class definition. 3121 Public method to handle a class definition.
3126 </p> 3122 </p>
3123
3127 <dl> 3124 <dl>
3128 3125
3129 <dt><i>node</i> (ast.ClassDef)</dt> 3126 <dt><i>node</i> (ast.ClassDef)</dt>
3130 <dd> 3127 <dd>
3131 reference to the node to handle 3128 reference to the node to handle
3132 </dd> 3129 </dd>
3133 </dl> 3130 </dl>
3134 <a NAME="TextVisitor.visit_Constant" ID="TextVisitor.visit_Constant"></a> 3131 <a NAME="TextVisitor.visit_Constant" ID="TextVisitor.visit_Constant"></a>
3135 <h4>TextVisitor.visit_Constant</h4> 3132 <h4>TextVisitor.visit_Constant</h4>
3136 <b>visit_Constant</b>(<i>node</i>) 3133 <b>visit_Constant</b>(<i>node</i>)
3137
3138 <p> 3134 <p>
3139 Public method to handle constant nodes. 3135 Public method to handle constant nodes.
3140 </p> 3136 </p>
3137
3141 <dl> 3138 <dl>
3142 3139
3143 <dt><i>node</i> (ast.Constant)</dt> 3140 <dt><i>node</i> (ast.Constant)</dt>
3144 <dd> 3141 <dd>
3145 reference to the bytes node 3142 reference to the bytes node
3146 </dd> 3143 </dd>
3147 </dl> 3144 </dl>
3148 <a NAME="TextVisitor.visit_FunctionDef" ID="TextVisitor.visit_FunctionDef"></a> 3145 <a NAME="TextVisitor.visit_FunctionDef" ID="TextVisitor.visit_FunctionDef"></a>
3149 <h4>TextVisitor.visit_FunctionDef</h4> 3146 <h4>TextVisitor.visit_FunctionDef</h4>
3150 <b>visit_FunctionDef</b>(<i>node</i>) 3147 <b>visit_FunctionDef</b>(<i>node</i>)
3151
3152 <p> 3148 <p>
3153 Public method to handle a function definition. 3149 Public method to handle a function definition.
3154 </p> 3150 </p>
3151
3155 <dl> 3152 <dl>
3156 3153
3157 <dt><i>node</i> (ast.FunctionDef)</dt> 3154 <dt><i>node</i> (ast.FunctionDef)</dt>
3158 <dd> 3155 <dd>
3159 reference to the node to handle 3156 reference to the node to handle
3160 </dd> 3157 </dd>
3161 </dl> 3158 </dl>
3162 <a NAME="TextVisitor.visit_Module" ID="TextVisitor.visit_Module"></a> 3159 <a NAME="TextVisitor.visit_Module" ID="TextVisitor.visit_Module"></a>
3163 <h4>TextVisitor.visit_Module</h4> 3160 <h4>TextVisitor.visit_Module</h4>
3164 <b>visit_Module</b>(<i>node</i>) 3161 <b>visit_Module</b>(<i>node</i>)
3165
3166 <p> 3162 <p>
3167 Public method to handle a module. 3163 Public method to handle a module.
3168 </p> 3164 </p>
3165
3169 <dl> 3166 <dl>
3170 3167
3171 <dt><i>node</i> (ast.Module)</dt> 3168 <dt><i>node</i> (ast.Module)</dt>
3172 <dd> 3169 <dd>
3173 reference to the node to handle 3170 reference to the node to handle
3177 <hr /> 3174 <hr />
3178 <hr /> 3175 <hr />
3179 <a NAME="composeCallPath" ID="composeCallPath"></a> 3176 <a NAME="composeCallPath" ID="composeCallPath"></a>
3180 <h2>composeCallPath</h2> 3177 <h2>composeCallPath</h2>
3181 <b>composeCallPath</b>(<i>node</i>) 3178 <b>composeCallPath</b>(<i>node</i>)
3182
3183 <p> 3179 <p>
3184 Generator function to assemble the call path of a given node. 3180 Generator function to assemble the call path of a given node.
3185 </p> 3181 </p>
3182
3186 <dl> 3183 <dl>
3187 3184
3188 <dt><i>node</i> (ast.Node)</dt> 3185 <dt><i>node</i> (ast.Node)</dt>
3189 <dd> 3186 <dd>
3190 node to assemble call path for 3187 node to assemble call path for

eric ide

mercurial