class documentation

class SpecialMethodsChecker(BaseChecker): (source)

View In Hierarchy

Checker which verifies that special methods are implemented correctly.

Method __init__ Checker instances should have the linter as argument.
Method visit_functiondef Undocumented
Class Variable msgs Undocumented
Class Variable name Name of the provider.
Static Method _is_bool Undocumented
Static Method _is_bytes Undocumented
Static Method _is_dict Undocumented
Static Method _is_int Undocumented
Static Method _is_iterator Undocumented
Static Method _is_str Undocumented
Static Method _is_tuple Undocumented
Static Method _is_wrapped_type Undocumented
Method _check_bool Undocumented
Method _check_bytes Undocumented
Method _check_format Undocumented
Method _check_getnewargs Undocumented
Method _check_getnewargs_ex Undocumented
Method _check_hash Undocumented
Method _check_index Undocumented
Method _check_iter Undocumented
Method _check_len Undocumented
Method _check_length_hint Undocumented
Method _check_repr Undocumented
Method _check_str Undocumented
Method _check_unexpected_method_signature Undocumented
Instance Variable _protocol_map Undocumented

Inherited from BaseChecker:

Method __eq__ Permit to assert Checkers are equal.
Method __gt__ Sorting of checkers.
Method __hash__ Make Checker hashable.
Method __repr__ Undocumented
Method __str__ This might be incomplete because multiple classes inheriting BaseChecker can have the same name.
Method add_message Undocumented
Method check_consistency Check the consistency of msgid.
Method close Called after visiting project (i.e set of modules).
Method create_message_definition_from_tuple Undocumented
Method get_full_documentation Undocumented
Method get_map_data Undocumented
Method get_message_definition Undocumented
Method open Called before visiting project (i.e. set of modules).
Method reduce_map_data Undocumented
Class Variable enabled Undocumented
Class Variable options Options provided by this provider.
Class Variable reports Undocumented
Instance Variable linter Undocumented
Property messages Undocumented

Inherited from _ArgumentsProvider (via BaseChecker):

Method get_option_def DEPRECATED: Return the dictionary defining an option given its name.
Method level.setter Undocumented
Method load_defaults DEPRECATED: Initialize the provider using default values.
Method option_attrname DEPRECATED: Get the config attribute corresponding to opt.
Method option_value DEPRECATED: Get the current value for the given option.
Method options_and_values DEPRECATED.
Method options_by_section DEPRECATED: Return an iterator on options grouped by section.
Method set_option DEPRECATED: Method called to set an option (registered in the options list).
Class Variable option_groups_descs Option groups of this provider and their descriptions.
Property config Undocumented
Property level Undocumented
Instance Variable _arguments_manager The manager that will parse and register any options provided.
Instance Variable _level Undocumented
def __init__(self, linter: PyLinter): (source)

Checker instances should have the linter as argument.

@only_required_for_messages('unexpected-special-method-signature', 'non-iterator-returned', 'invalid-length-returned', 'invalid-bool-returned', 'invalid-index-returned', 'invalid-repr-returned', 'invalid-str-returned', 'invalid-bytes-returned', 'invalid-hash-returned', 'invalid-length-hint-returned', 'invalid-format-returned', 'invalid-getnewargs-returned', 'invalid-getnewargs-ex-returned')
def visit_functiondef(self, node: nodes.FunctionDef): (source)

Undocumented

Name of the provider.

Undocumented

Undocumented

Undocumented

Undocumented

@staticmethod
def _is_iterator(node: InferenceResult) -> bool: (source)

Undocumented

Undocumented

Undocumented

@staticmethod
def _is_wrapped_type(node: InferenceResult, type_: str) -> bool: (source)

Undocumented

def _check_bool(self, node: nodes.FunctionDef, inferred: InferenceResult): (source)

Undocumented

def _check_bytes(self, node: nodes.FunctionDef, inferred: InferenceResult): (source)

Undocumented

def _check_format(self, node: nodes.FunctionDef, inferred: InferenceResult): (source)

Undocumented

def _check_getnewargs(self, node: nodes.FunctionDef, inferred: InferenceResult): (source)

Undocumented

def _check_getnewargs_ex(self, node: nodes.FunctionDef, inferred: InferenceResult): (source)

Undocumented

def _check_hash(self, node: nodes.FunctionDef, inferred: InferenceResult): (source)

Undocumented

def _check_index(self, node: nodes.FunctionDef, inferred: InferenceResult): (source)

Undocumented

def _check_iter(self, node: nodes.FunctionDef, inferred: InferenceResult): (source)

Undocumented

def _check_len(self, node: nodes.FunctionDef, inferred: InferenceResult): (source)

Undocumented

def _check_length_hint(self, node: nodes.FunctionDef, inferred: InferenceResult): (source)

Undocumented

def _check_repr(self, node: nodes.FunctionDef, inferred: InferenceResult): (source)

Undocumented

def _check_str(self, node: nodes.FunctionDef, inferred: InferenceResult): (source)

Undocumented

def _check_unexpected_method_signature(self, node: nodes.FunctionDef): (source)

Undocumented

_protocol_map: dict[str, Callable[[nodes.FunctionDef, InferenceResult], None]] = (source)

Undocumented