From 41dc075b14f6fe60f857e384eb8b480e7cc3b936 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@henrietta.com.pl>
Date: Fri, 4 Jun 2021 18:06:32 +0200
Subject: [PATCH] minor refactor for slots

---
 satella/coding/call_hierarchy.py               | 8 ++++----
 satella/coding/concurrent/thread_collection.py | 2 +-
 satella/coding/deleters.py                     | 2 +-
 satella/coding/expect_exception.py             | 2 +-
 satella/coding/iterators.py                    | 4 ++--
 satella/dao.py                                 | 2 +-
 satella/files.py                               | 2 +-
 satella/time.py                                | 2 +-
 8 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/satella/coding/call_hierarchy.py b/satella/coding/call_hierarchy.py
index d5a39ad6..ba642ccd 100644
--- a/satella/coding/call_hierarchy.py
+++ b/satella/coding/call_hierarchy.py
@@ -49,7 +49,7 @@ class Call:
     """
     A call to given function with a given set of arguments
     """
-    __slots__ = ('fn', 'args', 'kwargs')
+    __slots__ = 'fn', 'args', 'kwargs'
 
     def __init__(self, fn, *args, **kwargs):
         warnings.warn('This module is experimental, use at your own peril', ExperimentalWarning)
@@ -81,7 +81,7 @@ class CallWithArgumentSet(Call):
     """
     Call a function with a set of arguments provided by the environment
     """
-    __slots__ = ('fn', 'arg_set_no')
+    __slots__ = 'fn', 'arg_set_no'
 
     def __init__(self, fn, arg_set_no: int = 0):
         warnings.warn('This module is experimental, use at your own peril', ExperimentalWarning)
@@ -106,7 +106,7 @@ class CallIf(Call):
     """
     Call a function only if fn_if_call returned True
     """
-    __slots__ = ('fn_to_call', 'fn_call_if')
+    __slots__ = 'fn_to_call', 'fn_call_if'
 
     def __init__(self, fn_if_call: Call, fn_to_call: Call):
         warnings.warn('This module is experimental, use at your own peril', ExperimentalWarning)
@@ -135,7 +135,7 @@ class Reduce(Call):
     :param do_parallel: whether try to execute these calls in parallel, if possible.
         Parallel execution will be done only if an executor is given in the execution environment.
     """
-    __slots__ = ('reducing_op', 'starting_value', 'do_parallel', 'callables')
+    __slots__ = 'reducing_op', 'starting_value', 'do_parallel', 'callables'
 
     def __init__(self, *callables: Call,
                  reducing_op: tp.Callable[[tp.Any, tp.Any], tp.Any] = lambda a, b: None,
diff --git a/satella/coding/concurrent/thread_collection.py b/satella/coding/concurrent/thread_collection.py
index ef3e275d..b4c5aade 100644
--- a/satella/coding/concurrent/thread_collection.py
+++ b/satella/coding/concurrent/thread_collection.py
@@ -23,7 +23,7 @@ class ThreadCollection:
     length check.
     """
 
-    __slots__ = ('threads', )
+    __slots__ = 'threads',
 
     def __len__(self):
         return len(self.threads)
diff --git a/satella/coding/deleters.py b/satella/coding/deleters.py
index 686fc5d3..995fea49 100644
--- a/satella/coding/deleters.py
+++ b/satella/coding/deleters.py
@@ -113,7 +113,7 @@ class ListDeleter(tp.Generic[T]):
 
     You can pass any type of object here, as long as it supports pop(position) and __getitem__
     """
-    __slots__ = ('list_to_process', 'current_index', 'indices_to_delete', 'direction')
+    __slots__ = 'list_to_process', 'current_index', 'indices_to_delete', 'direction'
 
     def __init__(self, list_to_process: tp.MutableSequence[T]):
         self.list_to_process = list_to_process
diff --git a/satella/coding/expect_exception.py b/satella/coding/expect_exception.py
index f22187c7..2353f2dc 100644
--- a/satella/coding/expect_exception.py
+++ b/satella/coding/expect_exception.py
@@ -19,7 +19,7 @@ class expect_exception:
     :param args: args to provide to constructor
     :param kwargs: kwargs to provide to constructor
     """
-    __slots__ = ('exc_to_except', 'else_raise', 'else_raise_args', 'else_raise_kwargs')
+    __slots__ = 'exc_to_except', 'else_raise', 'else_raise_args', 'else_raise_kwargs'
 
     def __init__(self, exc_to_except: ExceptionList, else_raise: tp.Type[Exception],
                  *args, **kwargs):
diff --git a/satella/coding/iterators.py b/satella/coding/iterators.py
index 88932179..2fa23658 100644
--- a/satella/coding/iterators.py
+++ b/satella/coding/iterators.py
@@ -47,7 +47,7 @@ class SelfClosingGenerator:
     You can also use it as a context manager, to decouple finalizing the generator from the GC
     collection
     """
-    __slots__ = ('generator', 'stopped')
+    __slots__ = 'generator', 'stopped'
 
     def __init__(self, generator: tp.Union[tp.Generator, tp.Callable[[tp.Any], tp.Generator]]):
         self.generator = generator
@@ -103,7 +103,7 @@ class hint_with_length:
     You must provide either length or length_factory. Giving them both is wrong, and
     will result in ValueError
     """
-    __slots__ = ('generator', 'length', 'length_factory')
+    __slots__ = 'generator', 'length', 'length_factory'
 
     def __init__(self, generator: tp.Generator, length: tp.Optional[int],
                  length_factory: tp.Optional[NoArgCallable[int]] = None):
diff --git a/satella/dao.py b/satella/dao.py
index 5f5551fa..207d8b6d 100644
--- a/satella/dao.py
+++ b/satella/dao.py
@@ -15,7 +15,7 @@ class Loadable(metaclass=ABCMeta):
     If False, you will need to load it on-demand via :func:`must_be_loaded` decorator.
     """
 
-    __slots__ = ('_loaded',)
+    __slots__ = '_loaded',
 
     def __init__(self, load_lazy: bool = False):
         self._loaded = False
diff --git a/satella/files.py b/satella/files.py
index 6f6c1b69..cd38ebc1 100644
--- a/satella/files.py
+++ b/satella/files.py
@@ -20,7 +20,7 @@ class DevNullFilelikeObject:
     """
     A /dev/null filelike object. For multiple uses.
     """
-    __slots__ = ('is_closed',)
+    __slots__ = 'is_closed',
 
     def __init__(self):
         self.is_closed = False
diff --git a/satella/time.py b/satella/time.py
index 9808045e..58d8f143 100644
--- a/satella/time.py
+++ b/satella/time.py
@@ -339,7 +339,7 @@ class ExponentialBackoff:
     :param sleep_fun: function used to sleep. Will accept a single argument - number of
         seconds to wait
     """
-    __slots__ = ('start', 'limit', 'counter', 'sleep_fun')
+    __slots__ = 'start', 'limit', 'counter', 'sleep_fun'
 
     def __init__(self, start: float = 1, limit: float = 30,
                  sleep_fun: tp.Callable[[float], None] = sleep):
-- 
GitLab