ó {G_Tc@s dZddlZddlmZdefd„ƒYZddd„ƒYZdefd „ƒYZd ejfd „ƒYZ d „Z e d krœej ƒndS(s7Unit tests for __instancecheck__ and __subclasscheck__.iÿÿÿÿN(t test_supporttABCcBseZd„Zd„ZRS(cs/t‡fd†tt|ƒ|jgƒDƒƒS(s Implement isinstance(inst, cls).c3s|]}ˆj|ƒVqdS(N(t__subclasscheck__(t.0tc(tcls(s0/usr/local/lib/python2.7/test/test_typechecks.pys s(tanytsetttypet __class__(Rtinst((Rs0/usr/local/lib/python2.7/test/test_typechecks.pyt__instancecheck__ scsE|jjdtƒƒt|gƒB‰t‡fd†|jƒDƒƒS(sImplement issubclass(sub, cls).t __subclass__c3s|]}|ˆkVqdS(N((RR(t candidates(s0/usr/local/lib/python2.7/test/test_typechecks.pys s(t__dict__tgetRRtmro(Rtsub((R s0/usr/local/lib/python2.7/test/test_typechecks.pyRs%(t__name__t __module__R R(((s0/usr/local/lib/python2.7/test/test_typechecks.pyRs tIntegercBseZeZeegƒZRS((RRRt __metaclass__RtintR (((s0/usr/local/lib/python2.7/test/test_typechecks.pyRstSubIntcBseZRS((RR(((s0/usr/local/lib/python2.7/test/test_typechecks.pyRstTypeChecksTestcBsGeZd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(cCs6|jtjtƒtƒ|jtjtƒtƒdS(N(t assertEqualRRRtTruetfloattFalse(tself((s0/usr/local/lib/python2.7/test/test_typechecks.pyttestIsSubclassInternal"scCsn|jtttƒtƒ|jtttfƒtƒ|jtttƒtƒ|jtttfƒtƒdS(N(Rt issubclassRRRRR(R((s0/usr/local/lib/python2.7/test/test_typechecks.pyttestIsSubclassBuiltin&scCsn|jtdtƒtƒ|jtdtfƒtƒ|jtdtƒtƒ|jtdtfƒtƒdS(Ni*g…ëQ¸ @(Rt isinstanceRRR(R((s0/usr/local/lib/python2.7/test/test_typechecks.pyttestIsInstanceBuiltin,scCs?|jttƒtƒtƒ|jttƒtfƒtƒdS(N(RR!RR(R((s0/usr/local/lib/python2.7/test/test_typechecks.pyttestIsInstanceActual2scCs9|jtttƒtƒ|jtttfƒtƒdS(N(RRRR(R((s0/usr/local/lib/python2.7/test/test_typechecks.pyttestIsSubclassActual6scCsƒ|jtttƒtƒ|jtttfƒtƒ|jtttƒtƒ|jtttfƒtƒ|jtttƒtƒ|jtttfƒtƒ|jtttƒtƒ|jtttfƒtƒ|jttƒtƒtƒ|jttƒtfƒtƒ|jttƒtƒtƒ|jttƒtfƒtƒ|jtdtƒtƒ|jtdtfƒtƒdS(Ni*(RRRRRRRR!(R((s0/usr/local/lib/python2.7/test/test_typechecks.pyttestSubclassBehavior:scCs|ddd„ƒY}d|fd„ƒY}|jd|ƒ|j|ƒ|ƒ|jtt|ƒƒ|jt||ƒƒdS(NtXcBseZd„Zd„ZRS(cSstS(N(R(RR ((s0/usr/local/lib/python2.7/test/test_typechecks.pyR MscSstS(N(R(RR((s0/usr/local/lib/python2.7/test/test_typechecks.pyROs(RRR R(((s0/usr/local/lib/python2.7/test/test_typechecks.pyR&Ls tSubcBseZRS((RR(((s0/usr/local/lib/python2.7/test/test_typechecks.pyR'Qsi((tassertNotIsInstancetassertIsInstancet assertFalseRRt assertTrue(RR&R'((s0/usr/local/lib/python2.7/test/test_typechecks.pyt test_oldstyleJs ( RRRR R"R#R$R%R,(((s0/usr/local/lib/python2.7/test/test_typechecks.pyR s      cCstjtƒdS(N(Rt run_unittestR(((s0/usr/local/lib/python2.7/test/test_typechecks.pyt test_mainXst__main__(( t__doc__tunittestttestRRRRRtTestCaseRR.Rtmain(((s0/usr/local/lib/python2.7/test/test_typechecks.pyts  8