Skip to content

Commit 2f5f240

Browse files
authored
Create scoped_nodes module (#1302)
1 parent a9f5f97 commit 2f5f240

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
2+
# For details: https://github.com/PyCQA/astroid/blob/main/LICENSE
3+
4+
5+
"""This module contains all classes that are considered a "scoped" node and anything related.
6+
A scope node is a node that opens a new local scope in the language definition:
7+
Module, ClassDef, FunctionDef (and Lambda, GeneratorExp, DictComp and SetComp to some extent).
8+
"""
9+
from astroid.nodes.scoped_nodes.scoped_nodes import (
10+
AsyncFunctionDef,
11+
ClassDef,
12+
ComprehensionScope,
13+
DictComp,
14+
FunctionDef,
15+
GeneratorExp,
16+
Lambda,
17+
ListComp,
18+
LocalsDictNodeNG,
19+
Module,
20+
SetComp,
21+
builtin_lookup,
22+
function_to_method,
23+
get_wrapping_class,
24+
)
25+
26+
__all__ = (
27+
"AsyncFunctionDef",
28+
"ClassDef",
29+
"ComprehensionScope",
30+
"DictComp",
31+
"FunctionDef",
32+
"GeneratorExp",
33+
"Lambda",
34+
"ListComp",
35+
"LocalsDictNodeNG",
36+
"Module",
37+
"SetComp",
38+
"builtin_lookup",
39+
"function_to_method",
40+
"get_wrapping_class",
41+
)

tests/unittest_scoped_nodes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
ResolveError,
5757
TooManyLevelsError,
5858
)
59-
from astroid.nodes.scoped_nodes import _is_metaclass
59+
from astroid.nodes.scoped_nodes.scoped_nodes import _is_metaclass
6060

6161
from . import resources
6262

0 commit comments

Comments
 (0)