[Python-ideas] Infix functions
Nicholas Cole
nicholas.cole at gmail.com
Mon Feb 24 00:14:17 CET 2014
On Friday, 21 February 2014, Andrew Barnert <abarnert at yahoo.com> wrote:
> From: Chris Rebert <pyideas at rebertia.com <javascript:;>>
>
> Sent: Friday, February 21, 2014 2:47 PM
>
>
> > On Fri, Feb 21, 2014 at 2:05 PM, Andrew Barnert <abarnert at yahoo.com<javascript:;>
> >
> > wrote:
> >> While we're discussing crazy ideas inspired by a combination of a
> > long-abandoned PEP and Haskell idioms (see the implicit lambda thread),
> > here's another: arbitrary infix operators:
> >>
> >> a `foo` b == foo(a, b)
> >
> > Prior discussion:
> > https://mail.python.org/pipermail/python-ideas/2007-January/000050.html
> >
> > Which resulted in a new item in PEP 3099 ("Things that will Not Change
> > in Python 3000"; http://legacy.python.org/dev/peps/pep-3099/ ):
> > * No more backticks.
> > Backticks (`) will no longer be used as shorthand for repr -- but
> > that doesn't mean they are available for other uses. Even ignoring the
> > backwards compatibility confusion, the character itself causes too
> > many problems (in some fonts, on some keyboards, when typesetting a
> > book, etc).
> >
> >
> > I think people using suboptimal fonts and keyboard layouts should find
> > better ones...
>
>
> Thanks for pointing that out.
>
> OK, some other syntax then, there's no reason it has to be identical to
> Haskell. We can even go back to the original PEP's version:
>
> a @foo b = foo(a, b)
Please, no!
Everything on this list for the past few days seems to have been more and
more compact syntax for things that may or may not have a use.
I'm in favour of adding new things to the language. I really like the
except expressions pep. I look at it and I think, "I might have imagined
you could already do that, and it will make a lot of code more readable."
I think that is a great test for whether something should be added!
But function any class decorators seem to have created a wave of
suggestions for non-intuitive syntax based around funny characters and
notations. It is for the BDFL to say whether these are Pythonic, but I
hope none of them turn out to be.
I'm comfortable with a language that is very slightly more verbose than it
could be. Python at version 3.4 is very readable. Please let's keep it that
way!
I'm not getting at anyone - or any particular proposal - but there have
been a spate of similar things!
N.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140223/4710d433/attachment.html>
More information about the Python-ideas
mailing list