
Python
文章平均质量分 80
yxc135
此用户很懒,没有任何简介
展开
-
weakref的使用场景——实现缓存
The weakref module allows the Python programmer to create weak references to objects.In the following, the term referent means the object which is referred to by a weak reference.A weak re转载 2013-07-18 11:22:39 · 2854 阅读 · 1 评论 -
Communication between Processes in Python
Reprint:As with threads, a common use pattern for multiple processes is to divide a job up among several workers to run in parallel. Effective use of multiple processes usually requires some com转载 2013-08-21 21:01:13 · 1159 阅读 · 0 评论 -
super() in Python
Reprint:http://rhettinger.wordpress.com/2011/05/26/super-considered-super/Much has been written about super() and much of that writing has been a failure. This article seeks to improve on the situ转载 2013-08-21 19:52:38 · 1082 阅读 · 0 评论 -
Property in Python
Reference:http://adam.gomaa.us/blog/2008/aug/11/the-python-property-builtin/I used a question that involved property as one of the interview questions during a recent developer search, and I fou转载 2013-08-21 13:34:44 · 885 阅读 · 0 评论 -
Decorator in Pyhton
找了一篇关于Decorator的文章,虽然有点小问题,但在如何应用的方面写的比较好。具体的小问题我会在文章中间用红色字标注一下。The Python programming language has an interesting syntactic feature called a decorator. Let's use an example in order to explain转载 2013-08-20 22:29:03 · 853 阅读 · 1 评论 -
Multiprocessing Basics in Python
Reprint:http://pymotw.com/2/multiprocessing/basics.htmlThe simplest way to spawn a second is to instantiate a Process object with a target function and call start() to let it begin working.转载 2013-08-21 16:31:32 · 1183 阅读 · 0 评论 -
Metaclass in Python
I pick this post from stackoverflow, it's really awesome, thanks fore-satis . Here is the original link : http://stackoverflow.com/questions/100003/what-is-a-metaclass-in-pythonClasses转载 2013-08-21 22:40:51 · 812 阅读 · 0 评论 -
Descriptors in Python
Reference:http://www.informit.com/articles/printerfriendly.aspx?p=1309289Python descriptors have been around a long time—they were introduced way back in Python 2.2. But they're still not widely u转载 2013-08-21 13:36:26 · 983 阅读 · 0 评论 -
Python中__del__如何使用
从C++转行Python的人可能会认为__del__等价于C++中的Destructor,但同时会发现一些很奇怪的问题,比如在__del__中使用类变量时遇到Exception AttributeError: "'NoneType' object has no attribute '***'"的问题。 通过查阅资料,发现__del__不是一般意义上的Destructor,不推荐使原创 2013-07-18 10:59:22 · 8396 阅读 · 0 评论 -
Threading in Python
Reprint:http://pymotw.com/2/threading/Thread ObjectsThe simplest way to use a Thread is to instantiate it with a target function and call start() to let it begin working.import threa转载 2013-08-21 14:56:53 · 1755 阅读 · 0 评论