@@ -126,13 +126,15 @@ def __init__(
126
126
127
127
self .end_col_offset : int | None = end_col_offset
128
128
"""The end column this node appears on in the source code.
129
+
129
130
Note: This is after the last symbol.
130
131
"""
131
132
132
133
self .position : Position | None = None
133
- """Position of keyword(s) and name. Used as fallback for block nodes
134
- which might not provide good enough positional information.
135
- E.g. ClassDef, FunctionDef.
134
+ """Position of keyword(s) and name.
135
+
136
+ Used as fallback for block nodes which might not provide good
137
+ enough positional information. E.g. ClassDef, FunctionDef.
136
138
"""
137
139
138
140
def infer (
@@ -262,7 +264,7 @@ def get_children(self) -> Iterator[NodeNG]:
262
264
yield from ()
263
265
264
266
def last_child (self ) -> NodeNG | None :
265
- """An optimized version of list(get_children())[-1]"""
267
+ """An optimized version of list(get_children())[-1]. """
266
268
for field in self ._astroid_fields [::- 1 ]:
267
269
attr = getattr (self , field )
268
270
if not attr : # None or empty list / tuple
@@ -349,6 +351,7 @@ def frame(
349
351
350
352
def scope (self ) -> nodes .LocalsDictNodeNG :
351
353
"""The first parent node defining a new scope.
354
+
352
355
These can be Module, FunctionDef, ClassDef, Lambda, or GeneratorExp nodes.
353
356
354
357
:returns: The first parent scope node.
@@ -591,7 +594,7 @@ def _infer_name(self, frame, name):
591
594
def _infer (
592
595
self , context : InferenceContext | None = None , ** kwargs : Any
593
596
) -> Generator [InferenceResult , None , InferenceErrorInfo | None ]:
594
- """we don't know how to resolve a statement by default"""
597
+ """We don't know how to resolve a statement by default. """
595
598
# this method is overridden by most concrete classes
596
599
raise InferenceError (
597
600
"No inference function for {node!r}." , node = self , context = context
@@ -696,7 +699,9 @@ def _repr_tree(node, result, done, cur_indent="", depth=1):
696
699
@_repr_tree .register (tuple )
697
700
@_repr_tree .register (list )
698
701
def _repr_seq (node , result , done , cur_indent = "" , depth = 1 ):
699
- """Outputs a representation of a sequence that's contained within an AST."""
702
+ """Outputs a representation of a sequence that's contained within an
703
+ AST.
704
+ """
700
705
cur_indent += indent
701
706
result .append ("[" )
702
707
if not node :
0 commit comments