From e1c2ef0cd464613d920e5da88adb60063374d6a4 Mon Sep 17 00:00:00 2001 From: Korijn van Golen Date: Mon, 8 Jan 2024 14:03:17 +0100 Subject: [PATCH] remove some todos --- observ/object_proxy.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/observ/object_proxy.py b/observ/object_proxy.py index 83de537..886c70c 100644 --- a/observ/object_proxy.py +++ b/observ/object_proxy.py @@ -51,7 +51,6 @@ def __setattr__(self, name, value): # the set attr is not stateful (e.g. someone # is attaching a bound method) # so no need to track this modification - # TODO: we could cache this? return retval new_value = getattr(target, name, None) @@ -87,8 +86,8 @@ def passthrough(method): def trap(self, *args, **kwargs): fn = getattr(self.__target__, method, None) if fn is None: - # TODO: we could cache this - # but it is possible a class is dynamically modified later + # we don't cache this + # since it is possible a class is dynamically modified later # invalidating the cached result... raise TypeError(f"object of type '{type(self)}' has no {method}") return fn(*args, **kwargs)