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

Introduction of whitespace after while and assignment operator #1976

Closed
OJFord opened this issue Feb 7, 2021 · 2 comments
Closed

Introduction of whitespace after while and assignment operator #1976

OJFord opened this issue Feb 7, 2021 · 2 comments
Labels
R: duplicate This issue or pull request already exists T: bug Something isn't working

Comments

@OJFord
Copy link

OJFord commented Feb 7, 2021

Describe the bug A clear and concise description of what the bug is.

black produces this diff:

-            while (foo := self._some_method(arg)):
+            while (foo := self._some_method(arg)) :

To Reproduce Steps to reproduce the behavior:

  1. Create a file repro.py:
while (foo := self._some_method(arg)):
    pass
  1. black repro.py ; cat repro.py
  2. Observe output:
reformatted repro.py
All done! ✨ 🍰 ✨
1 file reformatted.
while (foo := self._some_method(arg)) :
    pass

Expected behavior

All done! ✨ 🍰 ✨
1 file left unchanged.
while (foo := self._some_method(arg)):
    pass

Environment (please complete the following information):

  • Version: 20.8b1
  • OS and Python version: Darwin Kernel Version 20.2.0 & Python 3.9.1

Does this bug also happen on master?

No.

Additional context

@OJFord OJFord added the T: bug Something isn't working label Feb 7, 2021
@ichard26 ichard26 added the R: duplicate This issue or pull request already exists label Feb 7, 2021
@ichard26
Copy link
Collaborator

ichard26 commented Feb 7, 2021

This was fixed in commit 1d2d726 from PR #1655: ''Fix incorrect space before colon in if/while stmts". This issue is technically a duplicate of #1588 but I'll leave this open until a release ships with the fix mentioned above.

@ichard26
Copy link
Collaborator

And there has been quite a few releases since my comment above so definitely closing now. Thank you for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R: duplicate This issue or pull request already exists T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants