fix: minor collection fixes

This commit is contained in:
Hazel 2024-04-11 16:53:20 +02:00
parent d71c2f19e7
commit bdb4a46c1a

View File

@ -193,7 +193,7 @@ class Collection(Generic[T]):
def _find_object_in_self(self, __object: T) -> Optional[T]:
for name, value in __object.indexing_values:
if value is None:
if value is None or value == __object._default_factories.get(name, lambda: None)():
continue
if value in self._indexed_values[name]:
return self._indexed_to_objects[value][0]