| 2567 | return NotImplemented |
| 2568 | |
| 2569 | def serialize(self) -> JsonDict: |
| 2570 | # TODO: As an optimization, leave out everything related to |
| 2571 | # generic functions for non-generic functions. |
| 2572 | return { |
| 2573 | ".class": "CallableType", |
| 2574 | "arg_types": [t.serialize() for t in self.arg_types], |
| 2575 | "arg_kinds": [int(x.value) for x in self.arg_kinds], |
| 2576 | "arg_names": self.arg_names, |
| 2577 | "ret_type": self.ret_type.serialize(), |
| 2578 | "fallback": self.fallback.serialize(), |
| 2579 | "name": self.name, |
| 2580 | # We don't serialize the definition (only used for error messages). |
| 2581 | "variables": [v.serialize() for v in self.variables], |
| 2582 | "is_ellipsis_args": self.is_ellipsis_args, |
| 2583 | "implicit": self.implicit, |
| 2584 | "is_bound": self.is_bound, |
| 2585 | "type_guard": self.type_guard.serialize() if self.type_guard is not None else None, |
| 2586 | "type_is": (self.type_is.serialize() if self.type_is is not None else None), |
| 2587 | "from_concatenate": self.from_concatenate, |
| 2588 | "imprecise_arg_kinds": self.imprecise_arg_kinds, |
| 2589 | "unpack_kwargs": self.unpack_kwargs, |
| 2590 | } |
| 2591 | |
| 2592 | @classmethod |
| 2593 | def deserialize(cls, data: JsonDict) -> CallableType: |