tobgu / pyrsistent

Persistent/Immutable/Functional data structures for Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing positional argument "stop" in call to "delete" of "PVector"

dscrofts opened this issue · comments

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]: ...

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...

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!