lwzm
2/24/2014 - 1:20 PM

list_all_same_type.py

def list_all_same_type(type_conv):
    def conv(v):
        return [conv(i) for i in v] if isinstance(v, list) else type_conv(v)
    return conv