Skip to content

Conversation

@DetachHead
Copy link
Owner

fixes #1501

tests failing (i think) because the client in the tests does not send a DidChangeTextDocument notification before sending the onTypeFormatting request. 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.

@github-actions

This comment has been minimized.

@DetachHead DetachHead marked this pull request as ready for review September 22, 2025 12:08
@DetachHead DetachHead enabled auto-merge (rebase) September 22, 2025 12:09
@DetachHead DetachHead changed the title fix auto fstrings on named unicode characters fix \N{ (named unicode characters) in strings being turned into f-strings Sep 22, 2025
@DetachHead DetachHead force-pushed the fix-auto-fstrings-on-named-unicode-characters branch from 84042a5 to 040d234 Compare September 22, 2025 12:10
@DetachHead DetachHead merged commit 354d42e into main Sep 22, 2025
18 checks passed
@DetachHead DetachHead deleted the fix-auto-fstrings-on-named-unicode-characters branch September 22, 2025 12:34
@github-actions
Copy link
Contributor

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

\N{} sequence converts string to f-string

2 participants