. Python 2.1 function attributes

Thomas Wouters thomas at xs4all.net
Sat Jan 27 11:00:31 EST 2001


On Sat, Jan 27, 2001 at 02:18:46PM +0000, Robin Becker wrote:
> In article <mailman.980593892.725.python-list at python.org>, Tim Peters
> <tim.one at home.com> writes
> ....
> >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.
> >
> ....
> mmmhhhh :( what happens with
> 
> def f() >> x:
>         return 1
> 
> 
> def f() >> x:
>         y=2
>         return y
> 
> seems to me that having multiple ways of doing return is a bad idea

You forgot to quote the clue:

> > hoping-a-truly-bad-idea-adds-some-perspective<wink>-ly y'rs  - tim

Tim wasn't serious, the syntax hasn't even been proposed. (At least, I
haven't seen the proposal. Then again, maybe Barry did propose it, and all
those mail delays on python-dev were an attempt to get it approved and
checked in before anyone oculd complain :-)

That-was-a-joke-too-in-case-you-wondered-ly y'rs,

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!




More information about the Python-list mailing list