updated pre-PEP: The create statement
Peter Hansen
peter at engcorp.com
Tue Apr 11 06:45:21 EDT 2006
Michele Simionato wrote:
> Honestly, I don't want the 'create' statement to be used to write XML
> in Python.
> I think this would be a misuse of the functionality. OTOH I believe
> that the main selling point for the 'create' statements is that it make
> it easy to implement declarative minilanguages, so I have given an XML
> example. To solve the ordering issue one
> should change the internals of Python, in such a way to pass an ordered
> dict ...
That solves "the ordering issue", but not the real issue, which is that
XML can have *multiple* elements with the same name (even though ids
must be unique, but that's irrelevant to the point here). Attributes on
an element are mappings, but elements are (nested) lists of items in
XML, not mappings.
> You can pull out the example in the official
> PEP, if you like.
Please do. If this is supposed to have anything to do with namespaces,
it has nothing to do with the type of data structures XML is capable of
and the presence of this example would only lead some people to think
there can't be a good use case for the whole idea if that's the best we
can come up with to demonstrate its benefits.
-Peter
More information about the Python-list
mailing list