doctest in Pythonwin

Tim Peters tim.one at comcast.net
Sat Aug 10 23:48:46 EDT 2002


[Terry Reedy]
> ...
> The added line nulling doctest.master cures the symptom but not the
> disease: the merge message no longer appears but doc strings are
> *still* not reread.  Reloading  the doctest module does not work, but
> reloading the module being tested does!

Right -- all of this stuff is a consequence of sys.modules staying alive
across script runs, and there are *many* ways you can get tripped up by
this.  It has nothing in particular to do with doctest.  It would often be
better if IDEs spawned a new process to run a script (meaning in particular
that would they get a fresh sys.modules, one that doesn't contain obsolete
versions of altered modules).

> So here is my doctest.__doc__ patch:
> ...

I'd rather that IDEs got smarter.  If we start documenting everything that
can go wrong due to old module objects hanging around in sys.modules, it
will never end.  This is something PythonWin (and IDLE) users have to learn
to live with for now.  I generally edit in IDLE and run doctests from a
cmdline shell (no surer way to force a new process than that!).





More information about the Python-list mailing list