def METHOD_NAME(_, idt=idt):
    # When the thread is deleted, remove the local dict.
    # Note that this is suboptimal if the thread object gets
    # caught in a reference loop. We would like to be called
    # as soon as the OS-level thread ends instead.
    local = wrlocal()
    if local is not None:
        dct = local.dicts.pop(idt)