Remove or edit item from Python queue

I have a Python queue in which I add items in a thread like so

import queue
import threading

_myQueue = queue.Queue()

threading.Thread(target=worker, daemon=True).start()

def worker():
    while True:
        item = _myQueue.get()
        # Do something with this item
        _myQueue.task_done()

def add_item(item):
    _myQueue.put(item)

My question is am I able to edit or delete items from this queue while my worker thread is doing something between _myQueue.get() and _myQueue.task_done():

item = _myQueue.get()
# Do something with this item
_myQueue.task_done()

For example if an item is ‘cancelled’ and no longer needs processed.

The “get” operation on a queue removes the item from the queue. A qsize() call should tell you how many items are currently in the queue. Add that call in your loop after the “get” operation and print it to the console so you can verify.

Once you have a reference to the queue item you can edit it or perform transformations.

Is this not what you are observing?