I typed dir(inspect)
to shell for some reason and got some results related to your post. Some of these results below may make you interested:
'isabstract', 'isasyncgen', 'isasyncgenfunction', 'isawaitable', 'isbuiltin', 'isclass', 'iscode',
'iscoroutine', 'iscoroutinefunction', 'isdatadescriptor', 'isframe', 'isfunction', 'isgenerator',
'isgeneratorfunction', 'isgetsetdescriptor', 'ismemberdescriptor', 'ismethod',
'ismethoddescriptor', 'ismodule', 'isroutine', 'istraceback'
Their __doc__
s doesn’t say much but may be helpful:
>>> inspect.ismemberdescriptor.__doc__
'Return true if the object is a member descriptor.\n\n Member descriptors are specialized descriptors defined in extension\n modules.'
>>> inspect.isgetsetdescriptor.__doc__
'Return true if the object is a getset descriptor.\n\n getset descriptors are specialized descriptors defined in extension\n modules.'
ETC.
Some more info here.
Probably related:
- Descriptor Objects — Python 3.10.4 documentation
- Descriptor HowTo Guide — Python 3.10.4 documentation
You can have a look at inspect
's source code -it is really easy to understand- to get some general sight about those descriptor and wrapper objects (method_descriptor etc.). Generally found at (I am using 3.9):
C:\Users\YOUR_NAME\AppData\Local\Programs\Python\Python39\Lib\inspect.py
And, I found this code for you (belongs to types module):
WrapperDescriptorType = type(object.__init__)
MethodWrapperType = type(object().__str__)
MethodDescriptorType = type(str.join)
ClassMethodDescriptorType = type(dict.__dict__['fromkeys'])
Hope, this post helped you a bit.