diff options
| author | Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> | 2021-12-20 10:12:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-20 10:12:34 +0100 |
| commit | 2f5f2405d18f673560302e2f4e19d672f43c90d9 (patch) | |
| tree | bbff99505d5f7c76ebfb47625b463119a3f83495 | |
| parent | a9f5f97553de75717a472b05b3bbc268ea1e019e (diff) | |
| download | astroid-git-2f5f2405d18f673560302e2f4e19d672f43c90d9.tar.gz | |
Create ``scoped_nodes`` module (#1302)
| -rw-r--r-- | astroid/nodes/scoped_nodes/__init__.py | 41 | ||||
| -rw-r--r-- | astroid/nodes/scoped_nodes/scoped_nodes.py (renamed from astroid/nodes/scoped_nodes.py) | 0 | ||||
| -rw-r--r-- | tests/unittest_scoped_nodes.py | 2 |
3 files changed, 42 insertions, 1 deletions
diff --git a/astroid/nodes/scoped_nodes/__init__.py b/astroid/nodes/scoped_nodes/__init__.py new file mode 100644 index 00000000..261f92f8 --- /dev/null +++ b/astroid/nodes/scoped_nodes/__init__.py @@ -0,0 +1,41 @@ +# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html +# For details: https://github.com/PyCQA/astroid/blob/main/LICENSE + + +"""This module contains all classes that are considered a "scoped" node and anything related. +A scope node is a node that opens a new local scope in the language definition: +Module, ClassDef, FunctionDef (and Lambda, GeneratorExp, DictComp and SetComp to some extent). +""" +from astroid.nodes.scoped_nodes.scoped_nodes import ( + AsyncFunctionDef, + ClassDef, + ComprehensionScope, + DictComp, + FunctionDef, + GeneratorExp, + Lambda, + ListComp, + LocalsDictNodeNG, + Module, + SetComp, + builtin_lookup, + function_to_method, + get_wrapping_class, +) + +__all__ = ( + "AsyncFunctionDef", + "ClassDef", + "ComprehensionScope", + "DictComp", + "FunctionDef", + "GeneratorExp", + "Lambda", + "ListComp", + "LocalsDictNodeNG", + "Module", + "SetComp", + "builtin_lookup", + "function_to_method", + "get_wrapping_class", +) diff --git a/astroid/nodes/scoped_nodes.py b/astroid/nodes/scoped_nodes/scoped_nodes.py index 96a034c8..96a034c8 100644 --- a/astroid/nodes/scoped_nodes.py +++ b/astroid/nodes/scoped_nodes/scoped_nodes.py diff --git a/tests/unittest_scoped_nodes.py b/tests/unittest_scoped_nodes.py index 00ef9862..0aa3e5d7 100644 --- a/tests/unittest_scoped_nodes.py +++ b/tests/unittest_scoped_nodes.py @@ -56,7 +56,7 @@ from astroid.exceptions import ( ResolveError, TooManyLevelsError, ) -from astroid.nodes.scoped_nodes import _is_metaclass +from astroid.nodes.scoped_nodes.scoped_nodes import _is_metaclass from . import resources |
