首页
注册
登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请
登录
推荐学习书目
›
Learn Python the Hard Way
Python Sites
›
PyPI
- Python Package Index
›
http://diveintopython.org/toc/index.html
›
Pocoo
值得关注的项目
›
PyPy
›
Celery
›
Jinja2
›
Read the Docs
›
gevent
›
pyenv
›
virtualenv
›
Stackless Python
›
Beautiful Soup
›
结巴中文分词
›
Green Unicorn
›
Sentry
›
Shovel
›
Pyflakes
›
pytest
Python 编程
›
pep8 Checker
Styles
›
PEP 8
›
Google Python Style Guide
›
Code Style from The Hitchhiker's Guide
V2EX
›
Python
python 新人求教关于装饰器的问题。
2
jianghu52
·
2014-06-10 08:56:52 +08:00
· 3124 次点击
这是一个创建于 3763 天前的主题,其中的信息可能已经有所发展或是发生改变。
我想知道在有参数的装饰器装饰有参数的函数的时候,编译器是怎么一个执行顺序
编译器
参数
求教
5 条回复
•
2014-06-10 14:54:23 +08:00
1
tonghuashuai
2014-06-10 09:51:21 +08:00
2
https://gist.github.com/tonghuashuai/60e9a0b29f1a4e8bd939
2
ultimate010
2014-06-10 11:17:40 +08:00
学习了。
3
jianghu52
OP
2014-06-10 11:47:46 +08:00
谢谢。说好的很明白
4
poke707
2014-06-10 13:33:45 +08:00
我理解的"@"是一个语法糖,定义funciton时用@
foo
修饰,相当于定义完后再写function=foo(function)
至于@
foo
带参数,相当于function=foo(*arg)(function)
5
yueyoum
2014-06-10 14:54:23 +08:00 via Android
@
poke707
需要理解吗? 文档里写的一清二楚啊
就是这个
关于
·
帮助文档
·
博客
·
API
·
FAQ
·
实用小工具
·
2675 人在线
最高记录 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 25ms ·
UTC 13:22
·
PVG 21:22
·
LAX 06:22
·
JFK 09:22
Developed with
CodeLauncher
♥ Do have faith in what you're doing.