_MAGIC_GLOBALS |
Argument | Represents binding a name as an argument. |
Assignment | Represents binding a name with an explicit assignment. |
Binding | Represents the binding of a value to a name. |
Checker | Class to check the cleanliness and sanity of Python code. |
ClassScope | Class representing a name scope for a class. |
ExportBinding | A binding created by an __all__ assignment. |
FunctionDefinition | Represents a function definition. |
FunctionScope | Class representing a name scope for a function. |
Importation | A binding created by an import statement. |
ModuleScope | Class representing a name scope for a module. |
Scope | Class defining the scope base class. |
UnBinding | Created by the 'del' operator. |
None |
Represents binding a name as an argument.
None |
None |
Represents binding a name with an explicit assignment.
The checker will raise warnings for any Assignment that isn't used. Also, the checker does not consider assignments in tuple/list unpacking to be Assignments, rather it treats them as simple Bindings.
None |
None |
Represents the binding of a value to a name.
The checker uses this to keep track of which names have been bound and which names have not. See Assignment for a special type of binding that is checked with stricter rules.
None |
Binding | |
__repr__ | |
__str__ |
Class to check the cleanliness and sanity of Python code.
ATTRIBUTES |
BOOLOP |
CALL |
COMPREHENSION |
INVERT |
ISNOT |
LOAD |
MOD |
NONLOCAL |
PASS |
RETURN |
SETCOMP |
SLICE |
nodeDepth |
scope |
traceTree |
Checker | Constructor |
ASSIGN | |
AUGASSIGN | |
CLASSDEF | Check names used in a class definition, including its decorators, base classes, and the body of its definition. |
DICTCOMP | |
EXCEPTHANDLER | |
FOR | Process bindings for loop variables. |
FUNCTIONDEF | |
GLOBAL | Keep track of globals declarations. |
IMPORT | |
IMPORTFROM | |
LAMBDA | |
LISTCOMP | |
NAME | Handle occurrence of Name (which can be a load/store/delete access.) |
STARRED | |
_runDeferred | Run the callables in deferred using their associated scope stack. |
addArgs | |
addBinding | Called when a binding is altered. |
checkUnusedAssignments | Check to see if any assignments have not been used. |
check_dead_scopes | Look at scopes which have been fully examined and report names in them which were imported but unused. |
collectLoopVars | |
deferAssignment | Schedule an assignment handler to be called just after deferred function handlers. |
deferFunction | Schedule a function handler to be called just before completion. |
handleAssignName | |
handleBody | |
handleChildren | |
handleNode | |
ignore | |
isDocstring | Determine if the given node is a docstring, as long as it is at the correct place in the node tree. |
popScope | |
pushClassScope | |
pushFunctionScope | |
report | |
runFunction | |
scope |
Constructor
Check names used in a class definition, including its decorators, base classes, and the body of its definition. Additionally, add its name to the current scope.
Process bindings for loop variables.
Keep track of globals declarations.
Handle occurrence of Name (which can be a load/store/delete access.)
Run the callables in deferred using their associated scope stack.
Called when a binding is altered.
Check to see if any assignments have not been used.
Look at scopes which have been fully examined and report names in them which were imported but unused.
Schedule an assignment handler to be called just after deferred function handlers.
Schedule a function handler to be called just before completion.
This is used for handling function bodies, which must be deferred because code later in the file might modify the global scope. When `callable` is called, the scope at the time this is called will be restored, however it will contain any new bindings added to it.
Determine if the given node is a docstring, as long as it is at the correct place in the node tree.
Class representing a name scope for a class.
None |
None |
A binding created by an __all__ assignment. If the names in the list can be determined statically, they will be treated as names for export and additional checking applied to them.
The only __all__ assignment that can be recognized is one which takes the value of a literal list containing literal strings. For example::
__all__ = ["foo", "bar"]
Names which are imported and not otherwise used but appear in the value of __all__ will not have an unused import warning reported for them.
None |
names | Return a list of the names referenced by this binding. |
Return a list of the names referenced by this binding.
Represents a function definition.
None |
None |
Class representing a name scope for a function.
None |
FunctionScope |
A binding created by an import statement.
None |
Importation |
Class representing a name scope for a module.
None |
None |
Class defining the scope base class.
importStarred |
Scope | |
__repr__ |
Created by the 'del' operator.
None |
None |