Merge pull request #2025 from Abyss-W4tcher/lazy_iteration_fix

Small optimization: Use "any" to avoid iterating the entire dataclasses.fields list
This commit is contained in:
ikelos
2026-10-12 00:06:35 +01:00
committed by GitHub
+1 -1
View File
@@ -79,7 +79,7 @@ class ObjectInformation:
raise KeyError(f"No {key} present in ObjectInformation")
def __contains__(self, key):
return key in [field.name for field in dataclasses.fields(self)]
return any(field.name == key for field in dataclasses.fields(self))
class ObjectInterface(metaclass=abc.ABCMeta):