chrismattmann / tika-python

Tika-Python is a Python binding to the Apache Tika™ REST services allowing Tika to be called natively in the Python community.
Apache License 2.0
1.49k stars 234 forks source link

Use another augmented assignment statement #357

Closed elfring closed 1 year 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/tika/tika.py b/tika/tika.py
index 3e19b6c..8c0983d 100755
--- a/tika/tika.py
+++ b/tika/tika.py
@@ -771,7 +771,7 @@ def getRemoteFile(urlOrPath, destPath):
         return (urlOrPath, 'local')
     else:
         filename = toFilename(urlOrPath)
-        destPath = destPath + '/' + filename
+        destPath += '/' + filename
         log.info('Retrieving %s to %s.' % (urlOrPath, destPath))
         try:
             urlretrieve(urlOrPath, destPath)
chrismattmann commented 1 year ago

Sure this sounds interesting and useful. Is it back compat with other python versions? Also I'd like to see a more full patch and discussion of what benefit this provides? As it stands "improving software components" I'm not sure what the benefit is. Thanks.

elfring commented 1 year ago

I find that the rationale of the Python enhancement proposal 203 (from 2000-07-13) can indicate also motivation for another bit of collateral evolution. :thinking: