Le 10/05/2018 à 09:32, Terry Reedy a écrit :
On 5/9/2018 11:33 PM, Guido van Rossum wrote:
I now think that the best way out is to rule `:=` in the top level
expression of an expression statement completely
I would like to be able to interactively enter
>>> a: = f(2,4)
to have 'a' echoed
On Thu, May 10, 2018 at 09:53:40AM -0400, Guido van Rossum wrote:
[...]
> So all in all I'm not sure I think this is important enough to support, and
> the rule "Use `:=` in expressions, not as a top level assignment" seems
> easier to explain and understand.
Like Terry, I too would find it
[Guido]
> ,,,
> OT about the name: despite Tim's relentless pushing of "binding expressions"
> in the end I think they should be called "assignment expressions" just like
> in C.
Ha! I already gave up on "binding expressions". For nearly a full
day, I've been rigidly calling them "binding
Tim Peters wrote:
Umm ... that's the opposite of what the Reference Manual says "lower":means:
"""
6.16. Operator precedence
The following table summarizes the operator precedence in Python, from
lowest precedence (least binding) to highest precedence (most
binding).
"""
Which is also in
On 5/10/2018 9:53 AM, Guido van Rossum wrote:
On Thu, May 10, 2018 at 3:32 AM, Terry Reedy
> wrote:
On 5/9/2018 11:33 PM, Guido van Rossum wrote:
I now think that the best way out is to rule `:=` in the top
level expression of an
On 10 May 2018 at 17:38, Ethan Furman wrote:
> On 05/10/2018 09:29 AM, M.-A. Lemburg wrote:
>>
>> On 10.05.2018 15:57, Guido van Rossum wrote:
>>>
>>> On Thu, May 10, 2018 at 5:04 AM, M.-A. Lemburg wrote:
>
>
To a (former Pascal) programmer, a := 1 doesn't read like an
On 05/10/2018 09:29 AM, M.-A. Lemburg wrote:
On 10.05.2018 15:57, Guido van Rossum wrote:
On Thu, May 10, 2018 at 5:04 AM, M.-A. Lemburg wrote:
To a (former Pascal) programmer, a := 1 doesn't read like an
operator. It's an assignment expression. If embedded expressions
is where Python is
On 10.05.2018 15:57, Guido van Rossum wrote:
> On Thu, May 10, 2018 at 5:04 AM, M.-A. Lemburg wrote:
>
>> To a (former Pascal) programmer, a := 1 doesn't read like an
>> operator. It's an assignment expression. If embedded expressions
>> is where Python is heading, it should be
On Thu, May 10, 2018 at 5:04 AM, M.-A. Lemburg wrote:
> To a (former Pascal) programmer, a := 1 doesn't read like an
> operator. It's an assignment expression. If embedded expressions
> is where Python is heading, it should be made very clear where
> the embedded expression
On Thu, May 10, 2018 at 3:32 AM, Terry Reedy wrote:
> On 5/9/2018 11:33 PM, Guido van Rossum wrote:
>
> I now think that the best way out is to rule `:=` in the top level
>> expression of an expression statement completely
>>
>
> I would like to be able to interactively enter
>
On 10 May 2018 at 13:33, Guido van Rossum wrote:
> (I vaguely recall this has been brought up before, but I'm too lazy to
> find the subtread. So it goes.)
>
> PEP 572 currently seems to specify that when used in expressions, the
> precedence of `:=` is lower (i.e. it binds
On Wed, May 9, 2018, 11:53 PM Guido van Rossum wrote:
> Oh, I hadn't even though of combining the two in one statement. That
> example is truly horrible (on first skim I didn't even notice it used two
> different assignment operators!) and strengthens my confidence that we
>
On Thu, May 10, 2018 at 7:04 PM, M.-A. Lemburg wrote:
> Not sure whether this was discussed before (I'm not really
> following the discussion), but what happens if you write:
>
> check = 0 and (a := 1)
>
> ? Will "a" get assigned or not ?
No, it won't. It's the same as any other
On 10.05.2018 05:52, Guido van Rossum wrote:
>> I would have := bind more tightly than the comma. Consider:
>>
>> a = 1, x := 2, 3
>>
>> IMO the only sane interpretation is "x = 2; a = 1, 2, 3". Effectively,
>> the := operator does not like to play with commas; we've already ruled
>> out "a, b :=
On 5/9/2018 11:33 PM, Guido van Rossum wrote:
I now think that the best way out is to rule `:=` in the top level
expression of an expression statement completely
I would like to be able to interactively enter
>>> a: = f(2,4)
to have 'a' echoed as well as bound.
--
Terry Jan Reedy
sons I mentioned
previously.
Angus Hollands
Message: 4
> Date: Wed, 9 May 2018 20:33:05 -0700
> From: Guido van Rossum <gu...@python.org>
> To: Python-Ideas <python-ideas@python.org>
> Subject: [Python-ideas] PEP 572: about the operator precedence of :=
> Message-ID:
>
[Guido]
> (I vaguely recall this has been brought up before, but I'm too lazy to find
> the subtread. So it goes.)
>
> PEP 572 currently seems to specify that when used in expressions, the
> precedence of `:=` is lower (i.e. it binds more tightly)
Umm ... that's the opposite of what the Reference
On Wed, May 9, 2018 at 8:42 PM, Chris Angelico wrote:
> On Thu, May 10, 2018 at 1:33 PM, Guido van Rossum
> wrote:
> > (I vaguely recall this has been brought up before, but I'm too lazy to
> find
> > the subtread. So it goes.)
> >
> > PEP 572 currently seems
On Thu, May 10, 2018 at 1:33 PM, Guido van Rossum wrote:
> (I vaguely recall this has been brought up before, but I'm too lazy to find
> the subtread. So it goes.)
>
> PEP 572 currently seems to specify that when used in expressions, the
> precedence of `:=` is lower (i.e. it
(I vaguely recall this has been brought up before, but I'm too lazy to find
the subtread. So it goes.)
PEP 572 currently seems to specify that when used in expressions, the
precedence of `:=` is lower (i.e. it binds more tightly) than all operators
except for the comma. I derive this from the
20 matches
Mail list logo