On Sun, 19 Sep 2010, Ian Bicking wrote:

On Sun, Sep 19, 2010 at 11:32 AM, Chris McDonough <chr...@plope.com> wrote:

I propose to write in the PEP that a middleware should provide an
"app" attribute to get the wrapped application or middleware.
It seems to be the most common name used out there.

We can't really mandate this because middleware is not required to be an
instance.  It can be a function.


We could suggest it, and suggest the attribute name.  Composites, lazy
loading middleware, or a bunch of other situations can break it... but it's
nice for introspection tools to at least be able to attempt to run down the
chain.  Middleware is almost always a closure if it's a function, I believe,
so you could still do:

If the goal here is to write a spec, then I would prefer that spec
say what must be done and what must not be done, not what may be
done, could be done or is suggested as perhaps a best practice.
Those sorts of things belong in communication that is out of band of
the spec.

--
Chris Dent                                   http://burningchrome.com/
                                [...]
_______________________________________________
Web-SIG mailing list
Web-SIG@python.org
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: 
http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com

Reply via email to