[Python-ideas] @return?

alex23 wuwei23 at gmail.com
Fri Apr 16 04:52:18 CEST 2010


Conrad Irwin <conrad.ir... at googlemail.com> wrote:
>     result = register_callback(def success(arg):
>                                    print(arg)
>                               )
>
> I think it is significantly nicer than the decorator abuse:
>
>     @register_callback
>     def result(arg):
>         print(arg)

How is that an abuse of the decorator syntax?

How is your @return syntax more clear in its intent than:

   from decorator import decorator

   @decorator
   def a_decorator(...):
      ....

Is returning a function from within another function - outside of
decorators - that recurring a task that we need new syntax that not
only overloads existing syntax for a different use, but also disrupts
the readability of a function?



More information about the Python-ideas mailing list