Skip to content

Python 源码整理 - 1

Published: at 00:00

Python 源码整理 - 1

说明
使用的源码是 Python 2.7.9 - 2014-12-10
下载源码
https://www.python.org/downloads/source/
代码结构及主要目录说明
total 1784
drwxr-xr-x@  23 nate  staff     782 Dec 10 23:59 Demo
drwxr-xr-x@  29 nate  staff     986 Jan 28 01:17 Doc
drwxr-xr-x@   3 nate  staff     102 Dec 10 23:59 Grammar
drwxr-xr-x@  93 nate  staff    3162 Dec 10 23:59 Include
-rw-r--r--@   1 nate  staff   12755 Dec 10 23:59 LICENSE
drwxr-xr-x@ 254 nate  staff    8636 Dec 10 23:59 Lib
drwxr-xr-x@  15 nate  staff     510 Dec 10 23:59 Mac
-rw-r--r--@   1 nate  staff   45329 Dec 10 23:59 Makefile.pre.in
drwxr-xr-x@  34 nate  staff    1156 Dec 10 23:59 Misc
drwxr-xr-x@ 137 nate  staff    4658 Jan 28 01:16 Modules
drwxr-xr-x@  46 nate  staff    1564 Dec 10 23:59 Objects
drwxr-xr-x@  39 nate  staff    1326 Dec 10 23:59 PC
drwxr-xr-x@  54 nate  staff    1836 Dec 10 23:59 PCbuild
drwxr-xr-x@  25 nate  staff     850 Dec 10 23:59 Parser
drwxr-xr-x@  75 nate  staff    2550 Dec 10 23:59 Python
-rw-r--r--@   1 nate  staff   53978 Dec 10 23:59 README
drwxr-xr-x@  11 nate  staff     374 Dec 10 23:59 RISCOS
drwxr-xr-x@  23 nate  staff     782 Dec 11 00:00 Tools
-rwxr-xr-x@   1 nate  staff   42856 Dec 11 00:00 config.guess
-rwxr-xr-x@   1 nate  staff   35740 Dec 11 00:00 config.sub
-rwxr-xr-x@   1 nate  staff  428607 Dec 11 00:00 configure
-rw-r--r--@   1 nate  staff  134982 Dec 11 00:00 configure.ac
-rwxr-xr-x@   1 nate  staff    7122 Dec 11 00:00 install-sh
-rw-r--r--@   1 nate  staff   34898 Dec 11 00:00 pyconfig.h.in
-rw-r--r--@   1 nate  staff   97660 Dec 11 00:00 setup.py

Demo # 示例的相关Python代码目录
Doc  # 文档目录
Grammar # 语法分析目录
Include # 相关的C头文件目录
Lib # 相关的Python写的模块
Mac # Mac OS相关
Modules # 对性能有要求的C语言写的模块
Objects # 所有Python的内建对象的C语言实现
Parser # 词法分析和语法分析,Python代码解析的C语言实现
Python # Python引擎的C语言实现
Python对象
Python中所有的东西都是对象
内建对象的相关头文件都在Include下面
object.h
intobject.h
longobject.h
floatobject.h
boolobject.h
stringobject.h
tupleobject.h
listobject.h
setobject.h
sliceobject.h
bytearrayobject.h
cellobject.h
classobject.h
cobject.h
code.h
fileobject.h
funcobject.h
frameobject.h
genobject.h
memoryobject.h
unicodeobject.h
methodobject.h
datetime.h