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
Integer infos #12
Integer infos #12
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks good! Just wanted to let you know I'll be making some slight changes to the grammar
ultimatepython/syntax/variable.py
Outdated
@@ -28,6 +28,18 @@ def main(): | |||
assert isinstance(c, object) and isinstance(c_type, object) | |||
assert isinstance(d, object) and isinstance(d_type, object) | |||
|
|||
# We can represent integer literals in Python using 4 bases: decimal, | |||
# hexadecimal, octal, and binary. | |||
# Decimal literals does not require any prefix, while other bases require |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decimal literals "do" not require...
ultimatepython/syntax/variable.py
Outdated
# We can represent integer literals in Python using 4 bases: decimal, | ||
# hexadecimal, octal, and binary. | ||
# Decimal literals does not require any prefix, while other bases require | ||
# prefixes: `0x` for hexadecimal, `0o` for octal, `0b` binary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"0b
for binary"
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Applied changes, sorry about that. English is not my first language. |
No problem 😄 Thanks for the quick changes! |
Turned out that I needed to make a slight change here: 9980fb9 because I'm using automated linting that enforces a certain format for the codebase. Hope you don't mind. I like the formatting style you did, but it broke the build process 😅 |
@miguelforsetti I understand that your first language isn't English. Are you interested in creating a |
Sure, that'll be fine.
Probably, let's see if I had the chance for that. |
* Add info on integer bases and integer literals. * Words are hard. * Bad grammar.
Please read the contributing guidelines before submitting a pull request.
Describe the change
Adding info on integer bases in Python, and using underscores as digit group separator.
Additional context
Because there's no info on literals (i.e. string literals, integer literals, float literals, etc), I'm adding it in syntax/variable.py. Hope that's okay.