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

Method visitConstructor

Parser/asdl_c.py:2111–2118  ·  view source on GitHub ↗
(self, cons, enum, name)

Source from the content-addressed store, hash-verified

2109 self.func_end()
2110
2111 def visitConstructor(self, cons, enum, name):
2112 self.emit("case %s_kind:" % cons.name, 1)
2113 self.emit("tp = (PyTypeObject *)state->%s_type;" % cons.name, 2)
2114 self.emit("result = PyType_GenericNew(tp, NULL, NULL);", 2);
2115 self.emit("if (!result) goto failed;", 2)
2116 for f in cons.fields:
2117 self.visitField(f, cons.name, 2, False)
2118 self.emit("break;", 2)
2119
2120 def visitField(self, field, name, depth, product):
2121 def emit(s, d):

Callers 1

visitSumMethod · 0.95

Calls 2

emitMethod · 0.95
visitFieldMethod · 0.95

Tested by

no test coverage detected