Skip to content

Commit 6eb2ea0

Browse files
committed
fix(mypy): fix type errs
1 parent 78689b3 commit 6eb2ea0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sphinx_autodoc_vyper/parser.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,14 @@ def __post_init__(self) -> None:
5151
if self.type not in VALID_VYPER_TYPES:
5252
logger.warning(f"{self} is not a valid Vyper type")
5353

54+
Type = Union[str, Tuple, DynArray]
5455

5556
@dataclass
5657
class Parameter:
5758
"""Function parameter representation."""
5859

5960
name: str
60-
type: str
61+
type: Type
6162

6263
def __post_init__(self) -> None:
6364
if self.type.startswith("DynArray"):
@@ -67,7 +68,7 @@ def __post_init__(self) -> None:
6768
self.type = DynArray(type, int(max_length))
6869
except ValueError:
6970
# TODO: include type and value info
70-
constant = Constant(name=max_length.strip(), type=None, value=None)
71+
constant = Constant(name=max_length.strip(), type=None, value=None) # type: ignore [arg-type]
7172
self.type = DynArray(type, constant)
7273
elif self.type not in VALID_VYPER_TYPES:
7374
logger.warning(f"{self} is not a valid Vyper type")
@@ -87,7 +88,7 @@ class Function:
8788

8889
name: str
8990
params: List[Parameter]
90-
return_type: Optional[str]
91+
return_type: Optional[Type]
9192
docstring: Optional[str]
9293

9394
def __post_init__(self) -> None:

0 commit comments

Comments
 (0)