相信积累的力量

摘要: http://www.laurentluce.com/posts/python-string-objects-implementation/Python string objects implementationJune 19, 2011This article describes how string objects are managed by Python internally and how string search is done.PyStringObject structureNew string objectSharing string objectsString search 阅读全文
posted @ 2013-08-23 23:17 ThreeF 阅读(344) 评论(0) 推荐(0) 编辑
摘要: http://docs.python.org/2/extending/extending.html 1. Extending Python with C or C++ It is quite easy to add new built-in modules to Python, if you kno 阅读全文
posted @ 2013-08-23 23:16 ThreeF 阅读(463) 评论(0) 推荐(0) 编辑
摘要: 8.17.copy— Shallow and deep copy operations不可变对象总是浅复制?string tuple可变容器对象浅复制?list dic其它可变对象写入深复制?int charAssignment statements in Python do not copy objects, they create bindings between a target and an object. For collections that are mutable or contain mutable items, a copy is sometimes needed so o 阅读全文
posted @ 2013-08-23 23:14 ThreeF 阅读(532) 评论(0) 推荐(0) 编辑
摘要: http://www.laurentluce.com/posts/python-list-implementation/Python list implementationMarch 10, 2011This post describes the CPython implementation of the list object. CPython is the most used Python implementation.Lists in Python are powerful and it is interesting to see how they are implemented int 阅读全文
posted @ 2013-08-23 22:51 ThreeF 阅读(408) 评论(0) 推荐(0) 编辑
摘要: http://stackoverflow.com/questions/1546226/the-shortest-way-to-remove-multiple-spaces-in-a-string-in-pythonThe fox jumped over the log.The fox jumped over the log." ".join(foo.split())re.sub(patten, replace, str) 阅读全文
posted @ 2013-08-23 19:24 ThreeF 阅读(347) 评论(0) 推荐(0) 编辑

相信积累的力量