Need for a few corrections/updates regarding the `inspect.ismethoddescriptor()`'s and `inspect.isdatadescriptor()`'s docs and unit tests
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 77.2k
- Fork
- 35.9k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia dalla documentazione e dai docstring di inspect.ismethoddescriptor() e inspect.isdatadescriptor(), quindi esamina i test unitari esistenti per entrambe le funzioni. I PR collegati descrivono o contengono gli aggiornamenti proposti alla documentazione e ai test; il lavoro è completato quando queste correzioni e una copertura più coerente vengono unite.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- documentation, testing
- Tipo di issue
- Documentazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 20/100