kdlpy
kdlpy copied to clipboard
Shouldn't 1 be parsed as an int instead of becoming a float?
I've noticed that with nativeUntaggedValues: bool = True that's supposed to
produces native Python objects (str, int, float, bool, None) when parsing untagged values
I get 1 parsed as 3.0 <class 'float'>, and while float is a native object, how would I ever get an int from an untagged value if such simple numbers become floats?
Yeah, I'm currently just doing a parseFloat() for simplicity. I ran into this as well and got annoyed with it (another project I'm working on had to sprinkle int() casts around to make mypy happy). I should probably detect when the value is an int and return it as such.