Skip to content

Range step type failure #17

@X9Z3

Description

@X9Z3

In previous versions the Python range function was able to evaluate range steps with both int and float types. In the current WASM I get the following error:

Error:PythonError: Traceback (most recent call last):
File "/lib/python312.zip/_pyodide/_base.py", line 597, in eval_code_async
await CodeRunner(
File "/lib/python312.zip/_pyodide/_base.py", line 411, in run_async
coroutine = eval(self.code, globals, locals)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 7, in
TypeError: 'float' object cannot be interpreted as an integer

when running the following code:

`Web VPython 3.2 WASM

a = 1
b = 10
step = 0.9

for x in range(a, b, step):
print(x)`

The code works in the new RapydScript 3.2 testing version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions