[Tutor] Writing decorators?

Ben Finney ben+python at benfinney.id.au
Wed Jul 20 03:48:23 EDT 2016


Michael Welle <mwe012008 at gmx.net> writes:

> Somewhere in this thread (or the one talking about decorators after
> this thread) it was said that a decorator 'changes a function'. I not
> a native English speaker, so it could just be a language problem. But
> to me it seems the function is replaced, not changed?

That's correct.

Don't be surprised, though, if the concept “replace the object
referenced by ‘foo’ with a different object and discard the prior object
at that reference“ is glossed to “change ‘foo’” in casual usage :-)

-- 
 \      “Hey Homer! You're late for English!” “Pff! English, who needs |
  `\          that? I'm never going to England!” —Barney & Homer, _The |
_o__)                                                        Simpsons_ |
Ben Finney



More information about the Tutor mailing list