add notimplemented

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@2801 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2005-08-11 15:49:34 +00:00
parent 2377c8a8d0
commit 37e8e21df6

View file

@ -29,6 +29,11 @@ def g ():
"this function is deprecated"
pass
@notimplemented
def h ():
"todo"
pass
"""
import warnings
import signal
@ -102,3 +107,18 @@ def synchronized (lock):
return _synchronized(lock, function)
return newfunc
def notimplemented (func)
"""
Raises a NotImplementedError if the function is called.
def newfunc (*args, **kwargs):
"""
def newfunc (*args, **kwargs):
"""
Raise NotImplementedError
"""
raise NotImplementedError("%s not implemented" % func.__name__)
newfunc.__name__ = func.__name__
newfunc.__doc__ = func.__doc__
newfunc.__dict__.update(func.__dict__)
return newfunc