fname stringlengths 63 176 | rel_fname stringclasses 706
values | line int64 -1 4.5k | name stringlengths 1 81 | kind stringclasses 2
values | category stringclasses 2
values | info stringlengths 0 77.9k ⌀ |
|---|---|---|---|---|---|---|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 381 | nodes_of_class | ref | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 385 | _is_type_checking_import | def | function | def _is_type_checking_import(node: Union[nodes.Import, nodes.ImportFrom]) -> bool:
"""Check if an import node is guarded by a TYPE_CHECKS guard."""
return any(
isinstance(ancestor, nodes.If)
and ancestor.test.as_string() in TYPING_TYPE_CHECKS_GUARDS
for ancestor in node.node_ancestors()
... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 389 | as_string | ref | function | and ancestor.test.as_string() in TYPING_TYPE_CHECKS_GUARDS
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 390 | node_ancestors | ref | function | for ancestor in node.node_ancestors()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 394 | _has_locals_call_after_node | def | function | def _has_locals_call_after_node(stmt, scope):
skip_nodes = (
nodes.FunctionDef,
nodes.ClassDef,
nodes.Import,
nodes.ImportFrom,
)
for call in scope.nodes_of_class(nodes.Call, skip_klass=skip_nodes):
inferred = utils.safe_infer(call.func)
if (
utils... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 401 | nodes_of_class | ref | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 402 | safe_infer | ref | function | inferred = utils.safe_infer(call.func)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 404 | is_builtin_object | ref | function | utils.is_builtin_object(inferred)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 548 | ScopeConsumer | def | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 557 | NamesConsumer | def | class | __init__ __repr__ __iter__ to_consume consumed consumed_uncertain scope_type mark_as_consumed get_next_to_consume _uncertain_nodes_in_except_blocks _defines_name_raises_or_returns _check_loop_finishes_via_except _recursive_search_for_continue_before_break _uncertain_nodes_in_try_blocks_when_evaluating_except_blocks _un... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 561 | ScopeConsumer | ref | function | self._atomic = ScopeConsumer(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 586 | to_consume | def | function | def to_consume(self):
return self._atomic.to_consume
@property
def consumed(self):
return self._atomic.consumed
@property
def consumed_uncertain(self) -> DefaultDict[str, List[nodes.NodeNG]]:
"""Retrieves nodes filtered out by get_next_to_consume() that may not
have... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 590 | consumed | def | function | def consumed(self):
return self._atomic.consumed
@property
def consumed_uncertain(self) -> DefaultDict[str, List[nodes.NodeNG]]:
"""Retrieves nodes filtered out by get_next_to_consume() that may not
have executed, such as statements in except blocks, or statements
in try blo... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 594 | consumed_uncertain | def | function | def consumed_uncertain(self) -> DefaultDict[str, List[nodes.NodeNG]]:
"""Retrieves nodes filtered out by get_next_to_consume() that may not
have executed, such as statements in except blocks, or statements
in try blocks (when evaluating their corresponding except and finally
blocks).... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 604 | scope_type | def | function | def scope_type(self):
return self._atomic.scope_type
def mark_as_consumed(self, name, consumed_nodes):
"""Mark the given nodes as consumed for the name.
If all of the nodes for the name were consumed, delete the name from
the to_consume dictionary
"""
unconsumed ... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 607 | mark_as_consumed | def | function | def mark_as_consumed(self, name, consumed_nodes):
"""Mark the given nodes as consumed for the name.
If all of the nodes for the name were consumed, delete the name from
the to_consume dictionary
"""
unconsumed = [n for n in self.to_consume[name] if n not in set(consumed_nodes... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 620 | get_next_to_consume | def | function | def get_next_to_consume(self, node: nodes.Name) -> Optional[List[nodes.NodeNG]]:
"""Return a list of the nodes that define `node` from this scope. If it is
uncertain whether a node will be consumed, such as for statements in
except blocks, add it to self.consumed_uncertain instead of returni... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 629 | statement | ref | function | node_statement = node.statement(future=True)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 657 | statement | ref | function | if not isinstance(n.statement(future=True), nodes.ExceptHandler)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 658 | statement | ref | function | or n.statement(future=True).parent_of(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 658 | parent_of | ref | function | or n.statement(future=True).parent_of(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 664 | _uncertain_nodes_in_except_blocks | ref | function | uncertain_nodes = self._uncertain_nodes_in_except_blocks(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 675 | _uncertain_nodes_in_try_blocks_when_evaluating_finally_blocks | ref | function | self._uncertain_nodes_in_try_blocks_when_evaluating_finally_blocks(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 687 | _uncertain_nodes_in_try_blocks_when_evaluating_except_blocks | ref | function | self._uncertain_nodes_in_try_blocks_when_evaluating_except_blocks(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 698 | _uncertain_nodes_in_except_blocks | def | function | def _uncertain_nodes_in_except_blocks(
found_nodes: List[nodes.NodeNG],
node: nodes.NodeNG,
node_statement: nodes.Statement,
) -> List[nodes.NodeNG]:
"""Return any nodes in ``found_nodes`` that should be treated as uncertain
because they are in an except block.
""... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 708 | statement | ref | function | other_node_statement = other_node.statement(future=True)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 710 | get_node_first_ancestor_of_type | ref | function | closest_except_handler = utils.get_node_first_ancestor_of_type(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 716 | parent_of | ref | function | if closest_except_handler.parent_of(node):
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 730 | parent_of | ref | function | and closest_try_except.parent.parent_of(node_statement)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 736 | _defines_name_raises_or_returns | ref | function | NamesConsumer._defines_name_raises_or_returns(node.name, handler)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 741 | _check_loop_finishes_via_except | ref | function | if NamesConsumer._check_loop_finishes_via_except(node, closest_try_except):
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 749 | _defines_name_raises_or_returns | def | function | def _defines_name_raises_or_returns(
name: str, handler: nodes.ExceptHandler
) -> bool:
"""Return _True if some child of `handler` defines the name `name`,
raises, or returns.
"""
def _define_raise_or_return(stmt: nodes.NodeNG) -> bool:
if isinstance(stmt, (n... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 756 | _define_raise_or_return | def | function | def _define_raise_or_return(stmt: nodes.NodeNG) -> bool:
if isinstance(stmt, (nodes.Raise, nodes.Return)):
return _True
if isinstance(stmt, nodes.Assign):
for target in stmt.targets:
for elt in utils.get_all_elements(target):
... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 761 | get_all_elements | ref | function | for elt in utils.get_all_elements(target):
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 782 | get_children | ref | function | for stmt in handler.get_children():
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 783 | _define_raise_or_return | ref | function | if _define_raise_or_return(stmt):
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 787 | _define_raise_or_return | ref | function | _define_raise_or_return(nested_stmt)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 788 | get_children | ref | function | for nested_stmt in stmt.get_children()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 794 | _check_loop_finishes_via_except | def | function | def _check_loop_finishes_via_except(
node: nodes.NodeNG, other_node_try_except: nodes.TryExcept
) -> bool:
"""Check for a case described in https://github.com/PyCQA/pylint/issues/5683.
It consists of a specific control flow scenario where the only
non-break exit from a loop consi... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 819 | get_node_first_ancestor_of_type | ref | function | ] = utils.get_node_first_ancestor_of_type(node, (nodes.For, nodes.While))
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 823 | parent_of | ref | function | else_statement is node or else_statement.parent_of(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 836 | _try_in_loop_body | def | function | def _try_in_loop_body(
other_node_try_except: nodes.TryExcept, loop: Union[nodes.For, nodes.While]
) -> bool:
"""Return _True if `other_node_try_except` is a descendant of `loop`."""
return any(
loop_body_statement is other_node_try_except
... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 842 | parent_of | ref | function | or loop_body_statement.parent_of(other_node_try_except)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 846 | _try_in_loop_body | ref | function | if not _try_in_loop_body(other_node_try_except, closest_loop):
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 847 | node_ancestors | ref | function | for ancestor in closest_loop.node_ancestors():
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 849 | _try_in_loop_body | ref | function | if _try_in_loop_body(other_node_try_except, ancestor):
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 856 | _recursive_search_for_continue_before_break | ref | function | if NamesConsumer._recursive_search_for_continue_before_break(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 866 | _recursive_search_for_continue_before_break | def | function | def _recursive_search_for_continue_before_break(
stmt: nodes.Statement, break_stmt: nodes.Break
) -> bool:
"""Return _True if any Continue node can be found in descendants of `stmt`
before encountering `break_stmt`, ignoring any nested loops.
"""
if stmt is break_stmt:
... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 876 | get_children | ref | function | for child in stmt.get_children():
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 879 | _recursive_search_for_continue_before_break | ref | function | if NamesConsumer._recursive_search_for_continue_before_break(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 886 | _uncertain_nodes_in_try_blocks_when_evaluating_except_blocks | def | function | def _uncertain_nodes_in_try_blocks_when_evaluating_except_blocks(
found_nodes: List[nodes.NodeNG], node_statement: nodes.Statement
) -> List[nodes.NodeNG]:
"""Return any nodes in ``found_nodes`` that should be treated as uncertain
because they are in a try block and the ``node_statement`... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 894 | get_node_first_ancestor_of_type | ref | function | closest_except_handler = utils.get_node_first_ancestor_of_type(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 900 | statement | ref | function | other_node_statement = other_node.statement(future=True)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 908 | get_node_first_ancestor_of_type_and_its_child | ref | function | ) = utils.get_node_first_ancestor_of_type_and_its_child(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 924 | node_ancestors | ref | function | in closest_except_handler.node_ancestors()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 933 | _uncertain_nodes_in_try_blocks_when_evaluating_finally_blocks | def | function | def _uncertain_nodes_in_try_blocks_when_evaluating_finally_blocks(
found_nodes: List[nodes.NodeNG], node_statement: nodes.Statement
) -> List[nodes.NodeNG]:
uncertain_nodes: List[nodes.NodeNG] = []
(
closest_try_finally_ancestor,
child_of_closest_try_finally_ances... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 940 | get_node_first_ancestor_of_type_and_its_child | ref | function | ) = utils.get_node_first_ancestor_of_type_and_its_child(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 951 | statement | ref | function | other_node_statement = other_node.statement(future=True)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 955 | get_node_first_ancestor_of_type_and_its_child | ref | function | ) = utils.get_node_first_ancestor_of_type_and_its_child(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 974 | parent_of | ref | function | or other_node_final_statement.parent_of(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 987 | VariablesChecker | def | class | __init__ open visit_for leave_for visit_module leave_module visit_classdef leave_classdef visit_lambda leave_lambda visit_generatorexp leave_generatorexp visit_dictcomp leave_dictcomp visit_setcomp leave_setcomp visit_functiondef leave_functiondef visit_global visit_assignname visit_delname visit_name visit_excepthandl... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,105 | is_message_enabled | ref | function | self._is_undefined_variable_enabled = self.linter.is_message_enabled(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,108 | is_message_enabled | ref | function | self._is_used_before_assignment_enabled = self.linter.is_message_enabled(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,111 | is_message_enabled | ref | function | self._is_undefined_loop_variable_enabled = self.linter.is_message_enabled(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,115 | check_messages | ref | function | @utils.check_messages("redefined-outer-name")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,116 | visit_for | def | function | def visit_for(self, node: nodes.For) -> None:
assigned_to = [a.name for a in node.target.nodes_of_class(nodes.AssignName)]
# Only check variables that are used
dummy_rgx = self.config.dummy_variables_rgx
assigned_to = [var for var in assigned_to if not dummy_rgx.match(var)]
... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,117 | nodes_of_class | ref | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,125 | in_for_else_branch | ref | function | if variable in outer_variables and not in_for_else_branch(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,128 | add_message | ref | function | self.add_message(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,137 | check_messages | ref | function | @utils.check_messages("redefined-outer-name")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,138 | leave_for | def | function | def leave_for(self, node: nodes.For) -> None:
self._loop_variables.pop()
self._store_type_annotation_names(node)
def visit_module(self, node: nodes.Module) -> None:
"""Visit module : update consumption analysis variable
checks globals doesn't overrides builtins
"""
... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,140 | _store_type_annotation_names | ref | function | self._store_type_annotation_names(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,142 | visit_module | def | function | def visit_module(self, node: nodes.Module) -> None:
"""Visit module : update consumption analysis variable
checks globals doesn't overrides builtins
"""
self._to_consume = [NamesConsumer(node, "module")]
self._postponed_evaluation_enabled = is_postponed_evaluation_enabled(nod... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,146 | NamesConsumer | ref | function | self._to_consume = [NamesConsumer(node, "module")]
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,147 | is_postponed_evaluation_enabled | ref | function | self._postponed_evaluation_enabled = is_postponed_evaluation_enabled(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,150 | is_builtin | ref | function | if utils.is_builtin(name):
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,151 | _should_ignore_redefined_builtin | ref | function | if self._should_ignore_redefined_builtin(stmts[0]) or name == "__doc__":
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,153 | add_message | ref | function | self.add_message("redefined-builtin", args=name, node=stmts[0])
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,155 | check_messages | ref | function | @utils.check_messages(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,164 | leave_module | def | function | def leave_module(self, node: nodes.Module) -> None:
"""Leave module: check globals."""
assert len(self._to_consume) == 1
self._check_metaclasses(node)
not_consumed = self._to_consume.pop().to_consume
# attempt to check for __all__ if defined
if "__all__" in node.loca... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,168 | _check_metaclasses | ref | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,172 | _check_all | ref | function | self._check_all(node, not_consumed)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,175 | _check_globals | ref | function | self._check_globals(not_consumed)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,181 | _check_imports | ref | function | self._check_imports(not_consumed)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,183 | visit_classdef | def | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,185 | NamesConsumer | ref | class | __init__ __repr__ __iter__ to_consume consumed consumed_uncertain scope_type mark_as_consumed get_next_to_consume _uncertain_nodes_in_except_blocks _defines_name_raises_or_returns _check_loop_finishes_via_except _recursive_search_for_continue_before_break _uncertain_nodes_in_try_blocks_when_evaluating_except_blocks _un... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,187 | leave_classdef | def | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,192 | visit_lambda | def | function | def visit_lambda(self, node: nodes.Lambda) -> None:
"""Visit lambda: update consumption analysis variable."""
self._to_consume.append(NamesConsumer(node, "lambda"))
def leave_lambda(self, _: nodes.Lambda) -> None:
"""Leave lambda: update consumption analysis variable."""
# do no... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,194 | NamesConsumer | ref | function | self._to_consume.append(NamesConsumer(node, "lambda"))
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,196 | leave_lambda | def | function | def leave_lambda(self, _: nodes.Lambda) -> None:
"""Leave lambda: update consumption analysis variable."""
# do not check for not used locals here
self._to_consume.pop()
def visit_generatorexp(self, node: nodes.GeneratorExp) -> None:
"""Visit genexpr: update consumption analysis... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,201 | visit_generatorexp | def | function | def visit_generatorexp(self, node: nodes.GeneratorExp) -> None:
"""Visit genexpr: update consumption analysis variable."""
self._to_consume.append(NamesConsumer(node, "comprehension"))
def leave_generatorexp(self, _: nodes.GeneratorExp) -> None:
"""Leave genexpr: update consumption anal... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,203 | NamesConsumer | ref | function | self._to_consume.append(NamesConsumer(node, "comprehension"))
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,205 | leave_generatorexp | def | function | def leave_generatorexp(self, _: nodes.GeneratorExp) -> None:
"""Leave genexpr: update consumption analysis variable."""
# do not check for not used locals here
self._to_consume.pop()
def visit_dictcomp(self, node: nodes.DictComp) -> None:
"""Visit dictcomp: update consumption an... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,210 | visit_dictcomp | def | function | def visit_dictcomp(self, node: nodes.DictComp) -> None:
"""Visit dictcomp: update consumption analysis variable."""
self._to_consume.append(NamesConsumer(node, "comprehension"))
def leave_dictcomp(self, _: nodes.DictComp) -> None:
"""Leave dictcomp: update consumption analysis variable.... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,212 | NamesConsumer | ref | function | self._to_consume.append(NamesConsumer(node, "comprehension"))
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,214 | leave_dictcomp | def | function | def leave_dictcomp(self, _: nodes.DictComp) -> None:
"""Leave dictcomp: update consumption analysis variable."""
# do not check for not used locals here
self._to_consume.pop()
def visit_setcomp(self, node: nodes.SetComp) -> None:
"""Visit setcomp: update consumption analysis var... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,219 | visit_setcomp | def | function | def visit_setcomp(self, node: nodes.SetComp) -> None:
"""Visit setcomp: update consumption analysis variable."""
self._to_consume.append(NamesConsumer(node, "comprehension"))
def leave_setcomp(self, _: nodes.SetComp) -> None:
"""Leave setcomp: update consumption analysis variable."""
... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,221 | NamesConsumer | ref | function | self._to_consume.append(NamesConsumer(node, "comprehension"))
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,223 | leave_setcomp | def | function | def leave_setcomp(self, _: nodes.SetComp) -> None:
"""Leave setcomp: update consumption analysis variable."""
# do not check for not used locals here
self._to_consume.pop()
def visit_functiondef(self, node: nodes.FunctionDef) -> None:
"""Visit function: update consumption analys... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/variables.py | pylint/checkers/variables.py | 1,228 | visit_functiondef | def | function | def visit_functiondef(self, node: nodes.FunctionDef) -> None:
"""Visit function: update consumption analysis variable and check locals."""
self._to_consume.append(NamesConsumer(node, "function"))
if not (
self.linter.is_message_enabled("redefined-outer-name")
or self.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.