Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase the usage of augmented assignment statements #741

Open
elfring opened this issue Nov 2, 2021 · 0 comments
Open

Increase the usage of augmented assignment statements #741

elfring opened this issue Nov 2, 2021 · 0 comments

Comments

@elfring
Copy link

elfring commented Nov 2, 2021

👀 Some source code analysis tools can help to find opportunities for improving software components.
💭 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,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant