module documentation

Classes checker for Python code.

Class ClassChecker Checker for class nodes.
Class ScopeAccessMap Store the accessed variables per scope.
Constant ASTROID_TYPE_COMPARATORS Undocumented
Constant BUILTIN_DECORATORS Undocumented
Constant INVALID_BASE_CLASSES Undocumented
Constant MSGS Undocumented
Class _DefaultMissing Sentinel value for missing arg default, use _DEFAULT_MISSING.
Function _ancestors_to_call Return a dictionary where keys are the list of base classes providing the queried method, and so that should/may be called from the method node.
Function _called_in_methods Check if the func was called in any of the given methods, belonging to the *klass*.
Function _definition_equivalent_to_call Check if a definition signature is equivalent to a call.
Function _different_parameters Determine if the two methods have different parameters.
Function _has_data_descriptor Undocumented
Function _has_different_keyword_only_parameters Determine if the two methods have different keyword only parameters.
Function _has_different_parameters Undocumented
Function _has_different_parameters_default_value Check if original and overridden methods arguments have different default values.
Function _has_same_layout_slots Undocumented
Function _is_attribute_property Check if the given attribute *name* is a property in the given *klass*.
Function _is_invalid_base_class Undocumented
Function _is_trivial_super_delegation Check whether a function definition is a method consisting only of a call to the same function on the superclass.
Function _positional_parameters Undocumented
Function _scope_default Undocumented
Function _signature_from_arguments Undocumented
Function _signature_from_call Undocumented
Constant _DEFAULT_MISSING Undocumented
Type Alias _AccessNodes Undocumented
Variable _CallSignature Undocumented
Variable _ParameterSignature Undocumented
ASTROID_TYPE_COMPARATORS = (source)

Undocumented

Value
{nodes.Const: (lambda a, b: a.value == b.value),
 nodes.ClassDef: (lambda a, b: a.qname == b.qname),
 nodes.Tuple: (lambda a, b: a.elts == b.elts),
 nodes.List: (lambda a, b: a.elts == b.elts),
 nodes.Dict: (lambda a, b: a.items == b.items),
 nodes.Name: (lambda a, b: set(a.infer()) == set(b.infer()))}
BUILTIN_DECORATORS: set[str] = (source)

Undocumented

Value
set(['builtins.property', 'builtins.classmethod'])
INVALID_BASE_CLASSES: set[str] = (source)

Undocumented

Value
set(['bool', 'range', 'slice', 'memoryview'])

Undocumented

Value
{'F0202': ('Unable to check methods signature (%s / %s)',
           'method-check-failed',
           'Used when Pylint has been unable to check methods signature compatib
ility for an unexpected reason. Please report this kind if you don\'t make sense
 of it.'),
 'E0202': ('An attribute defined in %s line %s hides this method',
           'method-hidden',
...
def _ancestors_to_call(klass_node: nodes.ClassDef, method_name: str = '__init__') -> dict[nodes.ClassDef, bases.UnboundMethod]: (source)

Return a dictionary where keys are the list of base classes providing the queried method, and so that should/may be called from the method node.

def _called_in_methods(func: LocalsDictNodeNG, klass: nodes.ClassDef, methods: Sequence[str]) -> bool: (source)

Check if the func was called in any of the given methods, belonging to the *klass*. Returns True if so, False otherwise.

def _definition_equivalent_to_call(definition: _ParameterSignature, call: _CallSignature) -> bool: (source)

Check if a definition signature is equivalent to a call.

def _different_parameters(original: nodes.FunctionDef, overridden: nodes.FunctionDef, dummy_parameter_regex: Pattern[str]) -> list[str]: (source)

Determine if the two methods have different parameters. They are considered to have different parameters if: * they have different positional parameters, including different names * one of the methods is having variadics, while the other is not * they have different keyword only parameters.

def _has_data_descriptor(cls: nodes.ClassDef, attr: str) -> bool: (source)

Undocumented

def _has_different_keyword_only_parameters(original: list[nodes.AssignName], overridden: list[nodes.AssignName]) -> list[str]: (source)

Determine if the two methods have different keyword only parameters.

def _has_different_parameters(original: list[nodes.AssignName], overridden: list[nodes.AssignName], dummy_parameter_regex: Pattern[str]) -> list[str]: (source)

Undocumented

def _has_different_parameters_default_value(original: nodes.Arguments, overridden: nodes.Arguments) -> bool: (source)

Check if original and overridden methods arguments have different default values. Return True if one of the overridden arguments has a default value different from the default value of the original argument If one of the method doesn't have argument (.args is None) return False

def _has_same_layout_slots(slots: list[nodes.Const|None], assigned_value: nodes.Name) -> bool: (source)

Undocumented

def _is_attribute_property(name: str, klass: nodes.ClassDef) -> bool: (source)

Check if the given attribute *name* is a property in the given *klass*. It will look for `property` calls or for functions with the given name, decorated by `property` or `property` subclasses. Returns ``True`` if the name is a property in the given klass, ``False`` otherwise.

def _is_invalid_base_class(cls: nodes.ClassDef) -> bool: (source)

Undocumented

def _is_trivial_super_delegation(function: nodes.FunctionDef) -> bool: (source)

Check whether a function definition is a method consisting only of a call to the same function on the superclass.

def _positional_parameters(method: nodes.FunctionDef) -> list[nodes.AssignName]: (source)

Undocumented

def _scope_default() -> defaultdict[str, list[_AccessNodes]]: (source)

Undocumented

def _signature_from_arguments(arguments: nodes.Arguments) -> _ParameterSignature: (source)

Undocumented

def _signature_from_call(call: nodes.Call) -> _CallSignature: (source)

Undocumented

_DEFAULT_MISSING = (source)

Undocumented

Value
_DefaultMissing()
_AccessNodes = (source)

Undocumented

Value
Union[nodes.Attribute, nodes.AssignAttr]
_CallSignature = (source)

Undocumented

_ParameterSignature = (source)

Undocumented