[New-bugs-announce] [issue25192] deque append and appendleft should return value if maxlen set

Alun Champion report at bugs.python.org
Sun Sep 20 10:36:22 CEST 2015


New submission from Alun Champion:

Currently if you append or appendleft when len(deque) == maxlen item from the other end of the deque is discarded. These should return the discarded value to allow you to write:

    x = deque.append(y)

vs

    if len(deque) == deque.maxlen():
        x = deque.pop()
    deque.append(y)

It should return None if len(deque) < maxlen or maxlen is not set.

----------
components: Library (Lib)
messages: 251154
nosy: Alun Champion
priority: normal
severity: normal
status: open
title: deque append and appendleft should return value if maxlen set

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25192>
_______________________________________


More information about the New-bugs-announce mailing list