Re: [C++-sig] Pyste bug: protected virtual methods
by Nicodemus other posts by this author
Oct 27 2003 11:00AM messages near this date
[C++-sig] Pyste bug: protected virtual methods
|
Re: [C++-sig] Pyste bug: protected virtual methods
Niall Douglas wrote:
> Ok, there's FXWindow which provides a virtual method GetClass() but
> it's protected so pyste doesn't wrap it in the definition for
> FXWindow.
>
> However, FXMainWindow inherits off FXWindow and in
> FXMainWindow_Wrapper there's an override for GetClass()! Needless to
> say, because python doesn't know of GetClass it can't call the
> default method :(
>
> Solution: Don't generate items in X_Wrapper unless they're public.
> This is overkill however, because technically protected methods
> should be available to python if a python class inherits off it.
>
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?
Regards,
Nicodemus.
_______________________________________________
C++-sig mailing list
C++-sig@[...].org
http://mail.python.org/mailman/listinfo/c++-sig
Thread:
Niall Douglas
Nicodemus
Niall Douglas
|