From 3af51feb33c2e76e57e852aa6ce7eb6e35ccc736 Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Tue, 18 Oct 2022 10:25:47 -0700 Subject: [PATCH] Better explain what the heck is going on in deferred_operand.py. --- src/pyutils/parallelize/deferred_operand.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pyutils/parallelize/deferred_operand.py b/src/pyutils/parallelize/deferred_operand.py index 2260b29..b06d23a 100644 --- a/src/pyutils/parallelize/deferred_operand.py +++ b/src/pyutils/parallelize/deferred_operand.py @@ -36,6 +36,16 @@ class DeferredOperand(ABC, Generic[T]): """ def __init__(self, local_attributes: Set[str] = None): + """ + Args: + local_attributes: because this class attempts to act as a + transparent wrapper around a normal Future, it needs + to be able to differentiate between attempts to set a + property of it/its subclasses or the wrapped object. + The local_attributes argument is a set of names that, + if we intercept a set operation for, refer to an + attribute in the wrapper and not the wrapped class. + """ self.__dict__['local_attributes'] = local_attributes @abstractmethod -- 2.46.0