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

Method func_begin

Parser/asdl_c.py:2041–2054  ·  view source on GitHub ↗
(self, name)

Source from the content-addressed store, hash-verified

2039class ObjVisitor(PickleVisitor):
2040
2041 def func_begin(self, name):
2042 ctype = get_c_type(name)
2043 self.emit("PyObject*", 0)
2044 self.emit("ast2obj_%s(struct ast_state *state, void* _o)" % (name), 0)
2045 self.emit("{", 0)
2046 self.emit("%s o = (%s)_o;" % (ctype, ctype), 1)
2047 self.emit("PyObject *result = NULL, *value = NULL;", 1)
2048 self.emit("PyTypeObject *tp;", 1)
2049 self.emit('if (!o) {', 1)
2050 self.emit("Py_RETURN_NONE;", 2)
2051 self.emit("}", 1)
2052 self.emit('if (Py_EnterRecursiveCall("during ast construction")) {', 1)
2053 self.emit("return NULL;", 2)
2054 self.emit("}", 1)
2055
2056 def func_end(self):
2057 self.emit("Py_LeaveRecursiveCall();", 1)

Callers 2

visitSumMethod · 0.95
visitProductMethod · 0.95

Calls 2

emitMethod · 0.95
get_c_typeFunction · 0.85

Tested by

no test coverage detected