推荐学习书目
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
jianghu52
V2EX  ›  Python

python 新人求教关于装饰器的问题。

  •  2
     
  •   jianghu52 · Jun 10, 2014 · 3715 views
    This topic created in 4381 days ago, the information mentioned may be changed or developed.

    我想知道在有参数的装饰器装饰有参数的函数的时候,编译器是怎么一个执行顺序
    5 replies    2014-06-10 14:54:23 +08:00
    ultimate010
        2
    ultimate010  
       Jun 10, 2014
    学习了。
    jianghu52
        3
    jianghu52  
    OP
       Jun 10, 2014
    谢谢。说好的很明白
    poke707
        4
    poke707  
       Jun 10, 2014
    我理解的"@"是一个语法糖,定义funciton时用@foo修饰,相当于定义完后再写function=foo(function)
    至于@foo带参数,相当于function=foo(*arg)(function)
    yueyoum
        5
    yueyoum  
       Jun 10, 2014 via Android
    @poke707

    需要理解吗? 文档里写的一清二楚啊
    就是这个
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1253 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 17:28 · PVG 01:28 · LAX 10:28 · JFK 13:28
    ♥ Do have faith in what you're doing.