[EMAIL PROTECTED] (Berthold =?iso-8859-15?Q?H=F6llmann?=) wrote: > Saving the following code to a file and running the code through > python does not give the expected error. disableling the "@decor" line > leads to the expected error message. Is this a bug or an overseen > feature? > It's a problem with your implementation of the decorator. In fact it is two problems: the decorated 'f' is a class instance so doctest ignores it, and it doesn't have a docstring so doctest ignores it.
If you rewrite the decorator so that the decorated 'f' is still a function and preserve the docstring then it works as you might expect. e.g. def decor(f): def wrapper(*args, **kw): return f(*args, **kw) wrapper.__doc__ = f.__doc__ wrapper.__name__ = f.__name__ return wrapper -- http://mail.python.org/mailman/listinfo/python-list