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

2019-01-20 Thread James Lu
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. class Example: percent = property(`self.v*self.v2/100`)

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

2019-01-20 Thread Steven D'Aprano
On Sun, Jan 20, 2019 at 07:21:50PM -0500, 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 t