|
17 | 17 | import json |
18 | 18 | from typing import Any, TypeAlias as _TypeAlias |
19 | 19 |
|
20 | | -from mypy.types import ( |
21 | | - Type, get_proper_type, Instance, AnyType, UnionType, TupleType, CallableType, |
22 | | - Overloaded, TypeVarType, TypeAliasType, LiteralType, NoneType, TypeType, |
23 | | - UninhabitedType, UnpackType, TypeVarTupleType, ParamSpecType, Parameters, |
24 | | - TypedDictType |
25 | | -) |
| 20 | +from librt.internal import Buffer |
| 21 | + |
26 | 22 | from mypy.nodes import ( |
27 | | - MypyFile, SymbolTable, SymbolTableNode, node_kinds, SymbolNode, FuncDef, TypeInfo, |
28 | | - TypeAlias, TypeVarExpr, Var, OverloadedFuncDef, get_flags, FUNCDEF_FLAGS, |
29 | | - DataclassTransformSpec, FUNCBASE_FLAGS, OverloadPart, Decorator, VAR_FLAGS, |
30 | | - ParamSpecExpr, TypeVarTupleExpr, ClassDef |
| 23 | + FUNCBASE_FLAGS, |
| 24 | + FUNCDEF_FLAGS, |
| 25 | + VAR_FLAGS, |
| 26 | + ClassDef, |
| 27 | + DataclassTransformSpec, |
| 28 | + Decorator, |
| 29 | + FuncDef, |
| 30 | + MypyFile, |
| 31 | + OverloadedFuncDef, |
| 32 | + OverloadPart, |
| 33 | + ParamSpecExpr, |
| 34 | + SymbolNode, |
| 35 | + SymbolTable, |
| 36 | + SymbolTableNode, |
| 37 | + TypeAlias, |
| 38 | + TypeInfo, |
| 39 | + TypeVarExpr, |
| 40 | + TypeVarTupleExpr, |
| 41 | + Var, |
| 42 | + get_flags, |
| 43 | + node_kinds, |
| 44 | +) |
| 45 | +from mypy.types import ( |
| 46 | + AnyType, |
| 47 | + CallableType, |
| 48 | + Instance, |
| 49 | + LiteralType, |
| 50 | + NoneType, |
| 51 | + Overloaded, |
| 52 | + Parameters, |
| 53 | + ParamSpecType, |
| 54 | + TupleType, |
| 55 | + Type, |
| 56 | + TypeAliasType, |
| 57 | + TypedDictType, |
| 58 | + TypeType, |
| 59 | + TypeVarTupleType, |
| 60 | + TypeVarType, |
| 61 | + UninhabitedType, |
| 62 | + UnionType, |
| 63 | + UnpackType, |
| 64 | + get_proper_type, |
31 | 65 | ) |
32 | | -from librt.internal import Buffer |
33 | 66 |
|
34 | 67 | JsonDict: _TypeAlias = dict[str, Any] |
35 | 68 |
|
@@ -357,11 +390,7 @@ def convert_tuple_type(self: TupleType) -> JsonDict: |
357 | 390 |
|
358 | 391 |
|
359 | 392 | def convert_literal_type(self: LiteralType) -> JsonDict: |
360 | | - return { |
361 | | - ".class": "LiteralType", |
362 | | - "value": self.value, |
363 | | - "fallback": convert_type(self.fallback), |
364 | | - } |
| 393 | + return {".class": "LiteralType", "value": self.value, "fallback": convert_type(self.fallback)} |
365 | 394 |
|
366 | 395 |
|
367 | 396 | def convert_type_var_type(self: TypeVarType) -> JsonDict: |
|
0 commit comments