Removing objects of a superclass?

Adrian Eyre a.eyre at optichrome.com
Tue Feb 1 12:13:29 EST 2000


GH>> is it possible to _remove_ objects of a superclass?
GH>> ...I need to remove some methods like .append and .pop.

WW> If the purpose is to simply prevent the user from calling those
WW> methods, you could overload them with methods that raise exceptions.

I feel that if you need to do that, there is something wrong with your
inheritence model.

Have a new base class called UserObject which contains all the methods
shared by UserList and UserString, and subclass from that.

-----------------------------------------------------------------
Adrian Eyre <a.eyre at optichrome.com> - http://www.optichrome.com 





More information about the Python-list mailing list