Need for a few corrections/updates regarding the `inspect.ismethoddescriptor()`'s and `inspect.isdatadescriptor()`'s docs and unit tests
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
Documentation
-
The main correction that needs to be made regards this fragment of the docs of inspect.ismethoddescriptor():
Return
Trueif the object is a method descriptor, but not if ismethod(), isclass(), isfunction() or isbuiltin() are true.The problem is that, in fact, the
inspect.ismethoddescriptor()function does not engage theinspect.isbuiltin()function at all (whereas it does engage the rest of the said functions).(As it seems, the mistaken statement was introduced long ago...)
-
Another thing worth fixing is the lack of the information that the inspect.isdatadescriptor() function also returns False if any of the ismethod(), isclass() or isfunction() tests are true.
-
There are also a few other fragments of the docs of those two functions (
inspect.ismethoddescriptor()andinspect.isdatadescriptor()) which seem to me worth updating/rewording... -
Naturally, it also seems a good idea to update the docstrings of those two functions (where applicable).
All those improvements have been proposed by submitting the first PR attached to this issue [update: merged].
Tests
By the way, it seems worth to make the unit tests for those two functions be more comprehensive as well as consistent with each other.
The tests-related improvements have been proposed by submitting the second PR attached to this issue.
Linked PRs
- gh-122104
- gh-122144
- gh-153948
- gh-153949
- gh-153950
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 pela documentação e pelas docstrings de inspect.ismethoddescriptor() e inspect.isdatadescriptor(), depois revise os testes unitários existentes para ambas as funções. Os PRs vinculados descrevem ou contêm as atualizações propostas para a documentação e os testes; o trabalho estará concluído quando essas correções e uma cobertura mais consistente forem integradas.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python
- Domínio
- documentation, testing
- Tipo de issue
- Documentação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Claramente especificada
- Facilidade para iniciantes
- 20/100