core

Core utilities common to all other modules

source

pad

 pad (s:str, pad_to:int)

Pad s with spaces to the right

test_eq(pad("hello", 37), 'hello                                ')

source

attrkey

 attrkey (attr)

Create a function that fetches attr of its input


source

str_enumerate

 str_enumerate (lst:list, start:int=0)

Create aligned sequence of numbered strings for strings in lst

Type Default Details
lst list
start int 0 enumerate from what number
Returns Iterable

source

cz

 cz (*funcs)

Compose functions together

Examples:

Function to compute number of digits in a decimal representation of a number:

cz(str, len)(32)
2