kombu icon indicating copy to clipboard operation
kombu copied to clipboard

Use another augmented assignment statement

Open elfring opened this issue 3 years ago • 3 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/kombu/common.py b/kombu/common.py
index 08bc1aff..6b44d94c 100644
--- a/kombu/common.py
+++ b/kombu/common.py
@@ -399,7 +399,7 @@ class QoS:
         """
         with self._mutex:
             if self.value:
-                self.value = self.value + max(n, 0)
+                self.value += max(n, 0)
         return self.value
 
     def decrement_eventually(self, n=1):

elfring avatar Nov 02 '21 09:11 elfring

Hey @elfring :wave:, Thank you for opening an issue. We will get back to you as soon as we can. Also, check out our Open Collective and consider backing us - every little helps!

We also offer priority support for our sponsors. If you require immediate assistance please consider sponsoring us.

@elfring thank you issue. Definitely make sense. PR is highly welcome.

matusvalo avatar Nov 05 '21 20:11 matusvalo

:thought_balloon: How will the chances evolve to adjust one assignment statement directly?

elfring avatar Nov 06 '21 09:11 elfring