[lxml-dev] annotate, pyannotate, xsiannotate (was: lxml 2.0alpha1 released)

jholg at gmx.de jholg at gmx.de
Thu Sep 6 18:14:12 CEST 2007


Hi,

> I propose renaming the existing annotate() function to pyannotate() and
> adding a public interface annotate() to the internal _annotate(), so you can
> xsi-typify and py-typify in one step.
> I also think it would be better to change the defaults of the "ignore_old"
> keyword args of the annotation functions to False, to avoid:

Attached is patch that does just that, with tests.

I quirked the defaults for the new annotate() function that can now py:pytype and xsi:type-annotate in one step so that it behaves just like the former annotate() (at least it passes all the existing unittests which I did not alter)
The new pyannotate() and xsiannotate() use different defaults, as suggested.

There's an additional keyword arg keep_tree that lets you preserve existing TREE attribute values, if switched on.

Holger
-- 
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pyannotate_annotate.patch
Type: application/octet-stream
Size: 18093 bytes
Desc: not available
Url : http://codespeak.net/pipermail/lxml-dev/attachments/20070906/adac2214/attachment-0001.obj 


More information about the lxml-dev mailing list