From 049f4581c7387e017fb35d0a5d83f4672d0a250e Mon Sep 17 00:00:00 2001 From: Asif Saif Uddin Date: Mon, 26 Aug 2024 13:43:00 +0600 Subject: [PATCH 1/3] Moved slots out of init method --- vine/synchronization.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/vine/synchronization.py b/vine/synchronization.py index 77c80a3..115778b 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__ = ( # noqa + '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 From ed260fca55f302e615cf280f89d826675b379af2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 07:43:23 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- vine/synchronization.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vine/synchronization.py b/vine/synchronization.py index 115778b..139f363 100644 --- a/vine/synchronization.py +++ b/vine/synchronization.py @@ -32,7 +32,7 @@ def all_done(): Note that you cannot add new promises to a barrier after the barrier is fulfilled. """ - __slots__ = ( # noqa + __slots__ = ( 'p', 'args', 'kwargs', '_value', 'size', 'ready', 'reason', 'cancelled', 'finalized', '__weakref__', From 7cadaf183c903058f295269e0405e2b61248ec5f Mon Sep 17 00:00:00 2001 From: Asif Saif Uddin Date: Tue, 27 Aug 2024 14:26:39 +0600 Subject: [PATCH 3/3] Update vine/synchronization.py Co-authored-by: Adam Johnson --- vine/synchronization.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vine/synchronization.py b/vine/synchronization.py index 139f363..539a5fc 100644 --- a/vine/synchronization.py +++ b/vine/synchronization.py @@ -33,12 +33,12 @@ def all_done(): the barrier is fulfilled. """ __slots__ = ( - 'p', 'args', 'kwargs', '_value', 'size', - 'ready', 'reason', 'cancelled', 'finalized', - '__weakref__', - # adding '__dict__' to get dynamic assignment - "__dict__", - ) + '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):