[lxml-dev] merge annotate() and xsiannotate() into single function

Stefan Behnel stefan_ml at behnel.de
Thu Jun 21 19:53:07 CEST 2007


Hi Holger,

in the current trunk, objectify has those two big functions "annotate()" and
"xsiannotate()" that do very similar things in similar ways. When I was
changing the annotation behaviour for empty elements, I noticed that it would
be hard to keep the two in sync, so I decided to merge them. Here is a patch
that matches the current test cases on the trunk (note that I did not yet
merge your tests for 1.3 back).

Holger, could you look through it to check if this is what you would expect? I
know that it does not guarantee exactly the same behaviour as before, so there
will likely be cases where some annotations come out different than now.

Actually, xsiannotate() was not yet in a release, but I even think that
objectify shouldn't guarantee any particular annotations anyway. I rather
prefer something like: "it always yields types that make sense for the current
data".

Another point here: the current XSI type order prefers "integer" over "long"
and "float" over "double". Shouldn't those be swapped to always annotate with
the widest possible type?

Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: annotate-merge.patch
Type: text/x-diff
Size: 11557 bytes
Desc: not available
Url : http://codespeak.net/pipermail/lxml-dev/attachments/20070621/454fe322/attachment-0001.bin 


More information about the lxml-dev mailing list