标签
App Engine Cacti Decorator Drupal Facebook fetion Fuck GFW GFW glib glib升级 HTTP协议 Jmeter Nginx ning.in PHP PHP 微博客 puff Python Python微博客 rsync shell SSH tokyo cabinet tokyo tyrant Twitter Wordpress wordpress fetion wordpress plugin Youtube zend zend studio zend studio注册码 互联网 变形金刚前传 域名 域名交易 小文件同步 开源,微博客,PHP 微博客,Python微博客,App Engine 微博客 恶搞 淘宝客 网络流量 网页打开速度 翻墙 英文换行分类目录
-
最近文章
标签归档:Decorator
Charming Python: Decorators make magic easy
今天在看Python的Decorators,找到篇文章,写的很详细了,收藏下来。
Charming Python: Decorators make magic easy
David Mertz, Ph.D. (mertz@gnosis.cx), Developer, Gnosis Software, Inc.
29 Dec 2006
Python made metaprogramming possible, but each Python version has added slightly different — and not quite compatible — wrinkles to the way you accomplish metaprogramming tricks. Playing with first-class function objects has long been around, as have techniques for peaking and poking at magic attributes. With version 2.2, Python grew a custom metaclass mechanism that went a long way, but at the cost of melting users’ brains. More recently, with version 2.4, Python has grown “decorators,” which are the newest — and by far the most user-friendly way, so far — to perform most metaprogramming.
Doing a lot by doing very little 继续阅读

