44mg
last updated 2 years ago by Baseline #
I agree, especially since decorators do so many "advanced" things (rebinding names, taking functions as arguments, dynamically defining inner functions, etc.)
"Advanced Function Features" would also be a good place for generators, instead of "Classes", where they currently inexplicably live.
Comments
A "debugging decorator" is definitely more useful. I've always had pretty good success explaining decorators to people with adding functions, which is why I used it as the example.
Baseline 2 years ago #

I agree that the decorators should be moved to a later place, and I also think the example could be simplified (an adding function is a bit too abstract for me); how about a "debugging decorator" instead, which simply prints the arguments and return values for a decorated function?
effbot 2 years ago #