google / google/python-fire

Use another augmented assignment statement

Aberta
#359 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
28.2k
Forks
1.5k
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

: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
```

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.