On 24/04/2018 02:42, Chris Jerdonek wrote:
On Mon, Apr 23, 2018 at 4:54 PM, Greg Ewing <greg.ew...@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
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to