[Python-Dev] Why aren't decorators just expressions? (original) (raw)
Nick Coghlan ncoghlan at gmail.com
Sat Sep 16 08:21:03 EDT 2017
- Previous message (by thread): [Python-Dev] Why aren't decorators just expressions?
- Next message (by thread): [Python-Dev] Why aren't decorators just expressions?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 16 September 2017 at 21:22, Serhiy Storchaka <storchaka at gmail.com> wrote:
Actually I remember somebody raised this question a year or two ago, but don't remember details.
Aye, I remember that as well, but apparently the thread title for the discussion was sufficiently unrelated to the eventual topic that I can't find it with Google.
Anyway, I think the outcome of that particular thread was something like:
- The most reasonable-sounding enhancement request is the one to allow subscripts: "@deco_group[deco_id]"
- If we're going to relax the restrictions at all, it probably makes sense to just allow arbitrary expressions
- You can already use arbitrary expressions in practice by defining "def deco(x): return x", and then writing "@deco(whatever_expression_you_want)"
- Nobody was motivated enough to actually implement the change and then ask Guido if he'd changed his mind on the topic since 2004
Cheers, Nick.
-- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
- Previous message (by thread): [Python-Dev] Why aren't decorators just expressions?
- Next message (by thread): [Python-Dev] Why aren't decorators just expressions?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]