Skip to content

py: int() default to decimal #221

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

Merged
merged 1 commit into from
Mar 20, 2023
Merged

py: int() default to decimal #221

merged 1 commit into from
Mar 20, 2023

Conversation

wetor
Copy link
Contributor

@wetor wetor commented Mar 18, 2023

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
Copy link

codecov bot commented Mar 18, 2023

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
Copy link
Collaborator

ncw commented Mar 20, 2023

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
Contributor Author

wetor commented Mar 20, 2023

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.

Copy link
Collaborator

@ncw ncw left a comment

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants