Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

string infinity values get parsed as number instead of as string #77

Open
m-mohr opened this issue Dec 7, 2023 · 0 comments
Open

string infinity values get parsed as number instead of as string #77

m-mohr opened this issue Dec 7, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@m-mohr
Copy link
Member

m-mohr commented Dec 7, 2023

A process such as

{
        "process_graph": {
            "node": {
                "process_id": "is_infinite",
                "arguments": {
                    "x": "+inf"
                },
                "result": true,
            }
        }
    }

returns true because in Python you can actually parse these strings into floats (i.e. float('+inf') is infinity. This is not valid according to the spec. The parser should keep "+inf" and similar values as a string.

I'm also wondering whether string numerical values like '1.23' get converted into numbers although they should be strings...

I guess it may help to create a custom float class that doesn't allow passing in these string values: https://stackoverflow.com/questions/25022079/extend-python-build-in-class-float

@m-mohr m-mohr added the bug Something isn't working label Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant