-
Notifications
You must be signed in to change notification settings - Fork 22
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
Support Python 3.10 features, especially match, request #59
Comments
It’s our goal to stay current with Black as new Python features are supported. Thanks for pointing out the issue. Could you share a snippet of code that black currently formats but blue does not? |
Certainly. Here is a match statement that black will handle if "--target-version py310" is specified:
And the output is:
|
Hi Grant,
Certainly. Here is a match statement that black will handle
if”|--target-version py310|“ is specified:
|order = 1 match order: case 1: print("Matched number one") case 2:
print("Matched number two") case _: print("No match") And the output is: |
|Matched number one |
HTH,
Travis
P. S. I added this code to the issue already.
------------------------------------------------------------------------
Travis Risner
On 1/10/22 10:45 AM, Grant Jenks wrote:
It’s our goal to stay current with Black as newPython features are
supported. Thanks for pointing out theissue. Could you share a snippet
of code that black currentlyformats but blue does not?
—
Reply to this email directly, view it on GitHub
<#59 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE3HZPL7M74QXZIXPCN4OSDUVL5KFANCNFSM5LQLZ3JQ>.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.MessageID:
***@***.***>
|
Oh, this works with black |
Is there any update on this? Perhaps there's a workaround available? We are on Python 3.10 and would like to use the new |
Thanks! We are using #67 successfully and our diffs look good. Any idea when this new version might be released? (for now we install |
Thanks for the confirmation @chrisguillory - I'll do some quick checks myself and tag a new release. Automation should take it from there. |
LGTM |
Currently blue (version 0.7.0) supports most features of Python 3.10 via black (version 21.7.b0), but not the match statement. Black version 21.12b0 apparently does (see black issue #2662. However, running blue with that version of black produces this error:
Apparently, blue does not allow the option
--target-version py310
nor the equivalent to be set in the pyproject.toml file (tools.black ...).Version info for current version of blue:
Given that blue only patches black and that black does not consider version 21.12b0 to fully support match statements, is it premature to ask that blue can allow the interim version of black to be used with it?
The text was updated successfully, but these errors were encountered: