Skip to content

Commit 94e8841

Browse files
committed
beautify example
1 parent 9987b1d commit 94e8841

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def g(x):
179179
def amb(lst, cc): # McCarthy's amb operator
180180
if not lst:
181181
return fail()
182-
first, *rest = lst
182+
first, *rest = tuple(lst)
183183
if rest:
184184
ourcc = cc
185185
stack.append(lambda: amb(rest, cc=ourcc))
@@ -190,9 +190,9 @@ def fail():
190190
return f()
191191
192192
def pythagorean_triples(maxn):
193-
z = call_cc[amb(tuple(range(1, maxn+1)))]
194-
y = call_cc[amb(tuple(range(1, z+1)))]
195-
x = call_cc[amb(tuple(range(1, y+1)))]
193+
z = call_cc[amb(range(1, maxn+1))]
194+
y = call_cc[amb(range(1, z+1))]
195+
x = call_cc[amb(range(1, y+1))]
196196
if x*x + y*y != z*z:
197197
return fail()
198198
return x, y, z

0 commit comments

Comments
 (0)