Ok, that makes sense, thanks. I guess needing syntax for this is a consequence of Python's quirky lambdas. In languages with full lambdas, you can just wrap an anonymous function at the point of definition.
profile = login_required(function (...) ...) -- in Lua
(define profile (login-required (lambda (...) ...))) ; in Scheme
let profile = login_required(fun ... -> ...) (* in OCaml *)
Putting the decorator on its own line draws attention to it, though. This is probably also another instance of Python's "flat is better than nested" design choice.
Ok, that makes sense, thanks. I guess needing syntax for this is a consequence of Python's quirky lambdas. In languages with full lambdas, you can just wrap an anonymous function at the point of definition.
Putting the decorator on its own line draws attention to it, though. This is probably also another instance of Python's "flat is better than nested" design choice.