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

Strange formatting difference when running python 3.6 versus 3.7 #624

Open
njsmith opened this issue Sep 28, 2018 · 1 comment
Open

Strange formatting difference when running python 3.6 versus 3.7 #624

njsmith opened this issue Sep 28, 2018 · 1 comment

Comments

@njsmith
Copy link
Contributor

njsmith commented Sep 28, 2018

Here's some code:

class Blah:
    async def __anext__(self):
        return { await self._signal_queue.__anext__()}

Notice the weird space before the await.

According to yapf 0.24.0 (and earlier), when running on python 3.6, this code is formatted correctly:

/tmp$ p36/bin/yapf --version  
yapf 0.24.0
/tmp$ p36/bin/python --version
Python 3.6.5
/tmp$ p36/bin/yapf -d asdf.py    

According to yapf 0.24.0 (and earlier), when running on python 3.7, this code is formatted incorrectly:

/tmp$ p37/bin/yapf --version
yapf 0.24.0
/tmp$ p37/bin/python --version
Python 3.7.0b3
/tmp$ p37/bin/yapf -d asdf.py 
--- asdf.py	(original)
+++ asdf.py	(reformatted)
@@ -1,3 +1,3 @@
 class Blah:
     async def __anext__(self):
-        return { await self._signal_queue.__anext__()}
+        return {await self._signal_queue.__anext__()}

This leads to frustration when some members of a team are using python 3.6, and some are using 3.7.

@kamahen
Copy link
Contributor

kamahen commented Sep 28, 2018 via email

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

No branches or pull requests

2 participants