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 amaury.forgeotdarc
Recipients amaury.forgeotdarc, christian.heimes, facundobatista, jyasskin, theller
Date 2008-02-15.18:59:17
SpamBayes Score 0.018614769
Marked as misclassified No
Message-id <1203101958.74.0.428554361816.issue2115@psf.upfronthosting.co.za>
In-reply-to
Content
__instancecheck__ is not only slower, it can also cause crashes:

import abc
class MyABC:
    __metaclass__ = abc.ABCMeta
    __slots__ = ["a"]

class Unrelated:
    pass
MyABC.register(Unrelated)

u=Unrelated()
assert isinstance(u, MyABC)

MyABC.a.__set__(u, 3) # Boom


The patch I proposed above correctly raises the error:
TypeError: descriptor 'a' for 'MyABC' objects doesn't apply to
'Unrelated' object
History
Date User Action Args
2008-02-15 18:59:19amaury.forgeotdarcsetspambayes_score: 0.0186148 -> 0.018614769
recipients: + amaury.forgeotdarc, theller, facundobatista, christian.heimes, jyasskin
2008-02-15 18:59:18amaury.forgeotdarcsetspambayes_score: 0.0186148 -> 0.0186148
messageid: <1203101958.74.0.428554361816.issue2115@psf.upfronthosting.co.za>
2008-02-15 18:59:17amaury.forgeotdarclinkissue2115 messages
2008-02-15 18:59:17amaury.forgeotdarccreate