From 1b20d3bf142486d769dac68645ce683575f582c5 Mon Sep 17 00:00:00 2001
From: Piotr Maslanka <piotr.maslanka@ericsson.com>
Date: Mon, 4 Mar 2024 15:17:30 +0100
Subject: [PATCH] fix docs

Change-Id: Ib40568bd0795538a20de855873d8c49f53bb9068
---
 satella/coding/concurrent/timer.py |  7 +++----
 satella/coding/concurrent/value.py | 13 +++++--------
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/satella/coding/concurrent/timer.py b/satella/coding/concurrent/timer.py
index bdc5a3eb..0b990103 100644
--- a/satella/coding/concurrent/timer.py
+++ b/satella/coding/concurrent/timer.py
@@ -20,17 +20,16 @@ class Timer:
 
     There might be up to a second of delay before the timer is picked up.
 
-    If spawn_separate is False, exceptions will be logged
+n     If spawn_separate is False, exceptions will be logged.
 
-    :param interval: amount of seconds that should elapsed between calling start() and function
+    :param interval: amount of seconds that should elapse between calling start() and function
         executing. Can be also a time string.
     :param function: function to execute
     :param args: argument for function
     :param kwargs: kwargs for function
     :param spawn_separate: whether to call the function in a separate thread
     """
-    __slots__ = ('args', 'kwargs', 'spawn_separate', 'interval',
-                 'function', 'execute_at', 'cancelled')
+    __slots__ = 'args', 'kwargs', 'spawn_separate', 'interval', 'function', 'execute_at', 'cancelled'
 
     def __init__(self, interval: tp.Union[str, float], function, args=None, kwargs=None,
                  spawn_separate=False):
diff --git a/satella/coding/concurrent/value.py b/satella/coding/concurrent/value.py
index 2bd1de4f..71bd9be8 100644
--- a/satella/coding/concurrent/value.py
+++ b/satella/coding/concurrent/value.py
@@ -2,14 +2,11 @@ import time
 import typing as tp
 from threading import Event
 
+from satella.coding.misc import _BLANK
 from satella.coding.typing import T
 from satella.exceptions import WouldWaitMore
 
 
-class _UNSET:
-    pass
-
-
 class DeferredValue(tp.Generic[T]):
     """
     A class that allows you to pass arguments that will be available later during runtime.
@@ -29,7 +26,7 @@ class DeferredValue(tp.Generic[T]):
 
     def __init__(self):
         self.lock = Event()
-        self.val = _UNSET
+        self.val = _BLANK
 
     def set_value(self, va: T) -> None:
         """
@@ -38,7 +35,7 @@ class DeferredValue(tp.Generic[T]):
         :param va: value to set
         :raises ValueError: value is already set
         """
-        if self.val is not _UNSET:
+        if self.val is not _BLANK:
             raise ValueError('Value curently set!')
         self.val = va
         self.lock.set()
@@ -49,13 +46,13 @@ class DeferredValue(tp.Generic[T]):
 
     def value(self, timeout: tp.Optional[float] = None) -> T:
         """
-        Wait until value is available.
+        Wait until value is available, and return it.
 
         :param timeout: number of seconds to wait. If None is given, this will take as long as necessary.
         :return: a value
         :raises WouldWaitMore: timeout was given and it has expired
         """
-        if self.val is not _UNSET:
+        if self.val is not _BLANK:
             return self.val
         tout = self.lock.wait(timeout)
         if not tout:
-- 
GitLab