
jholg@gmx.de wrote:
another small proposed change:
Index: src/lxml/objectify.pyx =================================================================== --- src/lxml/objectify.pyx (revision 44363) +++ src/lxml/objectify.pyx (working copy) @@ -759,7 +759,7 @@ return self.__nonzero__()
def __checkBool(s): - if s != 'true' and s != 'false': + if s != 'true' and s != 'false' and s != '1' and s != '0': raise ValueError
cdef object _strValueOf(obj):
Otherwise, annotate(<elt>, ignore_old=False) will revert a correctly pre-annotated boolean element with a text value of "0" and "1", which XML Schema datatypes allows, to py:pytype="int". It still does this for ignore_old=True which is the default.
Hmmm, not a great change, but it's acceptable as long as we register numeric types before the boolean type (which we currently do anyway). Applied for now. Stefan