[C++-sig] Re: pure virtual methods with pyste
by David Abrahams other posts by this author
Jul 28 2003 4:15PM messages near this date
[C++-sig] Re: pure virtual methods with pyste
|
[C++-sig] Qt class to embed python in a c++ application
Nicodemus <nicodemus@[...].br> writes:
>
> It works, i.e., we can use instances of derived classes in C++ and we
> can override a() in Python, but it is not safe, because you can
> instantiate Abstract, and calling its a method will make Python
> crash. Adding no_init prevents the class from being instantiated, even
> in a derived class, so that does not work. There's a way to support
> both usages at the same time?
Not without changes to Boost.Python. We need a "default
implementation" of a() which raises a Python exception or a version
of call_method<> which refuses to call the method if it's actually in
the same class... possibly also a smarter version of no_init would
help, though I am sure it is not enough.
--
Dave Abrahams
Boost Consulting
www.boost-consulting.com
_______________________________________________
C++-sig mailing list
C++-sig@[...].org
http://mail.python.org/mailman/listinfo/c++-sig
Thread:
David Abrahams
David Abrahams
David Abrahams
Nicodemus
David Abrahams
Nicodemus
Nicodemus
David Abrahams
Nicodemus
David Abrahams
Nicodemus
Nicodemus
David Abrahams
David Abrahams
Nicodemus
David Abrahams
Nicodemus
David Abrahams
Nicodemus
David Abrahams
Nicodemus
Daniel Wallin
David Abrahams
Daniel Wallin
Nicodemus
David Abrahams
David Abrahams
David Abrahams
|