21 karma · joined June 10, 2023
# The Belt.
def belt():
# return itertools.cycle([1,2,3,4,5])
x = 1
while True:
yield x
x += 1
if x > 5:
x = 1
# The +1
def add1(iterable):
for x in iterable:
yield x + 1
# The +y
def add(y):
def _(iterable):
for x in iterable:
yield x + y
return _
# The Oddifier
def oddonly(iterable):
for x in iterable:
if x % 2 == 1:
yield x
# The Reaper
def partition(n):
assert n > 0
def _(iterable):
batch = []
for x in iterable:
batch.append(x)
if len(batch) == n:
yield batch
batch = []
if batch:
yield batch
return _
# The Composer
def compose(iterable, t1, t2):
yield from t2(t1(iterable))
# The Plumber
def pipe(iterable, p):
for xform in p:
iterable = xform(iterable)
yield from iterable
# The Press.
def printall(iterator):
import time
for x in iterator:
print(x, end=", ", flush=True)
time.sleep(0.3)
# printall(pipe(belt(), [add(1)])) # 2, 3, 4, 5, 6, 2, 3, 4...
# printall(pipe(belt(), [add(1), oddonly])) # 3, 5, 3, 5, ...
printall(pipe(belt(), [add(1), oddonly, partition(3)])) # [3, 5, 3], [5, 3, 5], ...there is this: https://ma.rkusa.st/store-sqlite-in-cloudflare-durable-objec... and this: https://developers.cloudflare.com/d1/
So I'm thinking it could (be made to) work.
- "Key" and "important" both indicate notable elements.
- "Key" can also be used to indicate a required element, i.e. "keystone", however it is not always used in this way.
- "Key" can also be used to indicate "there is only one" though it is not always used in this way.
When "key" is meant as "singular & required & notable" it probably carries the most weight of all these words. However, since it is not always used in that way, I personally tend to give it less weight.
In casual use I would order them like this (strongest to weakest): crucial, vital, key, important.
In formal use I would order them like this (strongest to weakest): key, vital, crucial, important.
My favorite thesaurus, ChatGPT, agrees with my casual use ranking. https://chat.openai.com/share/10bb8195-c7cd-4c0c-935f-f5b4c3...
Here's what everyone actually wanted to talk about: Trust.
Here's what we missed: ...