Skip to content

Commit

Permalink
Fix mypy Python 3.8 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jvdwetering committed Oct 22, 2024
1 parent ff12e2c commit 7d7a38c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyzx/graph/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ def to_tikz(self,draw_scalar:bool=False) -> str:
return to_tikz(self,draw_scalar)

@classmethod
def from_json(cls, js:str|dict[str,Any]) -> 'BaseGraph':
def from_json(cls, js:Union[str,Dict[str,Any]]) -> 'BaseGraph':
"""Converts the given .qgraph json string into a Graph.
Works with the output of :meth:`to_json`."""
from .jsonparser import json_to_graph
Expand Down
2 changes: 1 addition & 1 deletion pyzx/graph/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def apply_diff(self,g: BaseGraph[VT,ET]) -> BaseGraph[VT,ET]:

return g

def to_dict(self) -> dict[str, Any]:
def to_dict(self) -> Dict[str, Any]:
changed_edge_types_str_dict = {}
for key, value in self.changed_edge_types.items():
changed_edge_types_str_dict[f"{key[0]},{key[1]}"] = value # type: ignore
Expand Down

0 comments on commit 7d7a38c

Please sign in to comment.