Skip to content

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

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

Closed
hqsz opened this issue Sep 23, 2019 · 0 comments · Fixed by #1406
Closed

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

hqsz opened this issue Sep 23, 2019 · 0 comments · Fixed by #1406
Labels
C-compat A discrepancy between RustPython and CPython

Comments

@hqsz
Copy link
Contributor

hqsz commented Sep 23, 2019

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
@hqsz hqsz added the C-compat A discrepancy between RustPython and CPython label Sep 23, 2019
hqsz added a commit to hqsz/RustPython that referenced this issue Sep 23, 2019
hqsz added a commit to hqsz/RustPython that referenced this issue Sep 23, 2019
hqsz added a commit to hqsz/RustPython that referenced this issue Sep 24, 2019
hqsz added a commit to hqsz/RustPython that referenced this issue Sep 24, 2019
Change base type from u32 to PyIntRef

Fixed: RustPython#1405
hqsz added a commit to hqsz/RustPython that referenced this issue Sep 24, 2019
Change base type from u32 to PyIntRef

Fixed: RustPython#1405
hqsz added a commit to hqsz/RustPython that referenced this issue Sep 24, 2019
Change base type from u32 to PyIntRef

Fixed: RustPython#1405
hqsz added a commit to hqsz/RustPython that referenced this issue Sep 24, 2019
Change base type from u32 to PyIntRef

Fixed: RustPython#1405
hqsz added a commit to hqsz/RustPython that referenced this issue Sep 26, 2019
Change base type from u32 to PyIntRef

Fixed: RustPython#1405
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-compat A discrepancy between RustPython and CPython
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant