Balazs Ree wrote at 2008-4-11 09:19 +0200:
> ...
>>> In order to analyse a difficult problem, I added "from dm.pdb import
>>> zpdb; zpdb.set_trace()" in the doctest ("dm.pdb.zpdb" is my Zope aware
>>> PDB extension)
>> The standard PDB works fine.  I'm sure you're extended version can be
>> tweaked to as well.
>I have similar issues with ipdb. - similar in sense that I cannot use it 
>when running from doctests.

Any any other debugger, too, will have problems.

Usually, I am no fan of "explicit is better than implicit".
But, in this case, I think it would give a much better solution.

Apparently, the debugger integration works by wrapping
some class ("_OutputRedirectingPdb") around a given debugger
and then use this debugger instead of the wrapped on.

How about documenting this wrapping class.
Then any debugger author can use the class to wrap his
debugger and use it.

For this special case, we do not need monkey patching.

    import myWrappedDebugger; myWrappedDebugger.set_trace()

    (or for the standard debugger:
    "from zope.testing import pdb; pdb.set_trace()")

is only slightly more complex than

    import pdb; pdb.set_trace()

Zope-Dev maillist  -
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to