Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

Commit

Permalink
fix: mypy linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukarade committed Dec 19, 2023
1 parent e788ae5 commit 8e7f814
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class PurityResult(ABC):
def update(self, other: PurityResult) -> PurityResult:
return self._update(other)

def _update(self, other: PurityResult) -> PurityResult:
def _update(self, other: PurityResult) -> PurityResult | None:
"""Update the current result with another result.
Parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ def is_leaf(self) -> bool:
class CallGraphForest:
graphs: dict[str, CallGraphNode] = field(default_factory=dict)

def add_graph(self, graph_name, graph) -> None:
def add_graph(self, graph_name: str, graph: CallGraphNode) -> None:
self.graphs[graph_name] = graph

def get_graph(self, graph_name) -> CallGraphNode:
def get_graph(self, graph_name: str) -> CallGraphNode | None:
return self.graphs.get(graph_name)

def delete_graph(self, graph_name) -> None:
def delete_graph(self, graph_name: str) -> None:
del self.graphs[graph_name]
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,6 @@ class FunctionScope(Scope):
values: list[Scope | ClassScope] = field(default_factory=list)
calls: list[Scope | ClassScope] = field(default_factory=list)

def __getitem__(self, item) -> Scope | ClassScope:
return self.values[item]

def remove_call_node_by_name(self, name: str) -> None:
for call in self.calls:
if call.symbol.name == name:
Expand Down

0 comments on commit 8e7f814

Please sign in to comment.