by loqi · 12y ago · 0 comments
def let(x):
yield x
And use it by "iterating": ...
for x in range(1, 101)
for divisible_by_5 in let(x % 5 == 0)
Still not as nice as having actual syntax for it. import contextlib
@contextlib.contextmanager
def let(*values):
yield values
with let(1, 2, 3) as (a, b, c):
print(a, b, c)