Skip to content

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

@m-mohr

Description

@m-mohr

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions