[lxml-dev] lxml 2.0alpha1 released

jholg at gmx.de jholg at gmx.de
Tue Sep 4 12:00:01 CEST 2007


Hi,

>     * Extended type annotation in objectify: new xsiannotate() function

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:


>>> root = E.root(E.i(23), E.s("12"), E.sub())
>>> print objectify.dump(root)
root = None [ObjectifiedElement]
    i = 23 [IntElement]
      * py:pytype = 'int'
    s = '12' [StringElement]
      * py:pytype = 'str'
    sub = '' [StringElement]
>>> objectify.annotate(root)
>>> print objectify.dump(root)
root = None [ObjectifiedElement]
    i = 23 [IntElement]
      * py:pytype = 'int'
    s = 12 [IntElement]
      * py:pytype = 'int'
    sub = '' [StringElement]
>>> 

where you lose the "str" type information of root.s.
I think the current default is a bit counter-intuitive.

What do you say?

Holger
-- 
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser


More information about the lxml-dev mailing list