Addl type hints.
David Blume

David Blume commited on 2021-01-03 23:00:00
Showing 1 changed files, with 3 additions and 3 deletions.

... ...
@@ -12,7 +12,7 @@ import sitesize.sitesize
12 12
 from typing import Optional, Callable
13 13
 
14 14
 
15
-def timeit(f):
15
+def timeit(f: Callable) -> Callable:
16 16
     """Decorator that prints the duration of the decorated function."""
17 17
     @functools.wraps(f)
18 18
     def wrapper(*args, **kwargs):
... ...
@@ -41,11 +41,11 @@ class Coffee:
41 41
         self._price = price
42 42
 
43 43
     @property
44
-    def price(self):
44
+    def price(self) -> float:
45 45
         return self._price
46 46
 
47 47
     @price.setter
48
-    def price(self, new_price: float):
48
+    def price(self, new_price: float) -> None:
49 49
         if new_price > 0 and isinstance(new_price, float):
50 50
             self._price = new_price
51 51
         else:
52 52