![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
python
shawff
这个作者很懒,什么都没留下…
展开
-
Python Source code
以下是源码目录介绍,是从网上摘录的Doc ← 源代码文档说明Grammar ← 计算机可读的语言定义Include:该目录下包含了Python提供的所有文件头,如果用户需要自己用C或者C++来编写自定义模块扩展Python,那么就需要用到这里提供的头文件。Lib:该目录包含了Python自带的所有标准库,Lib中的库都是用Python语言编写的。Modules:该目录中包含了所有用C语言...原创 2020-04-01 01:58:28 · 514 阅读 · 0 评论 -
Python Notes:LookDict of Dict
/*The basic lookup function used by all operations.This is based on Algorithm D from Knuth Vol. 3, Sec. 6.4.Open addressing is preferred over chaining since the link overhead forchaining would be...原创 2020-04-24 18:56:19 · 182 阅读 · 0 评论 -
Python Notes:Set
typedef struct { PyObject_HEAD Py_ssize_t fill; /* Number active and dummy entries*/ Py_ssize_t used; /* Number active entries */ /* The table contains mask + ...原创 2020-04-24 18:34:34 · 151 阅读 · 0 评论 -
Python Notes:Tuple
typedef struct { PyObject_VAR_HEAD /* ob_item contains space for 'ob_size' elements. Items must normally not be NULL, except during construction when the tuple is not yet visibl...原创 2020-04-24 18:54:00 · 291 阅读 · 0 评论 -
Python Notes:Dict introduce
struct _dictkeysobject { Py_ssize_t dk_refcnt; //引用计数 /* Size of the hash table (dk_indices). It must be a power of 2. */ Py_ssize_t dk_size; /* Function to lookup in the hash ta...原创 2020-04-24 19:08:26 · 198 阅读 · 0 评论 -
Python Notes:List
typedef struct _object { _PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt; PyTypeObject *ob_type;} PyObject;typedef struct { PyObject ob_base; Py_ssize_t ob_size; /* Number of items i...原创 2020-04-24 18:33:03 · 132 阅读 · 0 评论 -
Python Notes:range
typedef struct { PyObject_HEAD PyObject *start; PyObject *stop; PyObject *step; PyObject *length;} rangeobject;原创 2020-03-30 20:20:13 · 257 阅读 · 0 评论 -
Python Notes:string join
2.字符串join#源码a="dddddddddd"b="sssssssssss"a.join(b)#字节码(实际上也就是调用unicode的method中的join函数) 0 LOAD_NAME 0 (a) 2 LOAD_METHOD 1 (join) ...原创 2020-03-10 19:20:46 · 207 阅读 · 0 评论 -
Python Notes:string substring
opcode = "a='dddddddddd'\n" \ "a=a[1:6]" 0 LOAD_CONST 0 ('dddddddddd') 2 STORE_NAME 0 (a) 4 LOAD_NAME ...原创 2020-03-10 19:20:20 · 452 阅读 · 0 评论 -
Python Notes:string addition
从Python3字符串统一使用Unicode编码1.探究字符串加法运算效率#源码a="dddddddddd"b="sssssssssss"a = a+b#字节码 0 LOAD_NAME 0 (a) 2 LOAD_NAME 1 (b) ...原创 2020-03-10 19:21:02 · 227 阅读 · 0 评论