-
Notifications
You must be signed in to change notification settings - Fork 92
fix \N{ (named unicode characters) in strings being turned into f-strings
#1504
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
Merged
DetachHead
merged 2 commits into
main
from
fix-auto-fstrings-on-named-unicode-characters
Sep 22, 2025
Merged
fix \N{ (named unicode characters) in strings being turned into f-strings
#1504
DetachHead
merged 2 commits into
main
from
fix-auto-fstrings-on-named-unicode-characters
Sep 22, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment has been minimized.
This comment has been minimized.
\N{ (named unicode characters) in strings being turned into f-strings
84042a5 to
040d234
Compare
|
Diff from mypy_primer, showing the effect of this PR on open source code: sympy (https://github.com/sympy/sympy)
- Type of "cg" is "Zero | ZeroArray | Unknown | Basic | ArrayContraction | PermuteDims | ArrayTensorProduct" (reportUnknownVariableType)
+ Type of "cg" is "PermuteDims | Basic | Unknown | Zero | ZeroArray | ArrayTensorProduct | ArrayContraction" (reportUnknownVariableType)
- Type of "cg" is "Unknown | PermuteDims | Zero | ZeroArray | Basic | ArrayDiagonal" (reportUnknownVariableType)
+ Type of "cg" is "Unknown | PermuteDims | ArrayDiagonal | Zero | ZeroArray" (reportUnknownVariableType)
- .../projects/sympy/sympy/printing/tests/test_str.py:994:16 - warning: Argument type is partially unknown
+ .../projects/sympy/sympy/printing/tests/test_str.py:994:16 - warning: Argument type is unknown
- Argument corresponds to parameter "object" in function "__new__"
+ Argument corresponds to parameter "object" in function "__new__" (reportUnknownArgumentType)
- Argument type is "Unknown" (reportUnknownArgumentType)
- Type of "cg" is "Zero | ZeroArray | Unknown | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims" (reportUnknownVariableType)
+ Type of "cg" is "PermuteDims | Basic | Unknown | Zero | ZeroArray | ArrayTensorProduct | ArrayContraction" (reportUnknownVariableType)
- Type of "cg" is "Zero | ZeroArray | Unknown | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims" (reportUnknownVariableType)
+ Type of "cg" is "Zero | ZeroArray | Unknown | Basic | PermuteDims" (reportUnknownVariableType)
- Type of "cg" is "Zero | ZeroArray | Unknown | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims" (reportUnknownVariableType)
+ Type of "cg" is "Zero | ZeroArray | Unknown | Basic | PermuteDims" (reportUnknownVariableType)
- Type of "cg" is "Unknown | Zero | ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims | ArrayAdd | ArrayDiagonal" (reportUnknownVariableType)
+ Type of "cg" is "Unknown | PermuteDims | ArrayDiagonal | Zero | ZeroArray" (reportUnknownVariableType)
- Type of "cg" is "Zero | ZeroArray | Unknown | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims" (reportUnknownVariableType)
+ Type of "cg" is "PermuteDims | Basic | Unknown | Zero | ZeroArray | ArrayTensorProduct | ArrayContraction" (reportUnknownVariableType)
- Type of "cg" is "Zero | ZeroArray | Unknown | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims" (reportUnknownVariableType)
+ Type of "cg" is "Zero | ZeroArray | Unknown | Basic | PermuteDims" (reportUnknownVariableType)
- Type of "cg" is "Zero | ZeroArray | Unknown | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims" (reportUnknownVariableType)
+ Type of "cg" is "Zero | ZeroArray | Unknown | Basic | PermuteDims" (reportUnknownVariableType)
- Type of "cg" is "Unknown | Zero | ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | PermuteDims | ArrayAdd | ArrayDiagonal" (reportUnknownVariableType)
+ Type of "cg" is "Unknown | PermuteDims | ArrayDiagonal | Zero | ZeroArray" (reportUnknownVariableType)
- Type of "approximants" is "(l: Unknown, X: Symbol = Symbol('x'), simplify: bool = False) -> Generator[Unknown | float, Any, None]" (reportUnknownVariableType)
+ Type of "approximants" is "(l: Unknown, X: Symbol = Symbol('x'), simplify: bool = False) -> Generator[Unknown | Expr | Any | ComplexInfinity | NaN | Rational | Zero | Infinity | NegativeInfinity | Float | float, Any, None]" (reportUnknownVariableType)
- Type of "lcm" is "(f: Unknown, g: Unknown | None = None, ...) -> (Expr | Unknown | One | Poly | Any | Rational | NaN | ComplexInfinity | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number)" (reportUnknownVariableType)
+ Type of "lcm" is "(f: Unknown, g: Unknown | None = None, ...) -> (Expr | Unknown | One | Poly | Rational | NaN | ComplexInfinity | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number | Any)" (reportUnknownVariableType)
- .../projects/sympy/sympy/series/approximants.py:14:5 - warning: Return type, "Generator[Unknown | float, Any, None]", is partially unknown (reportUnknownParameterType)
+ .../projects/sympy/sympy/series/approximants.py:14:5 - warning: Return type, "Generator[Unknown | Expr | Any | ComplexInfinity | NaN | Rational | Zero | Infinity | NegativeInfinity | Float | float, Any, None]", is partially unknown (reportUnknownParameterType)
- Type of "c" is "Expr | Unknown | One | Poly | Any | Rational | NaN | ComplexInfinity | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number" (reportUnknownVariableType)
+ Type of "c" is "Expr | Unknown | One | Poly | Rational | NaN | ComplexInfinity | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number | Any" (reportUnknownVariableType)
- Type of "c" is "Expr | Unknown | One | Poly | Any | Rational | NaN | ComplexInfinity | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number" (reportUnknownVariableType)
+ Type of "c" is "Expr | Unknown | One | Poly | Rational | NaN | ComplexInfinity | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number | Any" (reportUnknownVariableType)
+ .../projects/sympy/sympy/series/approximants.py:106:9 - warning: Type of "out" is partially unknown
+ Type of "out" is "Expr | Unknown | Any | ComplexInfinity | NaN | Rational | Zero | Infinity | NegativeInfinity | Float | float" (reportUnknownVariableType)
- Argument type is "Generator[Expr | Unknown | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | _NotImplementedType | Poly | Any, None, None]" (reportUnknownArgumentType)
+ Argument type is "Generator[Expr | Unknown | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Poly | Any, None, None]" (reportUnknownArgumentType)
- Argument type is "Generator[Expr | Unknown | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | _NotImplementedType | Poly | Any, None, None]" (reportUnknownArgumentType)
+ Argument type is "Generator[Expr | Unknown | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Poly | Any, None, None]" (reportUnknownArgumentType)
- .../projects/sympy/sympy/series/approximants.py:109:24 - error: Argument of type "float" cannot be assigned to parameter "expr" of type "Basic" in function "simplify"
+ .../projects/sympy/sympy/series/approximants.py:109:24 - error: Argument of type "Expr | Unknown | Any | ComplexInfinity | NaN | Rational | Zero | Infinity | NegativeInfinity | Float | float" cannot be assigned to parameter "expr" of type "Basic" in function "simplify"
+ Type "Expr | Unknown | Any | ComplexInfinity | NaN | Rational | Zero | Infinity | NegativeInfinity | Float | float" is not assignable to type "Basic"
- "float" is not assignable to "Basic" (reportArgumentType)
+ "float" is not assignable to "Basic" (reportArgumentType)
- Type of "apart" is "(f: Unknown, x: Unknown | None = None, full: bool = False, **options: Unknown) -> (Unknown | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Expr | Poly)" (reportUnknownVariableType)
+ Type of "apart" is "(f: Unknown, x: Unknown | None = None, full: bool = False, **options: Unknown) -> Unknown" (reportUnknownVariableType)
- .../projects/sympy/sympy/series/formal.py:116:13 - warning: Type of "terms" is partially unknown
+ .../projects/sympy/sympy/series/formal.py:116:13 - warning: Type of "terms" is unknown (reportUnknownVariableType)
- Type of "terms" is "Unknown | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Expr | Poly" (reportUnknownVariableType)
- .../projects/sympy/sympy/series/formal.py:117:16 - warning: Type of "has" is partially unknown
+ .../projects/sympy/sympy/series/formal.py:117:16 - warning: Type of "has" is unknown (reportUnknownMemberType)
- .../projects/sympy/sympy/series/formal.py:118:17 - warning: Type of "terms" is partially unknown
+ .../projects/sympy/sympy/series/formal.py:118:17 - warning: Type of "terms" is unknown (reportUnknownVariableType)
- Type of "terms" is "ComplexInfinity | Expr | Integer | NaN | NegativeOne | One | Poly | Rational | Zero | Unknown" (reportUnknownVariableType)
- .../projects/sympy/sympy/series/formal.py:118:25 - warning: Type of "doit" is partially unknown
+ .../projects/sympy/sympy/series/formal.py:118:25 - warning: Type of "doit" is unknown (reportUnknownMemberType)
+ .../projects/sympy/sympy/series/formal.py:120:36 - warning: Argument type is unknown
+ Argument corresponds to parameter "expr" in function "make_args" (reportUnknownArgumentType)
- Type of "doit" is "Unknown | ((**hints: Unknown) -> One) | ((**hints: Unknown) -> NegativeOne) | ((**hints: Unknown) -> Zero) | ((**hints: Unknown) -> Integer) | ((**hints: Unknown) -> NaN) | ((**hints: Unknown) -> ComplexInfinity) | ((**hints: Unknown) -> Rational) | ((**hints: Unknown) -> Expr) | ((**hints: Unknown) -> Poly)" (reportUnknownMemberType)
- .../projects/sympy/sympy/series/formal.py:120:36 - error: Argument of type "ComplexInfinity | Expr | Integer | NaN | NegativeOne | One | Poly | Rational | Zero | Unknown" cannot be assigned to parameter "expr" of type "Expr" in function "make_args"
- Type "ComplexInfinity | Expr | Integer | NaN | NegativeOne | One | Poly | Rational | Zero | Unknown" is not assignable to type "Expr"
- "Poly" is not assignable to "Expr" (reportArgumentType)
- Type of "lcm" is "(f: Unknown, g: Unknown | None = None, ...) -> (Expr | Unknown | One | Poly | Any | Rational | NaN | ComplexInfinity | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number)" (reportUnknownVariableType)
... (truncated 3621 lines) ...
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #1501
tests failing (i think) because the client in the tests does not send a
DidChangeTextDocumentnotification before sending theonTypeFormattingrequest. i have no idea if its guaranteed that clients will always send them in that order so i'm hesitant to update the tests to do that just because vscode does.