I'm using Python 2.6 on Ubuntu.
views:
97answers:
2
+3
A:
It's a builtin, so there is no .py file.
If you want to see the C source on your system:
apt-get source python
It's in Python/import.c
An easy way to see that imp is a builtin is
$ python -v
_lots of stuff snipped_
>>> import imp
import imp # builtin
Alternatively, in ipython
In [1]: import imp
In [2]: imp??
Type: module
Base Class: <type 'module'>
String Form: <module 'imp' (built-in)>
Namespace: Interactive
Docstring [source file open failed]:
This module provides the components needed to build your own
__import__ function. Undocumented functions are obsolete.
gnibbler
2009-12-08 02:08:16
`sys.builtin_module_names` is another option.
intuited
2010-10-12 01:30:40