[New-bugs-announce] [issue42201] Priority queue realization issue

Даниил Ляхов report at bugs.python.org
Fri Oct 30 02:40:34 EDT 2020


New submission from Даниил Ляхов <dupeljan at gmail.com>:

In Priority queue realization in docs https://docs.python.org/3/library/heapq.html there is no appointments that priority can be equal and the task can have different type. For example, if you store number of graph node in your priority queue, than it is possible to get "TypeError: '<' not supported between instances of 'int' and 'str'", because inside heappop there is comparison between elements, and if the fist elements the same, than it compare tasks, which can be tagged as removed and has '<removed-task>' value as opposed to number of node, which is int.

----------
assignee: docs at python
components: Documentation
messages: 379922
nosy: docs at python, dupeljan
priority: normal
severity: normal
status: open
title: Priority queue realization issue
type: behavior
versions: Python 3.9

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


More information about the New-bugs-announce mailing list