Функциональный стиль haskell
>>> def RecListValue(list_value):
return type(list_value) in [list,str,tuple] and list_value and 1+RecListValue(list_value[1:]) or 0
>>> example_struct = [range(10), ("one",)*12, "simple string", 12]
>>> map(RecListValue, example_struct)
[10, 12, 13, 0]
>>>