eric7.Plugins.CheckerPlugins.CodeStyleChecker.Simplify.SimplifyChecker

Module implementing the checker for simplifying Python code.

Global Attributes

None

Classes

SimplifyChecker Class implementing a checker for to help simplifying Python code.

Functions

None


SimplifyChecker

Class implementing a checker for to help simplifying Python code.

Derived from

CodeStyleTopicChecker

Class Attributes

Category
Codes

Class Methods

None

Methods

SimplifyChecker Constructor
__addMeta Private method to amend the nodes of the given AST tree with backward and forward references.
__checkCodeSimplifications Private method to check for code simplifications.

Static Methods

None

SimplifyChecker (Constructor)

SimplifyChecker(source, filename, tree, selected, ignored, expected, repeat)

Constructor

source (list of str)
source code to be checked
filename (str)
name of the source file
tree (ast.Module)
AST tree of the source code
selected (list of str)
list of selected codes
ignored (list of str)
list of codes to be ignored
expected (list of str)
list of expected codes
repeat (bool)
flag indicating to report each occurrence of a code

SimplifyChecker.__addMeta

__addMeta(root, level=0)

Private method to amend the nodes of the given AST tree with backward and forward references.

root (ast.AST)
reference to the root node of the tree
level (int (optional))
nesting level (defaults to 0)

SimplifyChecker.__checkCodeSimplifications

__checkCodeSimplifications()

Private method to check for code simplifications.

Up