Skip to content

Commit

Permalink
Add 1-line comment for obj_class_name()
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf W. Grosse-Kunstleve committed May 13, 2022
1 parent e3ebb0d commit 8dff51d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/pybind11/pytypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<PyTypeObject *>(obj)->tp_name;
Expand Down

0 comments on commit 8dff51d

Please sign in to comment.