(p=None, q=None)
return list(p)
Make `p` listy and the same length as `q`.
Make `p` listy and the same length as `q`.
Make p listy and the same length as q .
def listify(p=None, q=None):
    "Make `p` listy and the same length as `q`."
    if p is None: p = []
    elif isinstance(p, str): p = [p]
    elif not isinstance(p, Iterable): p = [p]
    n = q if type(q) == int else len(p) if q is None else len(q)
    if len(p) == 1: p = p * n
    assert len(p) == n, f'List len mismatch ({len(p)} vs {n})'
    return list(p)
def listify ( p = None , q = None ) : if p is None : p = [ ] elif isinstance ( p , str ) : p = [ p ] elif not isinstance ( p , Iterable ) : p = [ p ] n = q if type ( q ) == int else len ( p ) if q is None else len ( q ) if len ( p ) == 1 : p = p * n assert len ( p ) == n , f'List len mismatch ({len(p)} vs {n})' return list ( p )