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/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 638 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 644 | visit_while | def | function | def visit_while(self, node: nodes.While) -> None:
"""Increments the branches counter."""
branches = 1
if node.orelse:
branches += 1
self._inc_branch(node, branches)
visit_for = visit_while
def _inc_branch(self, node, branchesnum=1):
"""Increments the bra... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 649 | _inc_branch | ref | function | self._inc_branch(node, branches)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 653 | _inc_branch | def | function | def _inc_branch(self, node, branchesnum=1):
"""Increments the branches counter."""
self._branches[node.scope()] += branchesnum
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 655 | scope | ref | function | self._branches[node.scope()] += branchesnum
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 658 | register | def | function | def register(linter: PyLinter) -> None:
linter.register_checker(MisdesignChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 659 | register_checker | ref | function | linter.register_checker(MisdesignChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 659 | MisdesignChecker | ref | function | linter.register_checker(MisdesignChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/dunder_methods.py | pylint/checkers/dunder_methods.py | 116 | DunderCallChecker | def | class | within_dunder_def visit_call |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/dunder_methods.py | pylint/checkers/dunder_methods.py | 146 | within_dunder_def | def | function | def within_dunder_def(node: nodes.NodeNG) -> bool:
"""Check if dunder method call is within a dunder method definition."""
parent = node.parent
while parent is not None:
if (
isinstance(parent, nodes.FunctionDef)
and parent.name.startswith("__")
... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/dunder_methods.py | pylint/checkers/dunder_methods.py | 159 | visit_call | def | function | def visit_call(self, node: nodes.Call) -> None:
"""Check if method being called is an unnecessary dunder method."""
if (
isinstance(node.func, nodes.Attribute)
and node.func.attrname in DUNDER_METHODS
and not self.within_dunder_def(node)
and not (
... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/dunder_methods.py | pylint/checkers/dunder_methods.py | 164 | within_dunder_def | ref | function | and not self.within_dunder_def(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/dunder_methods.py | pylint/checkers/dunder_methods.py | 171 | safe_infer | ref | function | inf_expr = safe_infer(node.func.expr)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/dunder_methods.py | pylint/checkers/dunder_methods.py | 176 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/dunder_methods.py | pylint/checkers/dunder_methods.py | 184 | register | def | function | def register(linter: PyLinter) -> None:
linter.register_checker(DunderCallChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/dunder_methods.py | pylint/checkers/dunder_methods.py | 185 | register_checker | ref | function | linter.register_checker(DunderCallChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/dunder_methods.py | pylint/checkers/dunder_methods.py | 185 | DunderCallChecker | ref | function | linter.register_checker(DunderCallChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/ellipsis_checker.py | pylint/checkers/ellipsis_checker.py | 19 | EllipsisChecker | def | class | visit_const |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/ellipsis_checker.py | pylint/checkers/ellipsis_checker.py | 32 | only_required_for_messages | ref | function | @only_required_for_messages("unnecessary-ellipsis")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/ellipsis_checker.py | pylint/checkers/ellipsis_checker.py | 33 | visit_const | def | function | def visit_const(self, node: nodes.Const) -> None:
"""Check if the ellipsis constant is used unnecessarily.
Emits a warning when:
- A line consisting of an ellipsis is preceded by a docstring.
- A statement exists in the same scope as the ellipsis.
For example: A functio... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/ellipsis_checker.py | pylint/checkers/ellipsis_checker.py | 43 | pytype | ref | function | node.pytype() == "builtins.Ellipsis"
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/ellipsis_checker.py | pylint/checkers/ellipsis_checker.py | 53 | add_message | ref | function | self.add_message("unnecessary-ellipsis", node=node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/ellipsis_checker.py | pylint/checkers/ellipsis_checker.py | 56 | register | def | function | def register(linter: PyLinter) -> None:
linter.register_checker(EllipsisChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/ellipsis_checker.py | pylint/checkers/ellipsis_checker.py | 57 | register_checker | ref | function | linter.register_checker(EllipsisChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/ellipsis_checker.py | pylint/checkers/ellipsis_checker.py | 57 | EllipsisChecker | ref | function | linter.register_checker(EllipsisChecker(linter))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 23 | _builtin_exceptions | def | function | def _builtin_exceptions():
def predicate(obj):
return isinstance(obj, type) and issubclass(obj, BaseException)
members = inspect.getmembers(builtins, predicate)
return {exc.__name__ for (_, exc) in members}
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 24 | predicate | def | function | def predicate(obj):
return isinstance(obj, type) and issubclass(obj, BaseException)
members = inspect.getmembers(builtins, predicate)
return {exc.__name__ for (_, exc) in members}
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 31 | _annotated_unpack_infer | def | function | def _annotated_unpack_infer(stmt, context=None):
"""Recursively generate nodes inferred by the given statement.
If the inferred value is a list or a tuple, recurse on the elements.
Returns an iterator which yields tuples in the format
('original node', 'inferred node').
"""
if isinstance(stmt, ... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 40 | safe_infer | ref | function | inferred = utils.safe_infer(elt)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 44 | infer | ref | function | for inferred in stmt.infer(context):
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 50 | _is_raising | def | function | def _is_raising(body: list) -> bool:
"""Return whether the given statement node raises an exception."""
return any(isinstance(node, nodes.Raise) for node in body)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 165 | BaseVisitor | def | class | __init__ visit visit_default |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 172 | visit | def | function | def visit(self, node):
name = node.__class__.__name__.lower()
dispatch_meth = getattr(self, "visit_" + name, None)
if dispatch_meth:
dispatch_meth(node)
else:
self.visit_default(node)
def visit_default(self, _: nodes.NodeNG) -> None:
"""Default im... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 176 | dispatch_meth | ref | function | dispatch_meth(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 178 | visit_default | ref | function | self.visit_default(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 180 | visit_default | def | function | def visit_default(self, _: nodes.NodeNG) -> None:
"""Default implementation for all the nodes."""
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 184 | ExceptionRaiseRefVisitor | def | class | visit_name visit_call |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 187 | visit_name | def | function | def visit_name(self, node: nodes.Name) -> None:
if node.name == "NotImplemented":
self._checker.add_message("notimplemented-raised", node=self._node)
def visit_call(self, node: nodes.Call) -> None:
if isinstance(node.func, nodes.Name):
self.visit_name(node.func)
... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 189 | add_message | ref | function | self._checker.add_message("notimplemented-raised", node=self._node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 191 | visit_call | def | function | def visit_call(self, node: nodes.Call) -> None:
if isinstance(node.func, nodes.Name):
self.visit_name(node.func)
if (
len(node.args) > 1
and isinstance(node.args[0], nodes.Const)
and isinstance(node.args[0].value, str)
):
msg = node... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 193 | visit_name | ref | function | self.visit_name(node.func)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 201 | add_message | ref | function | self._checker.add_message("raising-format-tuple", node=self._node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 204 | ExceptionRaiseLeafVisitor | def | class | visit_const visit_instance visit_classdef visit_tuple visit_default |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 207 | visit_const | def | function | def visit_const(self, node: nodes.Const) -> None:
self._checker.add_message(
"raising-bad-type", node=self._node, args=node.value.__class__.__name__
)
def visit_instance(self, instance: objects.ExceptionInstance) -> None:
cls = instance._proxied
self.visit_classdef(c... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 208 | add_message | ref | function | self._checker.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 212 | visit_instance | def | function | def visit_instance(self, instance: objects.ExceptionInstance) -> None:
cls = instance._proxied
self.visit_classdef(cls)
# Exception instances have a particular class type
visit_exceptioninstance = visit_instance
def visit_classdef(self, node: nodes.ClassDef) -> None:
if not uti... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 214 | visit_classdef | ref | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 219 | visit_classdef | def | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 220 | inherit_from_std_ex | ref | function | if not utils.inherit_from_std_ex(node) and utils.has_known_bases(node):
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 220 | has_known_bases | ref | function | if not utils.inherit_from_std_ex(node) and utils.has_known_bases(node):
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 222 | add_message | ref | function | self._checker.add_message("raising-non-exception", node=self._node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 224 | visit_tuple | def | function | def visit_tuple(self, _: nodes.Tuple) -> None:
self._checker.add_message("raising-bad-type", node=self._node, args="tuple")
def visit_default(self, node: nodes.NodeNG) -> None:
name = getattr(node, "name", node.__class__.__name__)
self._checker.add_message("raising-bad-type", node=self.... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 225 | add_message | ref | function | self._checker.add_message("raising-bad-type", node=self._node, args="tuple")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 227 | visit_default | def | function | def visit_default(self, node: nodes.NodeNG) -> None:
name = getattr(node, "name", node.__class__.__name__)
self._checker.add_message("raising-bad-type", node=self._node, args=name)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 229 | add_message | ref | function | self._checker.add_message("raising-bad-type", node=self._node, args=name)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 232 | ExceptionsChecker | def | class | open visit_raise _check_misplaced_bare_raise _check_bad_exception_context _check_raise_missing_from _check_catching_non_exception _check_try_except_raise visit_binop visit_compare visit_tryexcept |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 252 | _builtin_exceptions | ref | function | self._builtin_exceptions = _builtin_exceptions()
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 255 | only_required_for_messages | ref | function | @utils.only_required_for_messages(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 264 | visit_raise | def | function | def visit_raise(self, node: nodes.Raise) -> None:
if node.exc is None:
self._check_misplaced_bare_raise(node)
return
if node.cause is None:
self._check_raise_missing_from(node)
else:
self._check_bad_exception_context(node)
expr = node... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 266 | _check_misplaced_bare_raise | ref | function | self._check_misplaced_bare_raise(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 270 | _check_raise_missing_from | ref | function | self._check_raise_missing_from(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 272 | _check_bad_exception_context | ref | function | self._check_bad_exception_context(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 275 | ExceptionRaiseRefVisitor | ref | function | ExceptionRaiseRefVisitor(self, node).visit(expr)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 275 | visit | ref | function | ExceptionRaiseRefVisitor(self, node).visit(expr)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 277 | safe_infer | ref | function | inferred = utils.safe_infer(expr)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 280 | ExceptionRaiseLeafVisitor | ref | function | ExceptionRaiseLeafVisitor(self, node).visit(inferred)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 280 | visit | ref | function | ExceptionRaiseLeafVisitor(self, node).visit(inferred)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 282 | _check_misplaced_bare_raise | def | function | def _check_misplaced_bare_raise(self, node):
# Filter out if it's present in __exit__.
scope = node.scope()
if (
isinstance(scope, nodes.FunctionDef)
and scope.is_method()
and scope.name == "__exit__"
):
return
current = node
... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 284 | scope | ref | function | scope = node.scope()
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 287 | is_method | ref | function | and scope.is_method()
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 301 | add_message | ref | function | self.add_message("misplaced-bare-raise", node=node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 303 | _check_bad_exception_context | def | function | def _check_bad_exception_context(self, node: nodes.Raise) -> None:
"""Verify that the exception context is properly set.
An exception context can be only `None` or an exception.
"""
cause = utils.safe_infer(node.cause)
if cause in (astroid.Uninferable, None):
ret... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 308 | safe_infer | ref | function | cause = utils.safe_infer(node.cause)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 314 | add_message | ref | function | self.add_message("bad-exception-context", node=node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 315 | inherit_from_std_ex | ref | function | elif not isinstance(cause, nodes.ClassDef) and not utils.inherit_from_std_ex(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 318 | add_message | ref | function | self.add_message("bad-exception-context", node=node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 320 | _check_raise_missing_from | def | function | def _check_raise_missing_from(self, node: nodes.Raise) -> None:
if node.exc is None:
# This is a plain `raise`, raising the previously-caught exception. No need for a
# cause.
return
# We'd like to check whether we're inside an `except` clause:
containing_... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 326 | find_except_wrapper_node_in_scope | ref | function | containing_except_node = utils.find_except_wrapper_node_in_scope(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 338 | add_message | ref | function | self.add_message("raise-missing-from", node=node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 341 | add_message | ref | function | self.add_message("raise-missing-from", node=node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 347 | add_message | ref | function | self.add_message("raise-missing-from", node=node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 349 | _check_catching_non_exception | def | function | def _check_catching_non_exception(self, handler, exc, part):
if isinstance(exc, nodes.Tuple):
# Check if it is a tuple of exceptions.
inferred = [utils.safe_infer(elt) for elt in exc.elts]
if any(node is astroid.Uninferable for node in inferred):
# Don't e... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 352 | safe_infer | ref | function | inferred = [utils.safe_infer(elt) for elt in exc.elts]
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 358 | inherit_from_std_ex | ref | function | and (utils.inherit_from_std_ex(node) or not utils.has_known_bases(node))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 358 | has_known_bases | ref | function | and (utils.inherit_from_std_ex(node) or not utils.has_known_bases(node))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 370 | parent_of | ref | function | ) or handler.type.parent_of(exc):
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 375 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 378 | as_string | ref | function | args=(part.as_string(),),
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 381 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 384 | as_string | ref | function | args=(part.as_string(),),
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 389 | inherit_from_std_ex | ref | function | not utils.inherit_from_std_ex(exc)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 392 | has_known_bases | ref | function | if utils.has_known_bases(exc):
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 393 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 397 | _check_try_except_raise | def | function | def _check_try_except_raise(self, node):
def gather_exceptions_from_handler(
handler,
) -> list[nodes.NodeNG] | None:
exceptions: list[nodes.NodeNG] = []
if handler.type:
exceptions_in_handler = utils.safe_infer(handler.type)
if isi... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 398 | gather_exceptions_from_handler | def | function | def gather_exceptions_from_handler(
handler,
) -> list[nodes.NodeNG] | None:
exceptions: list[nodes.NodeNG] = []
if handler.type:
exceptions_in_handler = utils.safe_infer(handler.type)
if isinstance(exceptions_in_handler, nodes.Tuple):
... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 403 | safe_infer | ref | function | exceptions_in_handler = utils.safe_infer(handler.type)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 428 | gather_exceptions_from_handler | ref | function | excs_in_current_handler = gather_exceptions_from_handler(handler)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 435 | safe_infer | ref | function | inferred_current = utils.safe_infer(exc_in_current_handler)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 437 | is_subclass_of | ref | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/exceptions.py | pylint/checkers/exceptions.py | 437 | safe_infer | ref | class |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.