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

2019-01-23 Thread Bruce Leban
On Wed, Jan 23, 2019 at 1:07 PM James Lu 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

Re: [Python-ideas] Potential PEP: with/except

2019-01-23 Thread Adrien Ricocotam
I have a neutral feeling about the proposal but I’d like to suggest something We can extend the try/with to other blocks, as suggested. What could be done to prevent any ambiguity is : try with blabla as blabla2 : ... except: ... Which is equivalent of : try: with blabla as blabl2:

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

2019-01-23 Thread Christopher Barker
> > > 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. >

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

2019-01-23 Thread James Lu
Backtick expressions (now) use the same scoping and same binding rules as other functions. The only difference is that class Class: stacticmethod = `...` staticmethod = lambda: ... def instancemethod = `...` # an instancemethod that's called with self passed in def property =

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

2019-01-23 Thread Bruce Leban
On Sun, Jan 20, 2019 at 6: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, ... First, if there is a useful procedure I am strongly against using