We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
1.3 保留最后 N 个元素,讨论部分关于 deque 描述内容:
“使用 deque(maxlen=N) 构造函数会新建一个固定大小的队列。当新的元素加入并且这个队列已满的时候, 最老的元素会自动被移除掉。”
这里“最老的元素”描述有误,比如在固定长度、且 deque 元素满了时,通过 appendleft() 加入新元素后,被移除掉的是队列最右侧的元素;append() 在右侧加入新元素时,移除的是最左侧元素。用“最老的元素”可能会误以为是按加入的先后顺序来移除,产生误会。
On a deque object with fixed length when an element is added at the left side, an element is removed at the right side.
The text was updated successfully, but these errors were encountered:
@pengfexue2 表达确实不太准确,但原文如此
Using deque(maxlen=N) creates a fixed-sized queue. When new items are added and the queue is full, the oldest item is automatically removed.
Sorry, something went wrong.
No branches or pull requests
1.3 保留最后 N 个元素,讨论部分关于 deque 描述内容:
“使用 deque(maxlen=N) 构造函数会新建一个固定大小的队列。当新的元素加入并且这个队列已满的时候, 最老的元素会自动被移除掉。”
这里“最老的元素”描述有误,比如在固定长度、且 deque 元素满了时,通过 appendleft() 加入新元素后,被移除掉的是队列最右侧的元素;append() 在右侧加入新元素时,移除的是最左侧元素。用“最老的元素”可能会误以为是按加入的先后顺序来移除,产生误会。
On a deque object with fixed length when an element is added at the left side, an element is removed at the right side.
The text was updated successfully, but these errors were encountered: