ITeye博客

hfeeqi

hfeeqi · 共 3 篇文章

学习python decorator模块

本文简介 decorator模块是 Michele Simionato 为简化python的decorator的使用难度而开发的,使用它,您可以更加容易的使用decorator机制写出可读性、可维护性更好的代码。 本文大部分翻译自下面这篇文档: www.phyast.pitt.edu/~micheles/python/documentation.html , 之中或会加入自己的理解或注释 decorator 模块 作者: Michele Simionato E-mail: michele.simionato@gmail.com 版本: 2.0.1 下载: http://www.phyast.…

2007-04-15 23:39 · 评论(0)

怎样弹出浮动窗口组件

Here's an exclusive preview just for the Conduiters who hang around the forum: What's the most annoying thing when trying to embed parts of your site inside your toolbar (usually using HTML components)? That you only have 20px height to work with... Not any more! Introducing our Floating Web Compon…

2007-04-08 14:24 · 评论(3)

Python decorator

function decorator: 语法: @decoratorname def decoratoredfunction 例如: python 代码 class C: @classmethod def meth(cls): ... 上面的 @classmethod 等于 meth=classmethod(meth) decorator 能够用于为函数(普通函数或类的成员函数)添加功能, 不能够用来为类动态添加方法. decorator 把被修饰的函数作为参数, 其返回值通常是一个函数或者类 技术上讲, 任何只带一个参数能够被调用的对象都可以被当作decorator使用, 但是这个定义过于…

2007-04-08 12:47 · 评论(4)