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

2019-01-21 Thread Greg Ewing
Calvin Spealman wrote: The one positive I see is that because there is no open and closing pair of backticks, like parens or brackets, you can't easily nest this syntax and I actually like how it inherently discourages or makes that impossible! Perhaps surprisingly, the backtick syntax in

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

2019-01-21 Thread Steven D'Aprano
On Mon, Jan 21, 2019 at 05:56:17PM +1100, Steven D'Aprano wrote: [...] > > And a few more examples for clarity. > > > > def example(): > > locals()['a'] = 1 > > expr = `a+1` > > return expr() # error: one variable is required > > Still not clear to me. It might help if you showed expected input

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

2019-01-21 Thread Jonathan Fine
> Backtick expressions work exactly like lambdas, except that they are bound to > the instance they are created in every time that class is used to create one. I would if possible very much like to see some real world examples of Python code, that would benefit by being rewritten to use the new

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

2019-01-21 Thread Calvin Spealman
On Sun, Jan 20, 2019 at 9:43 PM James Lu wrote: > Backtick expressions work exactly like lambdas, except that they are bound > to the instance they are created in every time that class is used to create > one. To illustrate, this “percent” property is bound to the instance, not > to the class. >