1
xiandao7997 2015-01-02 23:46:13 +08:00 via Android
不懂 decorator, 不过 lz 的问题可以搜索 decorator site:python.org :)
另,找到一个教程, http://www.cnblogs.com/vamei/archive/2012/09/13/2682778.html |
2
binux 2015-01-02 23:54:25 +08:00
https://docs.python.org/2/reference/compound_stmts.html#function-definitions
你还要多详细,本来就没多少东西,就一语法糖 |
3
yourmoonlight 2015-01-03 09:07:00 +08:00
|
4
zonyitoo 2015-01-03 11:13:57 +08:00
decorator就是一个语法糖来的而已呀
|
5
yourmoonlight 2015-01-03 13:41:17 +08:00
python decorators are equated to macros.
the goal of macros is to provide a way to modify elements of the language. that's what decorators do in python, they modify functions, in the case of class decorators, entire classes. |
6
rcmerci 2015-01-03 14:03:53 +08:00 1
的确只是语法糖而已,nothing more
|
7
HxSeek OP 原来如此··小白就此谢过大家的回复啦··
|
8
clvrobj 2015-01-03 21:01:17 +08:00
虽然lz已经原来如此了,还是留下个觉得有用的链接 https://www.python.org/dev/peps/pep-0318/
|