[issue14065] Element should support cyclic GC
Eli Bendersky
report at bugs.python.org
Fri Mar 16 05:54:05 CET 2012
Eli Bendersky <eliben at gmail.com> added the comment:
Martin, why do you think it's important for Element to support this? After all, this is XML, not an arbitrary tree. As such, the children of Element can only be other elements, and attribute values should be strings. Anything else will result in errors when attempting to write that Element into a real XML file. Semantically it doesn't make sense for the value of an attribute to be a list or any other container, for that matter.
In your sample code, if you attempt to dump or write L[0] before deleting it, you'll get an error.
Adding GC handling complicates the code (even if not by too much), and this complication should be justified. Can you see a valid use case where GC handling would be required?
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14065>
_______________________________________
More information about the Python-bugs-list
mailing list