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

Function prepare_func_def

mypyc/irbuild/prepare.py:210–233  ·  view source on GitHub ↗
(
    module_name: str,
    class_name: str | None,
    fdef: FuncDef,
    mapper: Mapper,
    options: CompilerOptions,
)

Source from the content-addressed store, hash-verified

208
209
210def prepare_func_def(
211 module_name: str,
212 class_name: str | None,
213 fdef: FuncDef,
214 mapper: Mapper,
215 options: CompilerOptions,
216) -> FuncDecl:
217 kind = (
218 FUNC_CLASSMETHOD
219 if fdef.is_class
220 else (FUNC_STATICMETHOD if fdef.is_static else FUNC_NORMAL)
221 )
222 sig = mapper.fdef_to_sig(fdef, options.strict_dunders_typing)
223 decl = FuncDecl(
224 fdef.name,
225 class_name,
226 module_name,
227 sig,
228 kind,
229 is_generator=fdef.is_generator,
230 is_coroutine=fdef.is_coroutine,
231 )
232 mapper.func_to_decl[fdef] = decl
233 return decl
234
235
236def create_generator_class_for_func(

Callers 2

build_type_mapFunction · 0.85
prepare_method_defFunction · 0.85

Calls 2

FuncDeclClass · 0.90
fdef_to_sigMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…