robinhood / faust

Python Stream Processing
Other
6.7k stars 538 forks source link

Increase the usage of augmented assignment statements #741

Open elfring opened 2 years ago

elfring commented 2 years ago

: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,