[Python-ideas] @return?
Mathias Panzenböck
grosser.meister.morti at gmx.net
Thu Apr 15 00:11:52 CEST 2010
On 04/14/2010 11:51 PM, spir ☣ wrote:
> On Wed, 14 Apr 2010 17:41:43 +0100
> Conrad Irwin<conrad.irwin at googlemail.com> wrote:
>
>> Changing things so that return isn't necessary at all would also solve
>> the problem, and quite nicely, but I think that's a far-too-drastic
>> change in semantics.
>
> Well actually, in _many_ languages the last expression is taken as return value.
> (Not only Lisp& friends, also pure OO ones like Io.)
Also in Ruby. Anyway I think this is ugly (and violates explicit is better than implicit) and might
even be dangerous because you "leek" the return value of the last statement. Basically you suddenly
need to always write None (or nil) at the end of a function that should not return anything.
-panzi
More information about the Python-ideas
mailing list