Re: lxml.objectify interprets <x>1000_000</x> as int in Python>3.6 - should it?

Oh boy. Yes of course :-/, thanks for noting.
$ (for PYTHONPATH in "$LXML462" "$TRUNK"; do (export PYTHONPATH; python3 -c'from lxml import etree, objectify; print(etree.__version__); root = objectify.XML("<root><x>1000_000.123</x><y>1000_000</y><z>1000_000_</z></root>"); print(objectify.dump(root))'); echo; done;) 4.6.2 root = None [ObjectifiedElement] x = 1000000.123 [FloatElement] y = 1000000 [IntElement] z = '1000_000_' [StringElement] 4.6.3 root = None [ObjectifiedElement] x = '1000_000.123' [StringElement] y = '1000_000' [StringElement] z = '1000_000_' [StringElement] $ (for EXPR in root.x root.y root.z; do echo "=== $EXPR"; for PYTHONPATH in "$LXML462" "$TRUNK"; do (export PYTHONPATH; python3 -c'from lxml import etree; print(etree.__version__)'; python3 -m timeit -r 10 -n 1000000 --setup 'from lxml import etree, objectify; root = objectify.XML("<root><x>1000_000.123</x><y>1000_000</y><z>1000_000_</z></root>")' "$EXPR"); echo; done; done;) === root.x 4.6.2 1000000 loops, best of 10: 2.69 usec per loop 4.6.3 1000000 loops, best of 10: 2.53 usec per loop === root.y 4.6.2 1000000 loops, best of 10: 1.26 usec per loop 4.6.3 1000000 loops, best of 10: 2.57 usec per loop === root.z 4.6.2 1000000 loops, best of 10: 3.08 usec per loop 4.6.3 1000000 loops, best of 10: 2.54 usec per loop Holger Landesbank Baden-Wuerttemberg Anstalt des oeffentlichen Rechts Hauptsitze: Stuttgart, Karlsruhe, Mannheim, Mainz HRA 12704 Amtsgericht Stuttgart HRA 4356, HRA 104 440 Amtsgericht Mannheim HRA 40687 Amtsgericht Mainz Die LBBW verarbeitet gemaess Erfordernissen der DSGVO Ihre personenbezogenen Daten. Informationen finden Sie unter https://www.lbbw.de/datenschutz.
participants (1)
-
Holger.Joukl@LBBW.de