ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> C++-sig
C++-sig
[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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved