Author larry
Recipients larry, yselivanov
Date 2014-02-01.03:42:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1391226137.37.0.568949403046.issue20473@psf.upfronthosting.co.za>
In-reply-to
Content
Yury: In revision 9433b380ad33 you changed inspect.Signature so that it cannot handle builtin classes.  Please fix it.

   >>> import _pickle
   >>> import inspect
   >>> str(inspect.signature(_pickle.Pickler))
   '()'
   >>> _pickle.Pickler.__text_signature__
   '(file, protocol=None, fix_imports=True)'

Those two strings should be the same.

I don't know any guaranteed way to tell a builtin class from a
user class.  So if you pass in a class, the best approach is to
do what it used to do: try from_builtin, and if it fails fail over
to the isinstance(obj, type) code.  You changed it to

    if _signature_is_builtin(obj):
        return Signature.from_builtin(obj)

This unambiguously returns the result from from_builtin.  Either
find a way that you can determine a class is a builtin 100%
reliably, or change this to *try* from_builtin but only return its
result if it's successful.

Your changes might have also caused #20471; that wasn't failing before.  I'm still investigating.
History
Date User Action Args
2014-02-01 03:42:17larrysetrecipients: + larry, yselivanov
2014-02-01 03:42:17larrysetmessageid: <1391226137.37.0.568949403046.issue20473@psf.upfronthosting.co.za>
2014-02-01 03:42:17larrylinkissue20473 messages
2014-02-01 03:42:16larrycreate