add clarification that tasks must be hashable, a slight improvement to issue #121

This commit is contained in:
Mahmoud Hashemi 2018-03-01 23:35:48 -08:00
parent e2c7b18a7b
commit ffbeaffb6b
1 changed files with 4 additions and 3 deletions

View File

@ -93,9 +93,10 @@ class BasePriorityQueue(object):
pass # abstract
def add(self, task, priority=None):
"""Add a task to the queue, or change the *task*'s priority if
*task* is already in the queue. *task* can be any type, and
*priority* defaults to ``0``. Higher values representing
"""
Add a task to the queue, or change the *task*'s priority if *task*
is already in the queue. *task* can be any hashable object,
and *priority* defaults to ``0``. Higher values representing
higher priority, but this behavior can be controlled by
setting *priority_key* in the constructor.
"""