Skip to content

Conversation

It is `deque` in `Queue` and `list` in `LifoQueue` and `PriorityQueue`
@sobolevn
Copy link
Member Author

sobolevn commented Feb 7, 2022

Or maybe it can be deque and list directly? 🤔

@github-actions

This comment has been minimized.

@AlexWaygood
Copy link
Member

Title of the PR should say MutableSequence, not MutableMapping ;)

@sobolevn sobolevn changed the title queue.Queue.queue is a MutableMapping queue.Queue.queue is a MutableSequence Feb 7, 2022
@hauntsaninja
Copy link
Collaborator

Hmm, this would be a regression for the #3472 use case

@sobolevn
Copy link
Member Author

sobolevn commented Feb 7, 2022

Yet another problem with CPython's design 😒
We should have some BaseQueue base class, where queue: Any is defined and exact types with exact queue types.

Ok. I will define queue types for LifoQueue and PriorityQueue. Probably, Queue should be Any.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2022

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@JelleZijlstra JelleZijlstra merged commit da1f46a into python:master Feb 8, 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 this pull request may close these issues.

4 participants