[Python-Dev] doctest improvements (original) (raw)

Tim Peters tim.one at comcast.net
Mon May 31 20:25:40 EDT 2004


[Edward Loper]

About a month and a half ago, I filed several patches for doctest, and they haven't gotten any comments; so I was wondering if anyone could look at them.

Jim Fulton and I intend to do some doctest work for 2.4, so feel free to assign them to me. I can't make time for it immediately, though.

The most interesting is #933238, which addresses the often-noted problem that doctest can't handle blank lines. It adds a special blank-line marker (currently "-"), which must be dedented with respect to the doctest block.

Fair warning that any gimmick weakening doctest's WYSIWYG guarantee is going to be a hard sell if I'm the reviewer. The business about blank lines is a documented limitation of the design. Limitations can indeed create problems, but removing them can create other problems. Making a doctest reader learn a special "doctest markup language" is A Problem in this case. Offhand, I'd be happier with an almost-self-evident (say)

<blank line>

marker than with a cryptic

_

"you have no hope of guessing what this means unless you scour the docs" marker. Dedenting is a clever idea, BTW.



More information about the Python-Dev mailing list