[Python-ideas] Quick idea: defining variables from functions that take the variable name

Sven R. Kunze srkunze at mail.de
Tue May 31 10:37:26 EDT 2016


On 31.05.2016 15:37, Steven D'Aprano wrote:
> because the compiler does it for us. Likewise we have @ decorator syntax
> to avoid writing the function name three times:
>
>      def spam():
>          ...
>
>      spam = decorate(spam)
>
>
> This solves the same problem for ordinary assignment: how to get the
> name or names on the left hand side over to the right hand side without
> re-typing them as strings?

So, why don't do it for all assignments without a special syntax?


Btw. there would be huge use-case for Django development. So, given your 
explanation, it sounds useful.


Sven


More information about the Python-ideas mailing list