diff --git a/satella/coding/call_hierarchy.py b/satella/coding/call_hierarchy.py index d5a39ad6896f64ba956ce26a46db55a4282ffdb4..ba642ccdaab64a87807a0b1f2ef7c0ea3b4bab06 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 ef3e275d9a989355d77ac9e5a8d9d97c7db1a5bb..b4c5aadedce04fa68c8d760b7824589f31a77a41 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 686fc5d37655e845da1835b20a56c426563828a0..995fea49f010a6f340d8d217d785d7fa87361667 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 f22187c7b6b6f2cfca86c3da65185d1a07136b2c..2353f2dcff0c99a1cd8e14a76c50ed81dfb2fc45 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 88932179701b7cc3f5ca7bc5389e9192420b9e65..2fa23658494df1c5ef2931f88b03f555fc6b9a09 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 5f5551fa95bc0c7060ad1a90039da48de920cb5f..207d8b6dac17d7eebe0dcd583692a3d90d39fd7a 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 6f6c1b69f8fcc2c6f029a2eedaa30165bd2234d1..cd38ebc1765ae4edd3d9f98f1e822db64754571f 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 9808045e13928f00e42910bba690c1a3945d7cdb..58d8f143e55e3ff0b4b131bdaffc009add75883d 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):