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 <rep...@bugs.python.org>
<http://bugs.python.org/issue25192>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to