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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |