Addon RuntimeError cannot import name function

I am creating an addon for blender but in blender 4.2.1 on mac os Sonoma 14.6.1, but i get the following error:


this is my function in libs/functions/basics.py:

def append_function_unique(fn_list, fn):

    """ 
        Appending 'fn' to 'fn_list',
        Remove any functions from with a matching name & module.
    """
    
    fn_name = fn.__name__ 
    fn_module = fn.__module__
    for i in range(len(fn_list) - 1, -1, -1):
        if fn_list[i].__name__ == fn_name and fn_list[i].__module__ == fn_module:
            del fn_list[i]
    fn_list.append(fn)

Can anyone think of what might be going on?
on linux if it seems to be working fine.