[Python-Dev] Re: walrus operator and expression

2022-03-28 Thread MRAB
On 2022-03-28 23:59, Chris Angelico wrote: On Tue, 29 Mar 2022 at 09:53, Ethan Furman wrote: In the following bit of code: while s := input.read(MAXBINSIZE): while len(s) < MAXBINSIZE and ns := input.read(MAXBINSIZE-len(s)): s += ns line = binascii.b2a_bas

[Python-Dev] Re: walrus operator and expression

2022-03-28 Thread Guido van Rossum
Parenthesize. On Mon, Mar 28, 2022 at 3:50 PM Ethan Furman wrote: > In the following bit of code: > > > while s := input.read(MAXBINSIZE): > while len(s) < MAXBINSIZE and ns := input.read(MAXBINSIZE-len(s)): > s += ns > line = binascii.b2a_base64(s) >

[Python-Dev] Re: walrus operator and expression

2022-03-28 Thread Chris Angelico
On Tue, 29 Mar 2022 at 09:53, Ethan Furman wrote: > > In the following bit of code: > > > while s := input.read(MAXBINSIZE): > while len(s) < MAXBINSIZE and ns := input.read(MAXBINSIZE-len(s)): > s += ns > line = binascii.b2a_base64(s) > output.write(li