Is there a way to 'mask out' inherited methods?

Ralf Juengling juenglin at informatik.uni-freiburg.de
Sat May 4 09:09:40 EDT 2002


Alex Martelli <aleax at aleax.it> writes:

> so you can now do that (slowly:-) where earlier you could not,
> and you could try your hand at writing a custom metaclass for
> such masking purposes (not trivial), but by far the best approach
> remains as it always was to eschew inheritance when it does
> not meet your needs in favour of automatic (possibly selective)
> delegation/aggregation/containment.

What dou you mean with 'automatic' in your last sentence?

I don't like to write wrappers (trivial code, yes) to the 
aggregated object to expose a subset of its methods.
Is there a way to avoid writing wrappers?

Regards,
Ralf
 


  





More information about the Python-list mailing list