feat: cleaned up the previous fix

This commit is contained in:
Hazel 2024-04-15 14:12:26 +02:00
parent a5ede2a6ad
commit eec252cb16

View File

@ -29,7 +29,7 @@ class InnerData:
_refers_to_instances: set = None
def __init__(self, object_type, **kwargs):
self._refers_to_instances = set()
self._refers_to_instances =set()
# initialize the default values
self.__default_values = {}
@ -105,6 +105,8 @@ class OuterProxy:
self._fetched_from: dict = {}
self._inner: InnerData = InnerData(type(self), **kwargs)
self._inner._refers_to_instances.add(self)
self.__init_collections__()
for name, data_list in collection_data.items():
@ -191,15 +193,10 @@ class OuterProxy:
a, b = b, a
a._inner.__merge__(b._inner, override=override)
a._inner._refers_to_instances.update(b._inner._refers_to_instances)
if len(b._inner._refers_to_instances) > 1:
for instance in b._inner._refers_to_instances:
instance._inner = a._inner
b._inner = a._inner
b._inner._refers_to_instances.add(a)
b._inner._refers_to_instances.add(b)
for instance in b._inner._refers_to_instances:
instance._inner = a._inner
def mark_as_fetched(self, *url_hash_list: List[str]):
for url_hash in url_hash_list: