Using 'apply' as a decorator, to define constants

Jonathan Gardner jgardner at jonathangardner.net
Fri Aug 21 17:53:55 EDT 2009


On Aug 21, 6:36 am, Jonathan Fine <jf... at pytex.org> wrote:
>      @apply
>      def tags():
>          value = []
>          # complicated code
>          return value
>

Is this different from:

tags = []
# complicated code

I can see the argument that you are cleaning up a lot of intermediary
variables upon return, though.



More information about the Python-list mailing list