diff --git a/doc/tutorial/doc/class_virtual_functions.html b/doc/tutorial/doc/class_virtual_functions.html index 6116678a..96fa2b1d 100644 --- a/doc/tutorial/doc/class_virtual_functions.html +++ b/doc/tutorial/doc/class_virtual_functions.html @@ -104,10 +104,11 @@ Python. To do that, it needs Base's copy constructor... which isn't available, since Base is an abstract class.
In Python, let us try to instantiate our Base class:
-
+
+
>>> base = Base()
- AttributeError: ...
-
+ RuntimeError: This class cannot be instantiated from Python
+
Why is it an error? Base is an abstract class. As such it is advisable to define the Python wrapper with no_init as we have done above. Doing @@ -167,11 +168,12 @@ And instead is implemented to return 0, as shown above.
then, our Boost.Python wrapper:
-
- class_<Base, BaseWrap>("Base")
+
+ class_<Base, BaseWrap, boost::non_copyable>("Base")
.def("f", &BaseWrap::default_f)
;
-
+
+
Note that we are allowing Base objects to be instantiated this time, unlike before where we specifically defined the class_<Base> with