diff --git a/src/nb_func.cpp b/src/nb_func.cpp index f04f0e41..1e7e99dd 100644 --- a/src/nb_func.cpp +++ b/src/nb_func.cpp @@ -1130,12 +1130,10 @@ static uint32_t nb_func_render_signature(const func_data *f, static PyObject *nb_func_get_name(PyObject *self) { func_data *f = nb_func_data(self); - if (f->flags & (uint32_t) func_flags::has_name) { - return PyUnicode_FromString(f->name); - } else { - Py_INCREF(Py_None); - return Py_None; - } + const char *name = ""; + if (f->flags & (uint32_t) func_flags::has_name) + name = f->name; + return PyUnicode_FromString(name); } static PyObject *nb_func_get_qualname(PyObject *self) { diff --git a/src/stubgen.py b/src/stubgen.py index 828b0b98..574bd138 100755 --- a/src/stubgen.py +++ b/src/stubgen.py @@ -89,7 +89,8 @@ class and repeatedly call ``.put()`` to register modules or contents within the "__doc__", "__module__", "__name__", "__new__", "__builtins__", "__cached__", "__path__", "__version__", "__spec__", "__loader__", "__package__", "__nb_signature__", "__class_getitem__", "__orig_bases__", - "__file__", "__dict__", "__weakref__", "__format__", "__nb_enum__" + "__file__", "__dict__", "__weakref__", "__format__", "__nb_enum__", + "__firstlineno__", "__static_attributes__" ] # fmt: on