python / python/cpython

Need for a few corrections/updates regarding the `inspect.ismethoddescriptor()`'s and `inspect.isdatadescriptor()`'s docs and unit tests

Aberta
#122,102 4 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

docs
Linguagem predominante
Python
Estrelas
77.2k
Forks
36k
Métricas de merge de PRs
Métricas de PR pendentes

Descrição

Documentation

  1. The main correction that needs to be made regards this fragment of the docs of inspect.ismethoddescriptor():

    Return True if 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 the inspect.isbuiltin() function at all (whereas it does engage the rest of the said functions).

    (As it seems, the mistaken statement was introduced long ago...)

  2. 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.

  3. There are also a few other fragments of the docs of those two functions (inspect.ismethoddescriptor() and inspect.isdatadescriptor()) which seem to me worth updating/rewording...

  4. 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

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. 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

Receba novas issues na sua caixa de entrada

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