Format a callable type as a pyannotate dict
(
self, cur_module: str | None, is_method: bool, typ: CallableType
)
| 742 | return json.dumps([obj], sort_keys=True) |
| 743 | |
| 744 | def pyannotate_signature( |
| 745 | self, cur_module: str | None, is_method: bool, typ: CallableType |
| 746 | ) -> PyAnnotateSignature: |
| 747 | """Format a callable type as a pyannotate dict""" |
| 748 | start = int(is_method) |
| 749 | return { |
| 750 | "arg_types": [self.format_type(cur_module, t) for t in typ.arg_types[start:]], |
| 751 | "return_type": self.format_type(cur_module, typ.ret_type), |
| 752 | } |
| 753 | |
| 754 | def format_signature(self, sig: PyAnnotateSignature) -> str: |
| 755 | """Format a callable type in a way suitable as an annotation... kind of""" |
no test coverage detected