You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue with #14766 is that the change in formatting happens inside an r-string, not specifically the f-string debug. It should be fine to apply this formatting with the usual rules on string types, regardless of where the string is.
For completeness I have also previously opened the same issue in black, however it looks unlikely for black to have this fixed by the 2025 release, or anytime soon, as it would require resolving outstanding questions around how to handle f-string formatting.
Also cc @MichaReiser
The text was updated successfully, but these errors were encountered:
Thanks for reporting this and the nice write up. This is interesting. While this is a missed opportunity, I don't think it's important for us to fix it because debug expressions are rare (especially in production code), and escapes are rare, too. It's also somewhat complicated to fix because we currently don't apply any formatting for debug expressions. We just preserve them as is and I think that's a good enough default.
With preview disabled playground link:
With preview enabled playground link:
This change isn't observable, since the replacement of escapes happens before the debug applies:
The issue with #14766 is that the change in formatting happens inside an r-string, not specifically the f-string debug. It should be fine to apply this formatting with the usual rules on string types, regardless of where the string is.
For completeness I have also previously opened the same issue in black, however it looks unlikely for black to have this fixed by the 2025 release, or anytime soon, as it would require resolving outstanding questions around how to handle f-string formatting.
Also cc @MichaReiser
The text was updated successfully, but these errors were encountered: