> On Jan 8, 2016, at 12:38 PM, Carl Meyer <c...@oddbird.net> wrote: > > Yes, you and Ryan are absolutely right, allowing `None` was a mistake > and I've removed it from the spec. For function-based middleware, > there's also the option to simply return the ``get_response`` callable > you were given, which has the same effect of "skipping yourself." That > falls out naturally from the concept, so I don't see any reason to > disallow it, but we don't need to mention it in the docs if we want to > stick to "one way to do it."
I hadn't considered the option of just returning ``get_response``. I really like it, because it avoids both raising an exception and importing a common symbol. While class-based middleware factories couldn't just do the same thing in the __init__ method, they could do that in a __new__ method instead, and then we could make returning the ``get_response`` function the "one way to do it." -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/8C97647F-48A2-477F-BEC8-D2BC7C676959%40ryanhiebert.com. For more options, visit https://groups.google.com/d/optout.