Skip to content

Commit 8dff51d

Browse files
committed
Add 1-line comment for obj_class_name()
1 parent e3ebb0d commit 8dff51d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

include/pybind11/pytypes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ PYBIND11_NAMESPACE_BEGIN(detail)
366366
std::string error_string();
367367
std::string error_string(PyObject *&, PyObject *&, PyObject *&);
368368

369+
// Equivalent to obj.__class__.__name__ (or obj.__name__ if obj is a class).
369370
inline const char *obj_class_name(PyObject *obj) {
370371
if (Py_TYPE(obj) == &PyType_Type) {
371372
return reinterpret_cast<PyTypeObject *>(obj)->tp_name;

0 commit comments

Comments
 (0)