_lock = threading.Lock()

@classmethod
def initialize(cls):
    with cls._lock:
        if cls.cache is None:
            cls.cache = load_from_file()

def __init__(self):
    self.initialize()
print(len(MyCache.cache))
Initialize field only once in Python