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 gregory.p.smith
Recipients gregory.p.smith, gvanrossum, jyasskin, rhettinger, theller
Date 2008-07-13.18:38:06
SpamBayes Score 0.05148214
Marked as misclassified No
Message-id <1215974308.12.0.666355325633.issue2303@psf.upfronthosting.co.za>
In-reply-to
Content
% ./python.exe -mtimeit 'isinstance(3, int)'
1000000 loops, best of 3: 0.269 usec per loop
% ../release25-maint/python.exe -mtimeit 'isinstance(3, int)'1000000
loops, best of 3: 0.335 usec per loop

So I'd say its no longer 4x slower these days.

Looking at the Object/abstract.c it appears the fix to this has already
been checked in.  PyObject_IsInstance already has this in it:

        /* Quick test for an exact match */
        if (Py_TYPE(inst) == (PyTypeObject *)cls)
                return 1;

closing.
History
Date User Action Args
2008-07-13 18:38:28gregory.p.smithsetspambayes_score: 0.0514821 -> 0.05148214
recipients: + gregory.p.smith, gvanrossum, theller, rhettinger, jyasskin
2008-07-13 18:38:28gregory.p.smithsetspambayes_score: 0.0514821 -> 0.0514821
messageid: <1215974308.12.0.666355325633.issue2303@psf.upfronthosting.co.za>
2008-07-13 18:38:06gregory.p.smithlinkissue2303 messages
2008-07-13 18:38:06gregory.p.smithcreate