MCPcopy Index your code
hub / github.com/python/cpython / generate_ast_fini

Function generate_ast_fini

Parser/asdl_c.py:2254–2268  ·  view source on GitHub ↗
(module_state, f)

Source from the content-addressed store, hash-verified

2252
2253
2254def generate_ast_fini(module_state, f):
2255 f.write(textwrap.dedent("""
2256 void _PyAST_Fini(PyInterpreterState *interp)
2257 {
2258 struct ast_state *state = &interp->ast;
2259
2260 """))
2261 for s in module_state:
2262 f.write(" Py_CLEAR(state->" + s + ');\n')
2263 f.write(textwrap.dedent("""
2264 state->finalized = 1;
2265 state->once = (_PyOnceFlag){0};
2266 }
2267
2268 """))
2269
2270
2271def generate_module_def(mod, metadata, f, internal_h):

Callers 1

generate_module_defFunction · 0.85

Calls 2

writeMethod · 0.45
dedentMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…