VA
Size: a a a
VA
КП
A
for list_item in my_request_list:
yield list_item
БГ
class compose:
def __init__(self, chain):
self.chain = chain[:]
if not any(map(callable, chain)):
raise ValueError("chain must be iterable of callables")
def __call__(self, *args, **kwargs):
func, *funcs = self.chain
result = func(*args, **kwargs)
for func in funcs:
result = func(result)
return result
БГ
AT
AT
s
БГ
def compose(chain):
if not any(map(callable, chain)):
raise ValueError("chain must be iterable of callables")
if not chain:
raise ValueError ("chain is empty")
def composed(*args, **kwargs):
func, *funcs = chain
result = func(*args, **kwargs)
for func in funcs:
result = func(result)
return result
return composed
БГ
s
s
БГ
AT
def compose(chain):
if not any(map(callable, chain)):
raise ValueError("chain must be iterable of callables")
if not chain:
raise ValueError ("chain is empty")
def composed(*args, **kwargs):
func, *funcs = chain
result = func(*args, **kwargs)
for func in funcs:
result = func(result)
return result
return composed
R3
s
RC
a
R3
s