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
>
> > 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.
>
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 =
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
On Mon, Jan 21, 2019 at 05:56:17PM +1100, Steven D'Aprano wrote:
[...]
> > Variable names that are declared but have not been assigned to will be
> > considered to exist for the purposes of the backtick expression.
>
> Python doesn't have variable declarations, so I don't know what this
>
Jonathan Fine writes:
> > 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
Going back to the original post:
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.
?!? bound every time that instance is used to
The problem with using the back-tick is that it is far too easy to miss read it
for a single-quote.
back-tick in bash has the $( xxx ) replacement that avoids the problem.
Please find an alternative syntax that avoid the problem.
Barry
> On 22 Jan 2019, at 13:42, James Lu wrote:
>
> Later
On Mon, Jan 21, 2019 at 8:47 AM Jonathan Fine 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.
>
> I would if possible very much like to see some real world examples of
>
I’m a little busy recently, so I’ll reply to as much as I can now and reply to
the rest later.
Scratch the stuff I said about scope. Backtick expressions should inherit the
scope normally like any other nested function.
> That's different behaviour from regular functions, where names are only
Later today I will send a working implementation of backtick expressions as a
function call.
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct:
> On Jan 21, 2019, at 1:56 AM, Steven D'Aprano wrote:
>
> It disturbs me that you believe you get to tell everyone what syntax
> highlighting they should use for this feature. That's pretty
> dictatorial, and not in a good BDFL way.
I don’t want to tell anyone how to make their syntax
> On Jan 21, 2019, at 1:56 AM, Steven D'Aprano wrote:
>
> It disturbs me that you believe you get to tell everyone what syntax
> highlighting they should use for this feature. That's pretty
> dictatorial, and not in a good BDFL way.
I don’t want to tell anyone how to make their syntax
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
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
> 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
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.
>
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
18 matches
Mail list logo