Ariel Poliak <apol...@gmail.com> added the comment:

Ideally, this would be taken care by the _serialize_xml() with a parameter 
specified when called from within write().

However, the signature for the _serialize_xml() function cannot be changed, as 
it needs to match the signature for the rest of the _serialize_*() functions 
(since which serializing function is chosen from a dictionary that then calls 
the specific function using the same parameters.

An alternative to this would be to create a single variable within the scope of 
ElementTree at runtime if the code calls to write out the full tags closing, 
and have the _serialize_xml() function check for the presence and value of that 
variable.

I initially approached the problem via the flags on Element instead due to the 
perceived usefulness of giving the programmer full control on how the tree is 
serialized into XML.

However, if I'm the only one that sees that as useful, I can certainly refactor 
the code to go with the above solution (or some other more elegant solution).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14377>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to