Today one of my co-workers found the interesting case of
str(None)
'None'
So Naturally I wanted to see how None is defined
inspect.getsourcelines(None.__str__)
TypeError: <method-wrapper '__str__' of NoneType object at 0x91a870> is not a module, class, method, function, traceback, frame, or code object
Which probably isn't surprising since None's most likely defined in C
. But that brings up the interesting question, if None.__str__
isn't a module, class, method, etc what is it?