fluent / fluent/fluent-logger-python
Use another augmented assignment statement
- Vorherrschende Sprache
- Python
- Sterne
- 457
- Forks
- 138
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
: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/fluent/handler.py b/fluent/handler.py
index 7aefd8f..46fcce9 100644
--- a/fluent/handler.py
+++ b/fluent/handler.py
@@ -147,7 +147,7 @@ class FluentRecordFormatter(logging.Formatter, object):
if self.__style:
value = self.__style(value).format(record)
else:
- value = value % record.__dict__
+ value %= record.__dict__
except KeyError as exc:
value = None
if not self.fill_missing_fmt_key:
```
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Start in fluent/handler.py at the FluentRecordFormatter formatting branch shown in the issue. Check the surrounding formatting behavior, make the augmented-assignment change while preserving the result, and verify the formatter still handles record dictionaries and missing keys as before.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- backend
- Issue-Typ
- Refactoring
- Schwierigkeit
- 1/5
- Geschätzter Aufwand
- Unter einer Stunde
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 45/100