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...)
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...
Naturally, it also seems a good idea to update the docstrings of those two functions (where applicable).
Documentation
The main correction that needs to be made regards this fragment of the docs of inspect.ismethoddescriptor():
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.
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