I have a python list as
[
(A,{'a':1,'b':2,'c':3,'d':4}),
B,{'a':1,'b':2,'c':3,'d':4}),
...
]
I want to know if there is a standard library of serializing this kind of list to xml or should I hand code it to a file.
Edit : Added Detail
Assuming this is used to construct a message such that
message = A( Feild attributes{‘a’:1,’b’:2,’c’:3,’d’:4}) || B Field attributes{‘a’:1,’b’:2,’c’:3,’d’:4}) || C Field attributes{‘a’:1,’b’:2,’c’:3,’d’:4})
“use json/yaml/whitespace” comments aside (I suppose you have your reasons to do so, instead go for pickle/json),
you can try the very pythonic elementtree library (in the standardlib), or even use some advice from google : search “converting python dictionary to xml”
(not to sound too rude .. take it with a wink)
looking at your example, what are A and B ? integers ? strings ? classmethods ?