ps2, IDLE, and doctest

P

Paul M

Pythoneers,

[I hope this is the appropriate forum to discuss this now that idlefork
has been folded back into the main python distn]

IDLE doesn't use the ps2 prompt ("..." in the command line interpreter)
because it supports multiline editing. This issue has been discussed
before, for example see Guido's explanation in this thread:

http://mail.python.org/pipermail/idle-dev/2002-February/000863.html

Unfortunately the lack of the ps2 prompt makes IDLE inappropriate for
writing multi-line routines that can be used in doctest readable docstrings:

As an example, doctest want's something like this:
.... if each >= 0.0:
.... ct += 1
....
Whereas IDLE gives this:
if each >= 0.0:
ct += 1


Doctest kept failing on text I cut-and-paosted from IDLE and it took me
a good 15 minutes to figure out what was going on.

Has anybody else run into this problem? The "solution" of course is to
revert to the command line when I'm including examples in docstrings,
but then you lose all the convenience of the IDLE environment....

--Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top