How about "pure virtual methods"?
fredrik at pythonware.com
Sun Dec 19 17:13:30 CET 2004
>> what? Early warning, a few microseconds ahead of the invocation of a
>> method which will cause the stub in the base class to raise an
> Exactly. Microseconds don't count, but stack levels do -- getting the
> traceback end as close as possible to the real CAUSE of the problem,
> rather than a few levels further down where the SYMPTOM appears, can
> easily shave whole minutes off debugging time.
Traceback (most recent call last):
File "mymodule.py", line 9, in somefunction
... zero or more lines ...
File "somelibrary.py", line 3, in bar
raise NotImplementedError("must implement abstract method bar")
NotImplementedError: must implement abstract method bar
you have to look at the last line of a traceback to find the error message, and
the offending module/method is two lines above that.
> So, do _I_ use this? Nah: I think abstract classes with
> explicitly-abstract "somebody's gotta implement this!" methods are
> rarely a good idea
yet you claim to be an expert on issues related to debugging NotImplemented-
More information about the Python-list