faust icon indicating copy to clipboard operation
faust copied to clipboard

Increase the usage of augmented assignment statements

Open elfring opened this issue 4 years ago • 0 comments

:eyes: Some source code analysis tools can help to find opportunities for improving software components. :thought_balloon: I propose to increase the usage of augmented assignment statements accordingly.

diff --git a/faust/livecheck/signals.py b/faust/livecheck/signals.py
index 541ad702..ec03ba3a 100644
--- a/faust/livecheck/signals.py
+++ b/faust/livecheck/signals.py
@@ -166,7 +166,7 @@ class Signal(BaseSignal[VT]):
         # If not, wait for it to arrive.
         while not app.should_stop:
             if remaining is not None:
-                remaining = remaining - (monotonic() - time_start)
+                remaining -= monotonic() - time_start
             try:
                 if remaining is not None and remaining <= 0.0:
                     try:
diff --git a/faust/models/typing.py b/faust/models/typing.py
index 795925a3..16ae66c0 100644
--- a/faust/models/typing.py
+++ b/faust/models/typing.py
@@ -193,7 +193,7 @@ class Variable:
         name = self.name
         next_ord = ord(name[-1]) + 1
         if next_ord > 122:
-            name = name + 'a'
+            name += 'a'
         return self.clone(
             name=name[:-1] + chr(next_ord),
             getitem=None,

elfring avatar Nov 02 '21 09:11 elfring