[issue36049] No __repr__() for queue.PriorityQueue and queue.LifoQueue

Stéphane Wirtel report at bugs.python.org
Wed Feb 20 05:37:19 EST 2019


Stéphane Wirtel <stephane at wirtel.be> added the comment:

>>> from collections import deque
>>> d = deque()
>>> d.append('j')
>>> d.appendleft('f')
>>> d
deque(['f', 'j'])
>>> repr(d)
"deque(['f', 'j'])"

Maybe there is a solution,

in the code of deque_repr, we convert the deque to a list. We could do the same thing and take the first and the last element.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36049>
_______________________________________


More information about the Python-bugs-list mailing list