mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-19 22:39:09 +00:00
Add is_final to disallow inheritance from Python
- Not currently supported on PyPy
This commit is contained in:
committed by
Wenzel Jakob
parent
b14aeb7cfa
commit
0dfffcf257
@@ -367,6 +367,14 @@ TEST_SUBMODULE(class_, m) {
|
||||
.def(py::init<>())
|
||||
.def("ptr", &Aligned::ptr);
|
||||
#endif
|
||||
|
||||
// test_final
|
||||
struct IsFinal final {};
|
||||
py::class_<IsFinal>(m, "IsFinal", py::is_final());
|
||||
|
||||
// test_non_final_final
|
||||
struct IsNonFinalFinal {};
|
||||
py::class_<IsNonFinalFinal>(m, "IsNonFinalFinal", py::is_final());
|
||||
}
|
||||
|
||||
template <int N> class BreaksBase { public: virtual ~BreaksBase() = default; };
|
||||
|
||||
Reference in New Issue
Block a user