Re: PEP 572 -- Assignment Expressions

2018-11-27 Thread bob gailer
On 11/27/2018 5:48 AM, Ivo Shipkaliev wrote: Hello. Maybe it's too late for a discussion, but I just couldn't resist. I just found out about this new ":=" operator. I need to ask: What is the need for this additional ":" to the "="? Did you read the PEP? It answers the question.

Re: PEP 572 -- Assignment Expressions

2018-11-27 Thread Chris Angelico
On Wed, Nov 28, 2018 at 4:38 AM Ivo Shipkaliev wrote: > >Hello. >Maybe it's too late for a discussion, but I just couldn't resist. >I just found out about this new ":=" operator. I need to ask: > >What is the need for this additional ":" to the "="? >Why: > if (match :

PEP 572 -- Assignment Expressions

2018-11-27 Thread Ivo Shipkaliev
Hello. Maybe it's too late for a discussion, but I just couldn't resist. I just found out about this new ":=" operator. I need to ask: What is the need for this additional ":" to the "="? Why: if (match := pattern.search(data)) is not None: # Do something wit