From 37e8e21df6da33eb9f1adc6318c7139ed6722530 Mon Sep 17 00:00:00 2001 From: calvin Date: Thu, 11 Aug 2005 15:49:34 +0000 Subject: [PATCH] add notimplemented git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@2801 e7d03fd6-7b0d-0410-9947-9c21f3af8025 --- linkcheck/decorators.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/linkcheck/decorators.py b/linkcheck/decorators.py index 34ab8c9b..7e63b2ae 100644 --- a/linkcheck/decorators.py +++ b/linkcheck/decorators.py @@ -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