Need for a few corrections/updates regarding the `inspect.ismethoddescriptor()`'s and `inspect.isdatadescriptor()`'s docs and unit tests
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 35.9k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der Dokumentation und den Docstrings für inspect.ismethoddescriptor() und inspect.isdatadescriptor(), und sieh dir anschließend die vorhandenen Unit-Tests für beide Funktionen an. Die verknüpften PRs beschreiben die vorgeschlagenen Aktualisierungen der Dokumentation und Tests oder enthalten sie; die Arbeit ist abgeschlossen, wenn diese Korrekturen und eine konsistentere Testabdeckung zusammengeführt wurden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- documentation, testing
- Issue-Typ
- Dokumentation
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 20/100