def expand_init(init):
 typ = type(init)
 if (typ == NamedInitializer):
  des = [expand_init(dp) for dp in init.name]
  return (des, expand_init(init.expr))
 elif (typ in (InitList, ExprList)):
  return [expand_init(expr) for expr in init.exprs]
 elif (typ == Constant):
  return ['Constant', init.type, init.value]
 elif (typ == ID):
  return ['ID', init.name]

def expand_init ( init ) : typ = type ( init ) if ( typ == NamedInitializer ) : des = [ expand_init ( dp ) for dp in init . name ] return ( des , expand_init ( init . expr ) ) elif ( typ in ( InitList , ExprList ) ) : return [ expand_init ( expr ) for expr in init . exprs ] elif ( typ == Constant ) : return [ 'Constant' , init . type , init . value ] elif ( typ == ID ) : return [ 'ID' , init . name ]
converts an initialization into a nested list .