[issue15474] Differentiate decorator and decorator factory in docs
New submission from Éric Araujo
Changes by Ezio Melotti
Changes by Ezio Melotti
Ezio Melotti added the comment:
The tutorial doesn't seem to mention decorators, do you think this should be covered there?
FWIW while explaining decorators I usually use 3 examples:
1) a simple decorator that accepts a function, does something, and returns the same function;
2) a decorator that defines and returns an inner function;
3) a decorator factory, that defines two nested inner functions
Not sure if it's necessary to include the first example though.
----------
_______________________________________
Python tracker
Nick Coghlan added the comment:
No, using decorators needs to be in the tutorial, but writing your own is a metaprogramming task that's beyond the tutorial's scope.
A HOWTO guide would be appropriate, though.
----------
_______________________________________
Python tracker
Andrés Delfino
Fred L. Drake, Jr.
Andrés Delfino
Windson Yang
Andrés Delfino
Ezio Melotti
Andrés Delfino
Andrei Daraschenka
Andrés Delfino
Raymond Hettinger
participants (8)
-
Andrei Daraschenka
-
Andrés Delfino
-
Ezio Melotti
-
Fred L. Drake, Jr.
-
Nick Coghlan
-
Raymond Hettinger
-
Windson Yang
-
Éric Araujo