Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8b7802c

Browse files
committed
Add end line and column for the function definition itself
1 parent 707e4aa commit 8b7802c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

mypy/nodes.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ class FuncDef(FuncItem, SymbolNode, Statement):
750750
# Present only when a function is decorated with @typing.datasclass_transform or similar
751751
"dataclass_transform_spec",
752752
"docstring",
753+
"def_end_line",
754+
"def_end_column",
753755
)
754756

755757
__match_args__ = ("name", "arguments", "type", "body")
@@ -778,6 +780,9 @@ def __init__(
778780
self.is_mypy_only = False
779781
self.dataclass_transform_spec: DataclassTransformSpec | None = None
780782
self.docstring: str | None = None
783+
# track the end of the function definition itself
784+
self.def_end_line: int | None = None
785+
self.def_end_column: int | None = None
781786

782787
@property
783788
def name(self) -> str:

0 commit comments

Comments
 (0)