diff --git a/vine/synchronization.py b/vine/synchronization.py index 77c80a3..539a5fc 100644 --- a/vine/synchronization.py +++ b/vine/synchronization.py @@ -32,6 +32,13 @@ def all_done(): Note that you cannot add new promises to a barrier after the barrier is fulfilled. """ + __slots__ = ( + 'p', 'args', 'kwargs', '_value', 'size', + 'ready', 'reason', 'cancelled', 'finalized', + '__weakref__', + # adding '__dict__' to get dynamic assignment + "__dict__", + ) def __init__(self, promises=None, args=None, kwargs=None, callback=None, size=None): @@ -57,14 +64,6 @@ def __init__(self, promises=None, args=None, kwargs=None, if callback: self.then(callback) - __slots__ = ( # noqa - 'p', 'args', 'kwargs', '_value', 'size', - 'ready', 'reason', 'cancelled', 'finalized', - '__weakref__', - # adding '__dict__' to get dynamic assignment - "__dict__", - ) - def __call__(self, *args, **kwargs): if not self.ready and not self.cancelled: self._value += 1