. Python 2.1 function attributes
John W. Baxter
jwbnews at scandaroon.com
Sat Jan 27 21:22:16 EST 2001
In article <mailman.980593892.725.python-list at python.org>, "Tim Peters"
<tim.one at home.com> wrote:
> Barry also added code to Python 2.1 to let you write, e.g.,
>
> def f() >> x:
> x = 1
> y = 2
>
> as a short way to spell "whatever the value of x is at the end of the
> function, return that". I'm sure you'll agree that's much cleaner than
> the
> clumsy
>
> def f():
> x = 1
> y = 2
> return x
>
> people suffer with today.
>
> hoping-a-truly-bad-idea-adds-some-perspective<wink>-ly y'rs - tim
Hmmm...seems to be a kin to an early boss' idea (ca 1965-1969) that the
comefrom
and various conditional forms of comefrom could replace the
goto
and various conditional goto forms. Marty went to a fair amount to
trouble to prove to himself that the idea worked (but without any
intention of actually building it, so far as I know.).
--John
--
John W. Baxter Port Ludlow, WA USA jwbnews at scandaroon.com
More information about the Python-list
mailing list