google / google/python-fire

Use another augmented assignment statement

Ouverte
#359 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
28.2k
Forks
1.5k
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

: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/fire/core.py b/fire/core.py
index 8ca142c..67b1c72 100644
--- a/fire/core.py
+++ b/fire/core.py
@@ -570,7 +570,7 @@ def _Fire(component, args, parsed_flag_args, context, name=None):
if used_separator:
# Add back in the arguments from after the separator.
if remaining_args:
- remaining_args = remaining_args + [separator] + saved_args
+ remaining_args += [separator] + saved_args
elif (inspect.isclass(last_component)
or inspect.isroutine(last_component)):
remaining_args = saved_args
```

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.