python-dependency-injector icon indicating copy to clipboard operation
python-dependency-injector copied to clipboard

Increase the usage of augmented assignment statements

Open elfring opened this issue 3 years ago • 2 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/tests/unit/ext/test_aiohttp_py35.py b/tests/unit/ext/test_aiohttp_py35.py
index d4fcfc20..bb5fa810 100644
--- a/tests/unit/ext/test_aiohttp_py35.py
+++ b/tests/unit/ext/test_aiohttp_py35.py
@@ -22,7 +22,7 @@ class OtherClassBasedView(web.View):
 @web.middleware
 async def middleware(request, handler):
     resp = await handler(request)
-    resp.text = resp.text + " wink1"
+    resp.text += " wink1"
     return resp
 
 
@@ -30,7 +30,7 @@ def middleware_factory(text):
     @web.middleware
     async def sample_middleware(request, handler):
         resp = await handler(request)
-        resp.text = resp.text + text
+        resp.text += text
         return resp
     return sample_middleware

elfring avatar Nov 07 '21 21:11 elfring

Hi @elfring ,

Wonderful idea. Would you like to make a pull request?

Best, Roman

rmk135 avatar Nov 08 '21 00:11 rmk135

:thought_balloon: How will the chances evolve to integrate the adjustment of two assignment statements directly?

elfring avatar Nov 08 '21 08:11 elfring