MCPcopy Index your code
hub / github.com/python/mypy / convert_func_def

Function convert_func_def

mypy/exportjson.py:158–176  ·  view source on GitHub ↗
(self: FuncDef)

Source from the content-addressed store, hash-verified

156
157
158def convert_func_def(self: FuncDef) -> Json:
159 return {
160 ".class": "FuncDef",
161 "name": self._name,
162 "fullname": self._fullname,
163 "arg_names": self.arg_names,
164 "arg_kinds": [int(x.value) for x in self.arg_kinds],
165 "type": None if self.type is None else convert_type(self.type),
166 "flags": get_flags(self, FUNCDEF_FLAGS),
167 "abstract_status": self.abstract_status,
168 # TODO: Do we need expanded, original_def?
169 "dataclass_transform_spec": (
170 None
171 if self.dataclass_transform_spec is None
172 else convert_dataclass_transform_spec(self.dataclass_transform_spec)
173 ),
174 "deprecated": self.deprecated,
175 "original_first_arg": self.original_first_arg,
176 }
177
178
179def convert_dataclass_transform_spec(self: DataclassTransformSpec) -> Json:

Callers 3

convert_symbol_nodeFunction · 0.85
convert_overload_partFunction · 0.85
convert_decoratorFunction · 0.85

Calls 4

get_flagsFunction · 0.90
intClass · 0.85
convert_typeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…