Fix Ruff UP013 (convert-typed-dict-functional-to-class)

https://docs.astral.sh/ruff/rules/convert-typed-dict-functional-to-class/
This commit is contained in:
Andrej
2025-05-28 16:27:49 +05:00
parent 03f5ee653b
commit 7259dd625f
2 changed files with 28 additions and 10 deletions
+10 -2
View File
@@ -249,8 +249,16 @@ def flatten(iterable):
yield item
Call = TypedDict("Call", {"name": str, "args": tuple[Any, ...], "kwargs": dict[str, Any]})
Prediction = TypedDict("Prediction", {"type": Literal["SHOULD_BE_CALLED"], "number": Optional[int], "call": Call})
class Call(TypedDict):
name: str
args: tuple[Any, ...]
kwargs: dict[str, Any]
class Prediction(TypedDict):
type: Literal["SHOULD_BE_CALLED"]
number: Optional[int]
call: Call
class Prophecy: