
Hi Holger, jholg@gmx.de wrote:
Find attached a patch that:
- changes the above to apply xsi:nil="true" for None value arguments
Ok.
- lets DataElement() graciously handle ObjectifiedDataElement arguments, keeping their attributes intact, if not overridden by the DataElement() args. This also reuses existing xsi:type or py:pytype information, unless _pytype and/or _xsi are provided as parameters to DataElement()
Previously, DataElement() cut off all attributes if given an ObjectifiedDataElement instance.
Ok.
- Type-checks the _value against the given type hint: You will run into the error anyway - sooner or later - when accessing the .pyval in any way, so why not during instantiation.
Ok.
Tests are included for the described behaviour.
Cool, thanks.
Additionally, I've revamped some of the tests I provided earlier and split them up: More but smaller test methods now.
That's even better. :)
Please try it out, if any of the DataElement changes are not ok I can also send only the split-up tests, of course.
Btw.: I'm always getting
IOError: Error reading file '/data/pydev/hjoukl/LXML/lxml-1.3/src/lxml/tests/test_xinclude.xml': failed to load external entity "/data/pydev/hjoukl/LXML/lxml-1.3/src/lxml/tests/test_xinclude.xml"
due to some missing xml file lately when running the tests.
I moved an XML file to a subdirectory to also test relative references in a base directory. But it should be fixed in the 1.3 release... Stefan