summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMarc Mueller <30130371+cdce8p@users.noreply.github.com>2021-08-17 22:19:04 +0200
committerGitHub <noreply@github.com>2021-08-17 22:19:04 +0200
commit6e2dbbf4630c97c2fa7dc36dcb29c7501221acd6 (patch)
tree4fbb8b6d843e095a34f89c40b993d50c6a61c2c3 /examples
parentef72cdc6f9b96ea680d6a9d0f37861f80d6bc3db (diff)
downloadpylint-git-6e2dbbf4630c97c2fa7dc36dcb29c7501221acd6.tar.gz
Use alias for astroid.nodes 01 (#4855)
* Use from astroid import nodes * Resolve name conflicts
Diffstat (limited to 'examples')
-rw-r--r--examples/custom.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/examples/custom.py b/examples/custom.py
index 7ee97bb5f..bd9797e2a 100644
--- a/examples/custom.py
+++ b/examples/custom.py
@@ -1,4 +1,4 @@
-import astroid
+from astroid import nodes
from pylint.checkers import BaseChecker
from pylint.interfaces import IAstroidChecker
@@ -45,17 +45,16 @@ class MyAstroidChecker(BaseChecker):
),
)
- def visit_call(self, node):
- """Called when a :class:`.astroid.node_classes.Call` node is visited.
+ def visit_call(self, node: nodes.Call) -> None:
+ """Called when a :class:`.nodes.Call` node is visited.
See :mod:`astroid` for the description of available nodes.
:param node: The node to check.
- :type node: astroid.node_classes.Call
"""
if not (
- isinstance(node.func, astroid.Attribute)
- and isinstance(node.func.expr, astroid.Name)
+ isinstance(node.func, nodes.Attribute)
+ and isinstance(node.func.expr, nodes.Name)
and node.func.expr.name == self.config.store_locals_indicator
and node.func.attrname == "create"
):