mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
feat: py::prepend tag (#1131)
* feat: add a priority overload with py::prepend * doc: fix wording as suggested by rwgk * feat: add get_pointer * refactor: is_prepended -> prepend (internal) * docs: suggestion from @wjakob * tests: add test covering get_pointer/set_pointer
This commit is contained in:
@@ -284,6 +284,12 @@ TEST_SUBMODULE(methods_and_attributes, m) {
|
||||
py::class_<MetaclassOverride>(m, "MetaclassOverride", py::metaclass((PyObject *) &PyType_Type))
|
||||
.def_property_readonly_static("readonly", [](py::object) { return 1; });
|
||||
|
||||
// test_overload_ordering
|
||||
m.def("overload_order", [](std::string) { return 1; });
|
||||
m.def("overload_order", [](std::string) { return 2; });
|
||||
m.def("overload_order", [](int) { return 3; });
|
||||
m.def("overload_order", [](int) { return 4; }, py::prepend{});
|
||||
|
||||
#if !defined(PYPY_VERSION)
|
||||
// test_dynamic_attributes
|
||||
class DynamicClass {
|
||||
|
||||
Reference in New Issue
Block a user