When we do,
True.__init__
we get,
<method-wrapper '__init__' of bool object at 0x55abe921e100>
whereas,
list.__init__
gives,
<slot wrapper '__init__' of 'list' objects>
type(True.__init__)
gives,
method-wrapper
whereas,
type(list.__init__)
gives,
wrapper_descriptor
if we check this for builtins,
from collections import defaultdict
import keyword, re
d = defaultdict(set)
for i, j in keyword.__builtins__.items():
if not re.search('Error|Warning|__|ipython', i):
d[type(eval(i).__init__)].add(i)
print(d)
gives,
defaultdict(<class 'set'>,
{<class 'method'>: {'credits', 'copyright', 'license'},
<class 'method-wrapper'>: {'Ellipsis', 'False', 'None',
'NotImplemented', 'True', 'abs', 'all',
'any', 'ascii', 'bin', 'breakpoint',
'callable', 'chr', 'compile', 'delattr',
'dir', 'display', 'divmod', 'dreload',
'eval', 'exec', 'execfile', 'format',
'getattr', 'globals', 'hasattr', 'hash',
'help', 'hex', 'id', 'input',
'isinstance', 'issubclass', 'iter',
'len', 'locals', 'max', 'min', 'next',
'oct', 'open', 'ord', 'pow', 'print',
'repr', 'round', 'runfile', 'setattr',
'sorted', 'sum', 'vars'},
<class 'wrapper_descriptor'>: {'BaseException', 'Exception',
'GeneratorExit',
'KeyboardInterrupt',
'StopAsyncIteration',
'StopIteration', 'SystemExit',
'bool', 'bytearray', 'bytes',
'classmethod', 'complex', 'dict',
'enumerate', 'filter', 'float',
'frozenset', 'int', 'list', 'map',
'memoryview', 'object', 'property',
'range', 'reversed', 'set', 'slice',
'staticmethod', 'str', 'super',
'tuple', 'type', 'zip'}})
what could be going on here?