I have a queue of nodes that I need to have an upper and lower bound to them, so I have a named tuple called QueueEntry.
QueueEntry = collections.namedtuple('QueueEntry', ('node', 'lower', 'upper'))
When I instantiate a deque with the named tuple inside a list:
bfs_queue = collections.deque([QueueEntry(node, float('-inf'), float('inf'))])
and not:
bfs_queue = collections.deque(QueueEntry(node, float('-inf'), float('inf')))