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

According to https://www.w3.org/TR/xmlschema-2/#integer 1000_000 is not a valid integer literal. But it is for Python since 3.6.
The magic lxml.objectify type lookup/annotation simple does int(s) and interprets success as "shall be interpreted as int". One could argue that - when parsing XML data - this is not the right/sane/intuitive choice. Or is it? :-) <x>1000_000</x> is not an integer in the XML world.
Then we shouldn't make it one. It's unlikely that data gets passed through XML in Python syntax. We have the same for "True" and "False", which come out as str, not bool. And this applies to FloatElement as well, which uses float() as parser and thus also supports "_" in Py3.6+.
I'll see what I can come up with.
https://github.com/lxml/lxml/commit/83e6c031994d553b74991501c6cd85e3517fadd 8
Stefan
Great! Will check. Thanks, 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