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

Deque.pop() takes no arguments #4364

Closed
KmolYuan opened this issue Jul 26, 2020 · 4 comments · Fixed by #4367
Closed

Deque.pop() takes no arguments #4364

KmolYuan opened this issue Jul 26, 2020 · 4 comments · Fixed by #4367
Labels
stubs: false negative Type checkers do not report an error, but should

Comments

@KmolYuan
Copy link

According to:
https://docs.python.org/3.8/library/collections.html#collections.deque.pop
But still an argument "i" there:
https://github.com/python/typeshed/blob/master/stdlib/3/collections/__init__.pyi#L215

@hauntsaninja
Copy link
Collaborator

Good spot, PR welcome. One issue is that MutableSequence's pop takes an argument (https://github.com/python/cpython/blob/3.8/Lib/_collections_abc.py#L985), so you might run into issues or need to type ignore incompatible override complaints

@srittau srittau added size-small stubs: false positive Type checkers report false errors stubs: false negative Type checkers do not report an error, but should and removed stubs: false positive Type checkers report false errors labels Jul 26, 2020
@Akuli
Copy link
Collaborator

Akuli commented Jul 27, 2020

I wonder if deque.pop(index) is supposed to raise an exception. You can del deque[index], for example, so why would deque.pop(index) be unsupported, other than by accident?

srittau added a commit to srittau/typeshed that referenced this issue Jul 27, 2020
JelleZijlstra pushed a commit that referenced this issue Jul 27, 2020
@JelleZijlstra
Copy link
Member

@Akuli that does sound accidental; feel free to submit an issue to CPython.

@Akuli
Copy link
Collaborator

Akuli commented Jul 27, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stubs: false negative Type checkers do not report an error, but should
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants