V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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
mapnaqi
V2EX  ›  Python

scrapy Middleware 里面的类算不算装饰器?

  •  
  •   mapnaqi · Feb 27, 2019 · 2667 views
    This topic created in 2628 days ago, the information mentioned may be changed or developed.
    7 replies    2019-03-02 19:06:41 +08:00
    daiqiangbudainiu
        1
    daiqiangbudainiu  
       Feb 27, 2019
    不算吧,我记得装饰器的形参应该是 function
    BiggerLonger
        2
    BiggerLonger  
       Feb 27, 2019
    應該是跟 Django 的 middleware 一個概念
    ipwx
        3
    ipwx  
       Feb 27, 2019
    其实没必要死扣这些概念。

    如果你想死抠,那么顾名思义,Middleware 就是 Middleware。
    besttime
        4
    besttime  
       Feb 27, 2019
    Middleware 应该是中间件,跟装饰器完全没关系的啊。
    xiayebaibi
        5
    xiayebaibi  
       Feb 27, 2019 via Android
    发现同款头像
    kidlfy
        6
    kidlfy  
       Mar 1, 2019
    你想写带装饰器的 middleware 也不是不可以 但是 middleware 不是装饰器 去看看这两词的概念就知道了
    911speedstar
        7
    911speedstar  
       Mar 2, 2019
    中间件和装饰器 两个概念
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5466 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 08:53 · PVG 16:53 · LAX 01:53 · JFK 04:53
    ♥ Do have faith in what you're doing.