(typ: Type)
| 327 | |
| 328 | |
| 329 | def convert_type(typ: Type) -> Json: |
| 330 | if type(typ) is TypeAliasType: |
| 331 | return convert_type_alias_type(typ) |
| 332 | typ = get_proper_type(typ) |
| 333 | if isinstance(typ, Instance): |
| 334 | return convert_instance(typ) |
| 335 | elif isinstance(typ, AnyType): |
| 336 | return convert_any_type(typ) |
| 337 | elif isinstance(typ, NoneType): |
| 338 | return convert_none_type(typ) |
| 339 | elif isinstance(typ, UnionType): |
| 340 | return convert_union_type(typ) |
| 341 | elif isinstance(typ, TupleType): |
| 342 | return convert_tuple_type(typ) |
| 343 | elif isinstance(typ, CallableType): |
| 344 | return convert_callable_type(typ) |
| 345 | elif isinstance(typ, Overloaded): |
| 346 | return convert_overloaded(typ) |
| 347 | elif isinstance(typ, LiteralType): |
| 348 | return convert_literal_type(typ) |
| 349 | elif isinstance(typ, TypeVarType): |
| 350 | return convert_type_var_type(typ) |
| 351 | elif isinstance(typ, TypeType): |
| 352 | return convert_type_type(typ) |
| 353 | elif isinstance(typ, UninhabitedType): |
| 354 | return convert_uninhabited_type(typ) |
| 355 | elif isinstance(typ, UnpackType): |
| 356 | return convert_unpack_type(typ) |
| 357 | elif isinstance(typ, ParamSpecType): |
| 358 | return convert_param_spec_type(typ) |
| 359 | elif isinstance(typ, TypeVarTupleType): |
| 360 | return convert_type_var_tuple_type(typ) |
| 361 | elif isinstance(typ, Parameters): |
| 362 | return convert_parameters(typ) |
| 363 | elif isinstance(typ, TypedDictType): |
| 364 | return convert_typeddict_type(typ) |
| 365 | elif isinstance(typ, UnboundType): |
| 366 | return convert_unbound_type(typ) |
| 367 | return {"ERROR": f"{type(typ)!r} unrecognized"} |
| 368 | |
| 369 | |
| 370 | def convert_instance(self: Instance) -> Json: |
no test coverage detected
searching dependent graphs…