Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extending Decorators
#3
(Feb-14-2018, 03:01 AM)GalacticStarfish Wrote: A suggestion is that decorators be extended to make the earlier example valid syntax.
That is, the following two pieces of code would produce the same behavior.

@give_extra_functionality
foo
####################################
foo = give_extra_functionality (foo)

Good lord, I hope not. That looks like a do-nothing statement, not a late-bound decorator. A decorator fundamentally changes what a function is, having that separated from the function definition doesn't seem to make practical sense.
Reply


Messages In This Thread
Extending Decorators - by GalacticStarfish - Feb-14-2018, 03:01 AM
RE: Extending Decorators - by Gribouillis - Feb-14-2018, 08:29 AM
RE: Extending Decorators - by nilamo - Mar-22-2018, 09:43 PM
RE: Extending Decorators - by wavic - Mar-23-2018, 09:46 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020