MCPcopy Create free account
hub / github.com/Distributive-Network/PythonMonkey / JSObjectItemsProxy_repr

Method JSObjectItemsProxy_repr

src/JSObjectItemsProxy.cc:91–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91PyObject *JSObjectItemsProxyMethodDefinitions::JSObjectItemsProxy_repr(JSObjectItemsProxy *self) {
92 PyObject *seq;
93 PyObject *result = NULL;
94
95 Py_ssize_t rc = Py_ReprEnter((PyObject *)self);
96 if (rc != 0) {
97 return rc > 0 ? PyUnicode_FromString("...") : NULL;
98 }
99
100 seq = PySequence_List((PyObject *)self);
101 if (seq == NULL) {
102 goto Done;
103 }
104
105 result = PyUnicode_FromFormat("%s(%R)", PyDictItems_Type.tp_name, seq);
106 Py_DECREF(seq);
107
108Done:
109 Py_ReprLeave((PyObject *)self);
110 return result;
111}
112
113PyObject *JSObjectItemsProxyMethodDefinitions::JSObjectItemsProxy_mapping(PyObject *self, void *Py_UNUSED(ignored)) {
114 return PyDictProxy_New((PyObject *)((_PyDictViewObject *)self)->dv_dict);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected