A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2018-April/152933.html below:

[Python-Dev] PEP 572: Assignment Expressions

[Python-Dev] PEP 572: Assignment Expressions [Python-Dev] PEP 572: Assignment ExpressionsJeff Allen ja.py at farowl.co.uk
Tue Apr 24 03:14:12 EDT 2018
On 24/04/2018 02:42, Chris Jerdonek wrote:
> On Mon, Apr 23, 2018 at 4:54 PM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
>> Tim Peters wrote:
>>> if (diff := x - x_base) and (g := gcd(diff, n)) > 1:
>>>      return g
>> My problem with this is -- how do you read such code out loud?
> It could be...
>
> "if diff, which we define as x - x_base, and g, which ....." etc.
>
That's good. It also makes it natural to expect only a simple name. One 
can "define" a name, but assignment to a complex left-side expression is 
not definition (binding).

Jeff Allen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20180424/1f54a4f0/attachment.html>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4