Docs don't mention when a class method is considered private v.s public / --help behavior is confusing
- Linguagem predominante
- Python
- Estrelas
- 28.2k
- Forks
- 1.5k
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
Here's a MWE:
```python
#!/usr/bin/env python
from fire import Fire
class Example:
def version(self):
return "bla"
def start(self):
print("starting")
def stop(self):
print("stopping")
Fire(Example)
```
Running this script without arguments shows the available commands - OK:
```
NAME
fire-bug.py
SYNOPSIS
fire-bug.py COMMAND
COMMANDS
COMMAND is one of the following:
start
stop
version
```
But the more common (and usually safe) thing to do when a user is being introduced a new command, is to run it with a `--help`. However, `Fire` doesn't behave the same for this argument:
```
INFO: Showing help with the command 'fire-bug.py -- --help'.
NAME
fire-bug.py
SYNOPSIS
fire-bug.py -
```
Unless you use `--verbose` as well. Why is that? This is not trivial for a user to guess, and only reading the docs here led me to this conclusion. Plus, the docs don't mention how to make a class method a "public" method...
Guia de contribuição
Direção de pesquisa
Comece com o MWE de Python Fire na issue e compare o comportamento sem argumentos, com --help e com --verbose descrito nela. Atualize a documentação relevante para explicar quando os métodos de uma classe são expostos como públicos ou privados e por que essas invocações de ajuda diferem. A tarefa estará concluída quando uma pessoa nova no projeto puder determinar como tornar um método público e entender o comportamento documentado de --help.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python
- Domínio
- cli, documentation
- Tipo de issue
- Documentação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 45/100