Add more useful help for special name in `help()`
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Python
- Estrelas
- 77.2k
- Forks
- 36k
- Métricas de merge de PRs
- Métricas de PR pendentes
Descrição
Feature or enhancement
Proposal:
Now, use help("__name__") and some other special variables' names will still get the help from their class. I think that we can add the useful help on them. For example:
>>>help("__name__")
1. module.__name__ : if the module is run as the main module, the value is ‘_main_‘, or the name is the filename of the module. For example:if __name__ == "__main__": ...can control which code don’t run when the module is imported.
2. cls.__name__: the name of the class. It must be str.
For other special variables (such as __file__), we can alse print the similar detailed help. And I think that the sentences need to be friendly.
Also welcome to give the ideals on new ideas
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
- gh-137966
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece executando help("name") e compare a saída atual com os exemplos propostos para name e file. Está concluído quando help() fornecer explicações claras e úteis para as variáveis especiais selecionadas; revise o PR vinculado gh-137966 antes de começar.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python
- Domínio
- documentation
- Tipo de issue
- Funcionalidade
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 25/100