[Python-ideas] Inline assignments using "given" clauses
apalala at gmail.com
Sat May 12 20:27:53 EDT 2018
> if (diff := x - x_base) and (g := gcd(diff, n)) > 1:
> return g
I don't see the advantage in that succinctness:
g = special_gcd(x - x_base, n)
The code bases I work on constantly move towards having the next guy grok
what's going on just by reading the code.
It could also be:
if special_gcd(x - x_base, n) as g:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas