Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dscrofts opened this issue Feb 24, 2022 · 2 comments · Fixed by #246
Closed

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

dscrofts opened this issue Feb 24, 2022 · 2 comments · Fixed by #246

Comments

@dscrofts
Copy link
Contributor

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]: ...
@tobgu
Copy link
Owner

tobgu commented Apr 6, 2022

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 added a commit to dscrofts/pyrsistent that referenced this issue Apr 7, 2022
@dscrofts
Copy link
Contributor Author

dscrofts commented Apr 7, 2022

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!

@tobgu tobgu closed this as completed in #246 Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants