[Python-ideas] @return?

spir ☣ denis.spir at gmail.com
Thu Apr 15 19:42:51 CEST 2010


On Thu, 15 Apr 2010 00:07:57 +0200
Mathias Panzenböck <grosser.meister.morti at gmx.net> wrote:

> Maybe only allow them at certain places where they can be seen as an extension to an already 
> existing statement syntax (not to an expression syntax):
> 
> foo.bar = def(egg, spam):
> 	pass
> 
> return def(egg, spam):
> 	pass
> 
> yield def(egg, spam):
> 	pass

This is more or less the same argument as what I stated in a previous post: the issue is a different, incompatible, format for func defs, compared to ordinary expression. The possible name prefixing the definition breaks the pattern. More precisely, "def" (or "function"/"method") should come just before the parameter list to allow a func def be used like any other expression.
This won't change... but what about an alternative, like in Lua?

Denis
________________________________

vit esse estrany ☣

spir.wikidot.com



More information about the Python-ideas mailing list