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? From my Pascal days I'm used to reading ":=" as "becomes". So this says: "If diff becomes x - base and g becomes gcd(diff, n) is greater than or equal to 1 then return g." But "diff becomes x - base" is not what we're testing! That makes it sound like the result of x - base may or may not get assigned to diff, which is not what's happening at all. The "as" variant makes more sense when you read it as an English sentence: if ((x - x_base) as diff) and ... "If x - x_base (and by the way, I'm going to call that diff so I can refer to it later) is not zero ..." -- Greg
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