What is proper way to require a method to be overridden?
pavlovevidence at gmail.com
Sat Jan 6 02:45:11 CET 2007
> Carl Banks wrote:
> > jeremito wrote:
> > > I am writing a class that is intended to be subclassed. What is the
> > > proper way to indicate that a sub class must override a method?
> > You can't (easily).
> How about not defining it on the base class, but check in the
> constructor that the attribute exists and that it is of type
> FunctionType ?
That still delays the check until the object is created.
You'd have to use metaclass programming to check this during class
More information about the Python-list