Skip to content
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

Use parentheses for method access on integer literals #2034

Closed
ichard26 opened this issue Mar 11, 2021 · 0 comments · Fixed by #2799
Closed

Use parentheses for method access on integer literals #2034

ichard26 opened this issue Mar 11, 2021 · 0 comments · Fixed by #2799
Labels
F: parentheses Too many parentheses, not enough parentheses, and so on. S: accepted The changes in this design / enhancement issue have been accepted and can be implemented T: style What do we want Blackened code to look like?

Comments

@ichard26
Copy link
Collaborator

ichard26 commented Mar 11, 2021

Describe the style change

When code tries to access a method on integer literals, the "space before dot" way should be reformatted to the "surround the integer literal with parentheses" way.

Examples in the current Black style

count = 5 .bit_count()

Desired style

count = (5).bit_count()

Additional context

This is Twitter Driven Development btw 😆

designrequestviatwitter

@ichard26 ichard26 added T: style What do we want Blackened code to look like? F: parentheses Too many parentheses, not enough parentheses, and so on. labels Mar 11, 2021
@ichard26 ichard26 added the S: accepted The changes in this design / enhancement issue have been accepted and can be implemented label Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: parentheses Too many parentheses, not enough parentheses, and so on. S: accepted The changes in this design / enhancement issue have been accepted and can be implemented T: style What do we want Blackened code to look like?
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant