This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients bup, terry.reedy
Date 2019-11-05.07:23:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1572938604.85.0.675598153566.issue38689@roundup.psfhosted.org>
In-reply-to
Content
Since isinstance(Object.__call__, types.MethodType) is False, the 'fob' in 'inspect.signature(fob)' is Object.  (See the initial get_argspec code.)  Indeed, 'inspect.signature(Object)' results in the traceback following inspect.signature(fob) and 'isinstance(Object, types.MethodType)' results in the last line thereof.  Not returning 'False' strikes me as maybe a bug in 'isinstance'.  Have you opened a report for this?  

Directly importing and executing  idlelib code is not supported (its is 'private'), but entering 'Object(' to cause IDLE to make the same call is.  And the result is worse than the exception.  The IDLE gui process hangs, waiting for the response from the socket connection to the user code process that never comes.  This is clearly a bug, regardless of whether the user code is buggy.

The relevant section of get_argspec is

    try:
        argspec = str(inspect.signature(fob))
    except ValueError as err:
        msg = str(err)
        if msg.startswith(_invalid_method):
            return _invalid_method

Signature() is documented as returning either ValueError or TypeError, and with the 'bug' in isinstance, others are possible.  So any error should be caught.  (The default of falling through and checking for a docstring signature is correct.)
History
Date User Action Args
2019-11-05 07:23:24terry.reedysetrecipients: + terry.reedy, bup
2019-11-05 07:23:24terry.reedysetmessageid: <1572938604.85.0.675598153566.issue38689@roundup.psfhosted.org>
2019-11-05 07:23:24terry.reedylinkissue38689 messages
2019-11-05 07:23:24terry.reedycreate