[Python-ideas] Backtick expression: similar to a shorter lambda syntax

Bruce Leban bruce at leban.us
Wed Jan 23 18:11:07 EST 2019


On Wed, Jan 23, 2019 at 1:07 PM James Lu <jamtlu at gmail.com> wrote:

> Backtick expressions (now) use the same scoping and same binding rules as
> other functions.
>

What do you mean by "now"?? There are no backtick expressions in Python
anymore and they were never functions.


> The only difference is that
> class Class:
>   stacticmethod = `...`
>   staticmethod = lambda: ...
>   def instancemethod = `...` # an instancemethod that's called with self
> passed in
>   def property = property(`...`) # an instancemethod that's called with
> self passed in
>

You seem to be inventing new syntax as you go. And you haven't told us how
the first two above differ.


> > The only thing that I can think of is that you want `foo + ^bar` to be
> another way of writing lambda bar: foo + bar with some under-specified behavior
> for evaluating foo and different under-specified behavior for evaluating
> bar.
>
> That is what `lambda bar: foo + ^bar` means.
>

I have no idea what this means. You're giving syntax without semantics. The
word "that" in your sentence is an unbound reference.

>
> A caret in a backtick expression indicates that the name after the caret
> is a parameter. All names with the same name must have a caret before them.
> Mandatory parameters can be passed in as keyword arguments or as positional
> ones.
>

In a word, ick. So to find the parameters for a function, I need to scan
through the entire text of the function looking for ^? And you think that's
an improvement?

You've given no explanation of how this is better and saving typing the
word lambda isn't enough. All in all this sounds like "but these go to 11"
justification and that really is insufficient.

I'm -11.

--- Bruce
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20190123/97b487e6/attachment.html>


More information about the Python-ideas mailing list