title: how to get source code of python print function?
body: <p>I am trying to get source code of python print using inspect but it is throwing error. Can someone please tell me how to get the source code of python2.7 print statement.</p>
  
  <pre><code>inspect.getsourcefile(print)
  ---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-85-6158f5314751&gt; in &lt;module&gt;()
  ----&gt; 1 inspect.getsourcefile(print)
  
  /usr/lib/python3.4/inspect.py in getsourcefile(object)
      569     Return None if no way can be identified to get the source.
      570     """
  --&gt; 571     filename = getfile(object)
      572     all_bytecode_suffixes = importlib.machinery.DEBUG_BYTECODE_SUFFIXES[:]
      573     all_bytecode_suffixes += importlib.machinery.OPTIMIZED_BYTECODE_SUFFIXES[:]
  
  /usr/lib/python3.4/inspect.py in getfile(object)
      534         return object.co_filename
      535     raise TypeError('{!r} is not a module, class, method, '
  --&gt; 536                     'function, traceback, frame, or code object'.format(object))
      537 
      538 ModuleInfo = namedtuple('ModuleInfo', 'name suffix mode module_type')
  
  TypeError: &lt;built-in function print&gt; is not a module, class, method, function, traceback, frame, or code object
  
  In [86]: inspect.getsourcefile(builtin.print)
  ---------------------------------------------------------------------------
  NameError                                 Traceback (most recent call last)
  &lt;ipython-input-86-2d1fb60aac58&gt; in &lt;module&gt;()
  ----&gt; 1 inspect.getsourcefile(builtin.print)
  
  NameError: name 'builtin' is not defined
  </code></pre>