def add(task, priority=0):
        'Add a new task or update the priority of an existing task'
        nonlocal count
        if task in entry_finder:
            remove(task)
        entry = [priority, count, task]
        entry_finder[task] = entry
        heappush(pq, entry)
        count += 1
Add a new task or update the priority of an existing task
recipes/Python/578091_Simple_tool_simulating_classes_using_closures/recipe-578091.py