Missing positional argument "stop" in call to "delete" of "PVector"
dscrofts opened this issue · comments
dscrofts commented
When using pyrsistent.typing
and PVector
, mypy (version 0.931) gives the following error:
Missing positional argument "stop" in call to "delete" of "PVector"
Here is a minimal example to reproduce the issue:
from pyrsistent import pvector
from pyrsistent.typing import PVector
p1: PVector = pvector([1, 2, 3])
p2: PVector = p1.delete(0) # Missing positional argument "stop" in call to "delete" of "PVector"
Changing line 71 in typing.pyi
to have a default optional argument of None
seems to fix the error:
71: - def delete(self, index: int, stop: Optional[int]) -> PVector[T]: ...
71: + def delete(self, index: int, stop: Optional[int] = None) -> PVector[T]: ...
Tobias Gustafsson commented
OK! Do you want to put up a tiny PR for it or should I go ahead and make the change Seems reasonable to me. Sorry for the delay in responding...
dscrofts commented
OK! Do you want to put up a tiny PR for it or should I go ahead and make the change Seems reasonable to me. Sorry for the delay in responding...
Done!