Repository: open-telemetry/opentelemetry-python

Issue:
Increase the usage of augmented assignment statements
: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](https://docs.python.org/3/reference/simple_stmts.html#augmented-assignment-statements "Augmented assignment statements") accordingly.

```diff
diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py b/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py
index 35fefc3e..2418dcad 100644
--- a/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py
+++ b/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py
@@ -146,7 +146,7 @@ class SynchronousMultiSpanProcessor(SpanProcessor):
     def add_span_processor(self, span_processor: SpanProcessor) -> None:
         """Adds a SpanProcessor to the list handled by this instance."""
         with self._lock:
-            self._span_processors = self._span_processors + (span_processor,)
+            self._span_processors += (span_processor,)
 
     def on_start(
         self,
@@ -216,7 +216,7 @@ class ConcurrentMultiSpanProcessor(SpanProcessor):
     def add_span_processor(self, span_processor: SpanProcessor) -> None:
         """Adds a SpanProcessor to the list handled by this instance."""
         with self._lock:
-            self._span_processors = self._span_processors + (span_processor,)
+            self._span_processors += (span_processor,)
 
     def _submit_and_await(
         self,
```


Discussion:

Resolving patch:
diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/_logs/__init__.py b/opentelemetry-sdk/src/opentelemetry/sdk/_logs/__init__.py
--- a/opentelemetry-sdk/src/opentelemetry/sdk/_logs/__init__.py
+++ b/opentelemetry-sdk/src/opentelemetry/sdk/_logs/__init__.py
@@ -159,7 +159,7 @@ def __init__(self):
     def add_log_processor(self, log_processor: LogProcessor) -> None:
         """Adds a Logprocessor to the list of log processors handled by this instance"""
         with self._lock:
-            self._log_processors = self._log_processors + (log_processor,)
+            self._log_processors += (log_processor,)
 
     def emit(self, log_data: LogData) -> None:
         for lp in self._log_processors:
@@ -218,7 +218,7 @@ def __init__(self, max_workers: int = 2):
 
     def add_log_processor(self, log_processor: LogProcessor):
         with self._lock:
-            self._log_processors = self._log_processors + (log_processor,)
+            self._log_processors += (log_processor,)
 
     def _submit_and_wait(
         self,
diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py b/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py
--- a/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py
+++ b/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py
@@ -146,7 +146,7 @@ def __init__(self):
     def add_span_processor(self, span_processor: SpanProcessor) -> None:
         """Adds a SpanProcessor to the list handled by this instance."""
         with self._lock:
-            self._span_processors = self._span_processors + (span_processor,)
+            self._span_processors += (span_processor,)
 
     def on_start(
         self,
@@ -216,7 +216,7 @@ def __init__(self, num_threads: int = 2):
     def add_span_processor(self, span_processor: SpanProcessor) -> None:
         """Adds a SpanProcessor to the list handled by this instance."""
         with self._lock:
-            self._span_processors = self._span_processors + (span_processor,)
+            self._span_processors += (span_processor,)
 
     def _submit_and_await(
         self,


Test patch: