Skip to content

User keyword type conversion between int/float and bool not working correctly #5630

Open

Description

@themavik

Bug Description

Type conversion for user keyword arguments does not handle bool to int/float correctly. For example, Log As Int ${FALSE} yields False (bool) instead of 0 (int).

Expected Behavior

When a keyword parameter is typed as int, passing ${FALSE} should convert to 0, not keep the bool value.

Related to #5622.

Activity

  1. themavik commented on Mar 19, 2026

    @themavik
    Author

    Fix submitted in #5631.

  2. pekkaklarck commented on Mar 20, 2026

    @pekkaklarck
    Member

    I agree that it would make sense if integer conversion would convert Boolean values to actual integers. In Python isinstance(True, int) is true, but it is generally considered a mistake and it's less surprising for our users if keywords having arguments like arg: int actually get integers, not Boolean values.

    Could you clarify what kind of changes you are planning for float conversion? The title and description talks about int/float conversion, but your examples and also the PR ignore floats altogether.

    On a quick code changes in the PR look good, but test or tests are needed and documentation should possibly be updated.

    Finally, notice that this is not only about user keyword argument conversion. We use the same conversion logic everywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions