Source code for str.split?
问题 I would like to see how str.split() is implemented in Python Here's what I tried: > inspect.getsource(str.split) TypeError: <method 'split' of 'str' objects> is not a module, class, method, function, traceback, frame, or code object Copying the other example on StackOverflow has not work: Code for Greatest Common Divisor in Python 回答1: inspect.getsource(str.split) is not written to handle code written in the implementation language ( C here). str.split is builtin , i.e written in C . The