[Python-ideas] Make partial a built-in
אלעזר
elazarg at gmail.com
Tue Sep 20 04:22:10 EDT 2016
Yeah I did say it was a strawman :)
On Tue, Sep 20, 2016 at 11:17 AM Chris Angelico <rosuav at gmail.com> wrote:
> On Tue, Sep 20, 2016 at 6:09 PM, אלעזר <elazarg at gmail.com> wrote:
> > I meant something like making it a "__bind__" (just a strawman
> suggestion)
> > and do the same lookup as foo() does, and using a (wrong)
> > functional-programming-inspired syntax
> >
> > foo 5 ()
> >
> > Such a syntax will have the side benefit of allowing calling print in a
> > similar way to Python2, which people seem to love.
> >
> > print "hello" ()
> >
>
> Python has a rule that syntax shouldn't look like grit on Tim's
> screen. In this case, it looks like the *absence of* grit, which is
> even worse :) You're giving meaning to the abuttal of two tokens, the
> first of which must be callable but the second can be anything. And it
> creates the scary situation of giving valid-but-useless meaning to
> something all too common in Py2 code:
>
> print "hello"
>
> This would now create a function that, if called, would print "hello",
> but then abandons it without a second thought. So it'd work in 2.7,
> fail with an opaque error in 3.3, fail with a more informative error
> in 3.5, and silently do nothing in 3.7. No thank you! :)
>
> ChrisA
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160920/a59a2d77/attachment.html>
More information about the Python-ideas
mailing list