[issue23825] test_idle fails under -OO

Terry J. Reedy report at bugs.python.org
Fri Apr 3 23:30:17 CEST 2015


Terry J. Reedy added the comment:

The relevant code in CallTips.py itself

    if isinstance(ob_call, types.MethodType):
        doc = ob_call.__doc__
    else:
        doc = getattr(ob, "__doc__", "")
    if doc: <add more to calltip>

equally ignores both None and '', but I forgot the None possibility in the tests.  I cannot test the patch, but the fix looks right.  Putting the doc conditional expression before the for loops works because if one .__doc__ is set to None, all are.  For the same reason, doc could be defined as a global name, but if the patch makes test_idle pass, it is fine as it is.

----------
nosy: +terry.reedy
stage: patch review -> commit review

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23825>
_______________________________________


More information about the Python-bugs-list mailing list