Skip to content

Commit

Permalink
refactor: Rename visitor method
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Nov 13, 2021
1 parent ac86f17 commit 3e0c43c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/griffe/visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ def visit_ImportFrom(self, node) -> None:
# self.scope[self.path][alias.asname or alias.name] = f"{node.module}.{alias.name}"
self.generic_visit(node)

def handle_data(self, node, annotation: str | None = None): # noqa: WPS231
def handle_attribute(self, node, annotation: str | Name | Expression | None = None): # noqa: WPS231
parent = self.current
labels = set()

Expand Down Expand Up @@ -657,7 +657,7 @@ def handle_data(self, node, annotation: str | None = None): # noqa: WPS231
parent[name] = attribute # type: ignore

def visit_Assign(self, node) -> None:
self.handle_data(node)
self.handle_attribute(node)

def visit_AnnAssign(self, node) -> None:
self.handle_data(node, _get_annotation(node))
self.handle_attribute(node, _get_annotation(node.annotation, parent=self.current))

0 comments on commit 3e0c43c

Please sign in to comment.