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

@wetor wetor commented Mar 18, 2023

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

codecov Bot 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 Files Coverage Δ
py/int.go 77.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

wetor commented Mar 20, 2023

Copy link
Copy Markdown
Contributor Author

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 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:main Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants