MCPcopy Create free account
hub / github.com/SamuraiT/mecab-python3 / SwigPyObject_repr

Function SwigPyObject_repr

src/MeCab/MeCab_wrap.cpp:1440–1457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1438}
1439
1440SWIGRUNTIME PyObject *
1441SwigPyObject_repr(SwigPyObject *v)
1442{
1443 const char *name = SWIG_TypePrettyName(v->ty);
1444 PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", (name ? name : "unknown"), (void *)v);
1445 if (v->next) {
1446 PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
1447# if PY_VERSION_HEX >= 0x03000000
1448 PyObject *joined = PyUnicode_Concat(repr, nrep);
1449 Py_DecRef(repr);
1450 Py_DecRef(nrep);
1451 repr = joined;
1452# else
1453 PyString_ConcatAndDel(&repr,nrep);
1454# endif
1455 }
1456 return repr;
1457}
1458
1459/* We need a version taking two PyObject* parameters so it's a valid
1460 * PyCFunction to use in swigobject_methods[]. */

Callers 1

SwigPyObject_repr2Function · 0.85

Calls 1

SWIG_TypePrettyNameFunction · 0.85

Tested by

no test coverage detected