-, , . , Python C , , Python C, , Python, .
: numpy - Python, C; bintrees - Python, C, Python , ; .
stdlib 3.2 . , import pickle, C ( cpickle 2.7) CPython, pure-Python PyPy, pickle Python.
, :
- ,
sys. - C, 2.x
cpickle. - Pure Python, 2.x
pickle.
, CPython; , , Jython IronPython, JVM .NET, .
__file__ :
__file__. ( , , inspect.) , - py2app cx_freeze, , "", .- pure-Python .pyc/.pyo .py .
- , (
easy_install, pip) , __file__. - , , zip , , .
3.1+ , Python Python.
, importlib, , , BuiltinImporter ( (2 β ).2 >
, , , importlib.machinery. , , any(pathname.endswith(suffix) for suffix in importlib.machinery.EXTENSION_SUFFIXES)), , , /-, .
, , - , inspect, .
getsource, getsourcefile getfile; , .
TypeError .
getsourcefile. , 2.5-3.4, , 2.4. getsource, , .so , IOError. ( 3.x UnicodeError SyntaxError, , , ...)
Pure Python getsourcefile, egg/zip/etc. getsource, , egg/zip/etc., - (.pyc/etc.), IOError.
, (-), .