[C++-sig] tutorial class_data_members compile problem

Joel de Guzman djowel at gmx.co.uk
Wed Oct 16 01:33:58 CEST 2002


----- Original Message ----- 
From: "David Abrahams" <dave at boost-consulting.com>

> * continuing the example and trying to make an instance of the Python
>   class Derived, I also get a:
> 
>   RuntimeError: This class cannot be instantiated from Python

Right. It needs an __init__() function to suppress the Base class'
__init__. 


Hmm, I wonder if we should change that? It could check the object's
__class__ before raising that exception. That wouldn't prevent people
from instantiating subclasses that don't implement the pure virtual
functions, but that would be caught later by an AttributeError when
they try to call the function. Opinions?

-----------------------------
I think it's ok as it is. It will do more but the end result is the same right?
I'll wait for your conclusion and correct the tutorial appropriately.
--Joel








More information about the Cplusplus-sig mailing list