mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
Fix bug 1604. deque.__init__() did not clear existing contents like list.__init__. Not a backport candidate.
This commit is contained in:
parent
842c178442
commit
adf9ffdfbe
3 changed files with 9 additions and 4 deletions
|
@ -843,6 +843,7 @@ deque_init(dequeobject *deque, PyObject *args, PyObject *kwdargs)
|
|||
}
|
||||
}
|
||||
deque->maxlen = maxlen;
|
||||
deque_clear(deque);
|
||||
if (iterable != NULL) {
|
||||
PyObject *rv = deque_extend(deque, iterable);
|
||||
if (rv == NULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue