Skip to content

Commit 813e9a9

Browse files
auvipypre-commit-ci[bot]adamchainz
authored
Moved slots out of init method (#115)
* Moved slots out of init method * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update vine/synchronization.py Co-authored-by: Adam Johnson <[email protected]> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Adam Johnson <[email protected]>
1 parent c870aa5 commit 813e9a9

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

vine/synchronization.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ def all_done():
3232
Note that you cannot add new promises to a barrier after
3333
the barrier is fulfilled.
3434
"""
35+
__slots__ = (
36+
'p', 'args', 'kwargs', '_value', 'size',
37+
'ready', 'reason', 'cancelled', 'finalized',
38+
'__weakref__',
39+
# adding '__dict__' to get dynamic assignment
40+
"__dict__",
41+
)
3542

3643
def __init__(self, promises=None, args=None, kwargs=None,
3744
callback=None, size=None):
@@ -57,14 +64,6 @@ def __init__(self, promises=None, args=None, kwargs=None,
5764
if callback:
5865
self.then(callback)
5966

60-
__slots__ = ( # noqa
61-
'p', 'args', 'kwargs', '_value', 'size',
62-
'ready', 'reason', 'cancelled', 'finalized',
63-
'__weakref__',
64-
# adding '__dict__' to get dynamic assignment
65-
"__dict__",
66-
)
67-
6867
def __call__(self, *args, **kwargs):
6968
if not self.ready and not self.cancelled:
7069
self._value += 1

0 commit comments

Comments
 (0)