Strange Python 2.1 return style (was Re: . Python 2.1 function attributes)
Chris Gonnerman
chris.gonnerman at usa.net
Sat Jan 27 11:34:29 EST 2001
----- Original Message -----
From: "Peter Hansen" <peter at engcorp.com>
> Tim Peters wrote:
> > Barry also added code to Python 2.1 to let you write, e.g.,
> >
> > def f() >> x:
> > x = 1
> > y = 2
> >
>
> Is there a smiley missing from the above? Sounds like a
> bad April Fool's joke, to me.
Motion seconded! The 'print >>' statement seems natural to an old shell
scripter but the
'def f() >> x:' form is plain confusing. If I saw it in some module source
somewhere I would
say "what the hork is that?" and waste an hour or two online (more or less)
trying to figure it out.
> I think some people are starting to get nervous
> about '>>' and other such non-intuitive, C++-like
> cryptic sugary syntax.
I'll second that motion too!
> Whatever happened to 'one way of doing things',
> and 'simpler is better than completely twisted'?
When I learned Python it was like this:
PERL: Boring name, twisted syntax
Python: Twisted name, boring syntax
and I LIKED it that way. Unsurprising syntax and semantics in a language
which
'just works' is vastly my preference!
I'm not against change. I just want everything plain, logical, and
consistent. I've spent
too many hours armwrestling with code written by others who prefer a
different subset
of whatever language... in Python (up to now) I haven't had to expand my
knowledge of
the language (much) just to read another person's code.
More information about the Python-list
mailing list