Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nullable properties: minor improvement
This commit adds a small refinement to revision 11a9b3c, which introduced a special ``is_getter`` flag causing the ``nb_func`` constructor to ignore function argument annotations when used to create the "getter" part of a property binding, e.g.: ``` nb::class_<T>(..) .def_rw("value", &T::value, nb::arg().none()) ``` A bit of context: Since ``.def_rw()`` internally creates a getter and a setter function and forwards all annotations to them, there used to be a mismatch in the function argument counts for the getter, causing a compile-time static assertion failure. This was fixed in 11a9b3c which simply disables this assertion. However, ``nb_func_new`` was still invoked with the ``func_flags::has_args`` flag active, causing it to choose the "complex" function dispatcher that is able to handle keyword arguments. This causes unnecessary overheads, hence this commit disables that flag.
- Loading branch information