From 8dff51d12e4af11aff415ee966070368fe606664 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Fri, 13 May 2022 00:27:11 -0700 Subject: [PATCH] Add 1-line comment for obj_class_name() --- include/pybind11/pytypes.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/pybind11/pytypes.h b/include/pybind11/pytypes.h index 3bde261de..5ed5c0da2 100644 --- a/include/pybind11/pytypes.h +++ b/include/pybind11/pytypes.h @@ -366,6 +366,7 @@ PYBIND11_NAMESPACE_BEGIN(detail) std::string error_string(); std::string error_string(PyObject *&, PyObject *&, PyObject *&); +// Equivalent to obj.__class__.__name__ (or obj.__name__ if obj is a class). inline const char *obj_class_name(PyObject *obj) { if (Py_TYPE(obj) == &PyType_Type) { return reinterpret_cast(obj)->tp_name;