Skip to content

py: int() default to decimal - #221

Merged
ncw merged 1 commit into
go-python:mainfrom
wetor:fix_int
Mar 20, 2023
Merged

py: int() default to decimal#221
ncw merged 1 commit into
go-python:mainfrom
wetor:fix_int

Conversation

@wetor

Copy link
Copy Markdown
Contributor

https://docs.python.org/3.4/library/functions.html#int

int(x, base=10)

If base=0, an exception will be thrown when executing int("07")

@codecov

codecovBot commented Mar 18, 2023

Copy link
Copy Markdown

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (652daef) 74.42% compared to head (9ecc919) 74.42%.

Additional details and impacted files
@@ Coverage Diff @@## main #221 +/- ##
=======================================
Coverage 74.42% 74.42% =======================================
Files 76 76 Lines 12675 12675 =======================================
Hits 9433 9433 Misses 2567 2567 Partials 675 675 
Impacted FilesCoverage Δ
py/int.go77.81% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ncw

ncw commented Mar 20, 2023

Copy link
Copy Markdown
Collaborator

Does this change break this (which is correct)?

$ gpython
[snip]
>>> >>> 07
Compile error: File "<string>", line 1, offset 0
07
SyntaxError: 'illegal decimal with leading zero'
>>> 

@wetor

Copy link
Copy Markdown
ContributorAuthor

I tried it and it didn't affect here, because this PR fixes ValueError: "invalid literal for int() with base 10: '07'" at "sigils" error.

ncw
ncw approved these changes Mar 20, 2023

@ncwncw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me - thank you :-)

@ncw
ncw merged commit acd458b into go-python:mainMar 20, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@wetor@ncw