Doctests and decorated methods don't get along

Steven D'Aprano steve at
Sun Feb 7 01:51:19 CET 2010

On Sat, 06 Feb 2010 14:39:00 -0500, Terry Reedy wrote:

> On 2/6/2010 6:48 AM, Steven D'Aprano wrote:
>> It seems that doctest doesn't discover or execute doctests in methods
>> which have been decorated [by method descriptors].


>> This looks like  bug to me. Have I missed anything?
> I would call it a limitation as I do not see the doc as promising
> otherwise. I believe doctest predates the descripter protocol, at least
> in its current form, so it may not be completely descriptor-aware. You
> certainly could file a feature request for improved recognition and
> subsequent calling of __get__. An initial patch would improve chances of
> action.

I have found an existing report for this issue:

The original poster's suggested fix was on the right track, but not 
complete. I've added a patch which works according to my tests.

Since this report is currently unassigned, is there a protocol for 
raising its profile and having somebody check my patch for inclusion? 
Should I just send an email to python-dev?


More information about the Python-list mailing list