Skip to content

int type casting with negative base value do not raise valueError #1405

Closed
@hqsz

Description

@hqsz

Feature

print(int('1', base=-1))

if base is negative value, it should be valueError

Actual result

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: Int value cannot fit into Rust u32

Expected result

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: int() base must be >= 2 and <= 36, or 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-compatA discrepancy between RustPython and CPython

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions