Module pywander.functools

Functions

def build_compose_function(*funcs)

combine a sequence functions to a compose function

def build_stream_function(*funcs)

combine a sequence funtion to a compose function, and for the sake of simplicity, limited the input parameter to a dict object.

def flatten(inlst)

make multiple layer list or tuple to one dimension list

>>> flatten((1,2,(3,4),((5,6))))
[1, 2, 3, 4, 5, 6]
>>> flatten([[1,2,3],[[4,5],[6]]])
[1, 2, 3, 4, 5, 6]
def sumall(*args)

sum all numbers, support multiple layer structure.

>>> sumall(1,1,2,3,[1,2,3])
13
>>> sumall(1,1,2,3,[1,2,3],(4,5,6),[[5,5],[6]])
44
>>>