-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
PEP 701 support breaks stability policy #4324
Comments
Oh actually this one is a maybe a little different (with line length 100):
Reformatting collapses the f-strings onto one line, which seems undesirable |
cc @JelleZijlstra for awareness. If we need to break stability policy to get this out, it's worth it, but maybe it's not too hard to fix. |
cc @tusharsadhwani. What are you seeing exactly on your first example? I tried running current Black main (on Python 3.12.1) on a file with your code sample and didn't get any changes. |
I can reproduce the second one though:
|
For the first one, you need to not have
|
I'm thinking it has to do with code that was special cased for Code like this: Lines 263 to 268 in 551ede2
Interesting thing about second case is that the issue goes away if you remove the type ignore comment. |
I'm planning to hold off on making a release until this is either fixed or we've investigated enough to convince ourselves that it's very difficult to fix. I'll try to find some time to look into this myself too; @tusharsadhwani is probably right that it's about STRING special case that now also needs to look at f-string tokens. If so, the fix shouldn't be difficult. |
(in case useful for prioritising, I think the second one is much rarer, all the other hits in my work codebase look like the first case) |
@hauntsaninja EDIT: nevermind. I got it to reproduce. |
|
#3822 is amazing work. I've been sort of behind on all open source stuff, so I only just got to running it on my codebase at work. I found some reformatting, which violates the stability policy.
There were eleven instances of things that got changed
The text was updated successfully, but these errors were encountered: