inspect.getsource() doesn't work in python
Question: I have a problem with this code , but don't no why...

    
    
    import inspect
    inspect.getsource(min)
    

and the error is:

    
    
    Traceback (most recent call last):
      File "<pyshell#1>", line 1, in <module>
        inspect.getsource(min)
      File "C:\Python33\lib\inspect.py", line 726, in getsource
        lines, lnum = getsourcelines(object)
      File "C:\Python33\lib\inspect.py", line 715, in getsourcelines
        lines, lnum = findsource(object)
      File "C:\Python33\lib\inspect.py", line 551, in findsource
        file = getfile(object)
      File "C:\Python33\lib\inspect.py", line 435, in getfile
        'function, traceback, frame, or code object'.format(object))
    TypeError: <built-in function min> is not a module, class, method, function, traceback, frame,or code object
    


Answer: The built-in `min()` is implemented in C code, and `inspect.getsource()` can
only show you _Python_ code:

    
    
    >>> min
    <built-in function min>
    

The `built-in function` type is always implemented in C.

The code for this function comes from the `bltinmodule.c` source file; the
[`builtin_min()`
function](http://hg.python.org/cpython/file/cd95f1276360/Python/bltinmodule.c#l1448)
delegates to the [`min_max()` utility
function](http://hg.python.org/cpython/file/cd95f1276360/Python/bltinmodule.c#l1345)
in the same source file.

