[C++-sig] Pyste bug: protected virtual methods

Niall Douglas s_sourceforge at nedprod.com
Tue Oct 28 02:34:52 CET 2003


On 27 Oct 2003 at 16:58, Nicodemus wrote:

> Another solution would be to expose the protected members, but that
> would make them public in Python. I think this solution is more
> flexible, since the purpose of a protected method is to allow
> subclasses to call it... and the user can always rename the methods to
> prepend an "_", following Python's convention. What do you think?

Well you can promote protected or private members to public when 
subclassing, so this looks like a good idea.

If you wanted to make it really pretty, you could make all protected 
members exposed using "_" as you suggest. They are after all not for 
public use.

Cheers,
Niall




-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 208 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20031028/ddb19936/attachment.pgp>


More information about the Cplusplus-sig mailing list