ó {G_Tc@s—ddlZddlZddlZddlZddlZddlmZejddeƒddl m Z m Z e ƒZ dej fd„ƒYZdefd „ƒYZd efd „ƒYZd efd „ƒYZdefd„ƒYZd„Zd„Zdej fd„ƒYZdej fd„ƒYZdej fd„ƒYZdej fd„ƒYZdej fd„ƒYZdej fd„ƒYZdefd„ƒYZd efd!„ƒYZd"efd#„ƒYZd$efd%„ƒYZd&efd'„ƒYZd(ej fd)„ƒYZ d*e fd+„ƒYZ!d,e fd-„ƒYZ"d.e fd/„ƒYZ#d0e fd1„ƒYZ$d2e fd3„ƒYZ%d4e fd5„ƒYZ&d6e fd7„ƒYZ'd8ej fd9„ƒYZ(d:e(fd;„ƒYZ)d<e(fd=„ƒYZ*d>e(fd?„ƒYZ+d@e(fdA„ƒYZ,dBe(fdC„ƒYZ-dDej fdE„ƒYZ.dFZ/ie/dG6Z0ddH„Z2e3dIkr“e2dJeƒndS(KiÿÿÿÿN(t test_supporttsetst deprecated(tSett ImmutableSett TestBasicOpscBsªeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„Zd„Zd„Zd„ZRS(cCs2|jdk r.|jt|jƒ|jƒndS(N(treprtNonet assertEqualtset(tself((s*/usr/local/lib/python2.7/test/test_sets.pyt test_repr scCs |jt|jƒ|jƒdS(N(RtlenR tlength(R ((s*/usr/local/lib/python2.7/test/test_sets.pyt test_lengthscCs|j|j|jƒdS(N(RR (R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_self_equalityscCs|j|j|jƒdS(N(RR tdup(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_equivalent_equalityscCs |j|jjƒ|jƒdS(N(RR tcopyR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyt test_copyscCs'|j|jB}|j||jƒdS(N(R RR(R tresult((s*/usr/local/lib/python2.7/test/test_sets.pyttest_self_unionscCs$|jtB}|j||jƒdS(N(R t empty_setRR(R R((s*/usr/local/lib/python2.7/test/test_sets.pyttest_empty_union!s cCs$t|jB}|j||jƒdS(N(RR RR(R R((s*/usr/local/lib/python2.7/test/test_sets.pyttest_union_empty%s cCs'|j|j@}|j||jƒdS(N(R RR(R R((s*/usr/local/lib/python2.7/test/test_sets.pyttest_self_intersection)scCs!|jt@}|j|tƒdS(N(R RR(R R((s*/usr/local/lib/python2.7/test/test_sets.pyttest_empty_intersection-s cCs!t|j@}|j|tƒdS(N(RR R(R R((s*/usr/local/lib/python2.7/test/test_sets.pyttest_intersection_empty1s cCs$|j|jA}|j|tƒdS(N(R RR(R R((s*/usr/local/lib/python2.7/test/test_sets.pyttest_self_symmetric_difference5scCs$|jtA}|j||jƒdS(N(R RR(R R((s*/usr/local/lib/python2.7/test/test_sets.pytcheckempty_symmetric_difference9s cCs$|j|j}|j|tƒdS(N(R RR(R R((s*/usr/local/lib/python2.7/test/test_sets.pyttest_self_difference=scCs$|jt}|j||jƒdS(N(R RRR(R R((s*/usr/local/lib/python2.7/test/test_sets.pyttest_empty_differenceAs cCs!t|j}|j|tƒdS(N(RR R(R R((s*/usr/local/lib/python2.7/test/test_sets.pyttest_empty_difference_revEs cCs+x$|jD]}|j||jƒq WdS(N(R tassertIntvalues(R tv((s*/usr/local/lib/python2.7/test/test_sets.pyttest_iterationIscCsHtj|jƒ}tj|ƒ}|j|j|d|j|fƒdS(Ns%s != %s(tpickletdumpsR tloadsR(R tpR((s*/usr/local/lib/python2.7/test/test_sets.pyt test_picklingMs(t__name__t __module__R RRRRRRRRRRRRRRR R$R)(((s*/usr/local/lib/python2.7/test/test_sets.pyR s$                 tTestBasicOpsEmptycBseZd„ZRS(cCsLd|_g|_t|jƒ|_t|jƒ|_d|_d|_dS(Ns empty setisSet([])(tcaseR"RR RR R(R ((s*/usr/local/lib/python2.7/test/test_sets.pytsetUpVs    (R*R+R.(((s*/usr/local/lib/python2.7/test/test_sets.pyR,UstTestBasicOpsSingletoncBs#eZd„Zd„Zd„ZRS(cCsOd|_dg|_t|jƒ|_t|jƒ|_d|_d|_dS(Nsunit set (number)iisSet([3])(R-R"RR RR R(R ((s*/usr/local/lib/python2.7/test/test_sets.pyR.as    cCs|jd|jkƒdS(Ni(t assertTrueR (R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_iniscCs|jd|jkƒdS(Ni(R0R (R ((s*/usr/local/lib/python2.7/test/test_sets.pyt test_not_inls(R*R+R.R1R2(((s*/usr/local/lib/python2.7/test/test_sets.pyR/`s  tTestBasicOpsTuplecBs#eZd„Zd„Zd„ZRS(cCsOd|_dg|_t|jƒ|_t|jƒ|_d|_d|_dS(Nsunit set (tuple)itzeroisSet([(0, 'zero')])(iszero(R-R"RR RR R(R ((s*/usr/local/lib/python2.7/test/test_sets.pyR.rs    cCs|jd|jkƒdS(NiR4(iszero(R0R (R ((s*/usr/local/lib/python2.7/test/test_sets.pyR1zscCs|jd|jkƒdS(Ni (R0R (R ((s*/usr/local/lib/python2.7/test/test_sets.pyR2}s(R*R+R.R1R2(((s*/usr/local/lib/python2.7/test/test_sets.pyR3qs  tTestBasicOpsTriplecBseZd„ZRS(cCsXd|_ddtjg|_t|jƒ|_t|jƒ|_d|_d|_ dS(Ns triple setiR4i( R-toperatortaddR"RR RR RR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyR.ƒs   (R*R+R.(((s*/usr/local/lib/python2.7/test/test_sets.pyR5‚sccst‚tVdS(N(t TypeErrortTrue(((s*/usr/local/lib/python2.7/test/test_sets.pytbaditersccs tVdS(N(R9(((s*/usr/local/lib/python2.7/test/test_sets.pytgooditer‘stTestExceptionPropagationcBs eZdZd„Zd„ZRS(s?SF 628246: Set constructor should not trap iterator TypeErrorscCs|jtttƒƒdS(N(t assertRaisesR8RR:(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_instanceWithException—scCsgtdddgƒtdƒtidd6dd6dd6ƒttdƒƒtdƒttƒƒdS( Niiitonettwotthreetabc(iii(RtxrangeR;(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_instancesWithoutExceptionšs   (R*R+t__doc__R>RD(((s*/usr/local/lib/python2.7/test/test_sets.pyR<”s t TestSetOfSetscBseZd„ZRS(cCs~tdgƒ}t|gƒ}|jƒ}|jt|ƒtƒ|j|ƒ|j|ƒ|j|tƒƒ|j|ƒdS(Ni(RtpopRttypeRR7tremovetdiscard(R tinnertoutertelement((s*/usr/local/lib/python2.7/test/test_sets.pyttest_constructor¦s   (R*R+RN(((s*/usr/local/lib/python2.7/test/test_sets.pyRF¥st TestBinaryOpscBs˜eZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„Zd„ZRS(cCstdƒ|_dS(Niii(iii(RR (R ((s*/usr/local/lib/python2.7/test/test_sets.pyR.³scCs2|j|jtidd6dd6dd6ƒƒdS(Niiiiii(RR R(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_eq¶scCs0|jtdgƒB}|j|tdƒƒdS(Niii(iii(R RR(R R((s*/usr/local/lib/python2.7/test/test_sets.pyttest_union_subset¹scCsE|jtddddgƒB}|j|tddddgƒƒdS(Niiii(R RR(R R((s*/usr/local/lib/python2.7/test/test_sets.pyttest_union_superset½scCsE|jtdddgƒB}|j|tdddddgƒƒdS(Niiiii(R RR(R R((s*/usr/local/lib/python2.7/test/test_sets.pyttest_union_overlapÁscCs<|jtdgƒB}|j|tddddgƒƒdS(Niiii(R RR(R R((s*/usr/local/lib/python2.7/test/test_sets.pyttest_union_non_overlapÅscCs-|jtdƒ@}|j|tdƒƒdS(Nii(ii(ii(R RR(R R((s*/usr/local/lib/python2.7/test/test_sets.pyttest_intersection_subsetÉscCsB|jtddddgƒ@}|j|tdddgƒƒdS(Niiii(R RR(R R((s*/usr/local/lib/python2.7/test/test_sets.pyttest_intersection_supersetÍscCs9|jtdddgƒ@}|j|tdgƒƒdS(Niii(R RR(R R((s*/usr/local/lib/python2.7/test/test_sets.pyttest_intersection_overlapÑscCs*|jtdgƒ@}|j|tƒdS(Ni(R RRR(R R((s*/usr/local/lib/python2.7/test/test_sets.pyttest_intersection_non_overlapÕscCs0|jtdƒA}|j|tdgƒƒdS(Niii(ii(R RR(R R((s*/usr/local/lib/python2.7/test/test_sets.pyttest_sym_difference_subsetÙscCs0|jtdƒA}|j|tdgƒƒdS(Niiii(iiii(R RR(R R((s*/usr/local/lib/python2.7/test/test_sets.pyttest_sym_difference_supersetÝscCs9|jtdƒA}|j|tddddgƒƒdS(Niiiii(iii(R RR(R R((s*/usr/local/lib/python2.7/test/test_sets.pyttest_sym_difference_overlapáscCs<|jtdgƒA}|j|tddddgƒƒdS(Niiii(R RR(R R((s*/usr/local/lib/python2.7/test/test_sets.pyttest_sym_difference_non_overlapåscCsxtdƒtdƒ}}|jtt||ƒ|jt||ƒdƒ|jtt|dƒ|jttd|ƒdS(Ntatbii RB(RR=R8tcmpR(R R]R^((s*/usr/local/lib/python2.7/test/test_sets.pyttest_cmpés cCsœ|jjƒ}||O}|j||jƒ||M}|j||jƒ||8}|jt|ƒdƒ|jjƒ}||N}|jt|ƒdƒdS(Ni(R RRR (R tt((s*/usr/local/lib/python2.7/test/test_sets.pyttest_inplace_on_selfös    (R*R+R.RPRQRRRSRTRURVRWRXRYRZR[R\R`Rb(((s*/usr/local/lib/python2.7/test/test_sets.pyRO²s                t TestUpdateOpscBsÅeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(cCstdƒ|_dS(Niii(iii(RR (R ((s*/usr/local/lib/python2.7/test/test_sets.pyR.scCs5|jtdgƒO_|j|jtdƒƒdS(Niii(iii(R RR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyRQ scCsJ|jtddddgƒO_|j|jtddddgƒƒdS(Niiii(R RR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyRR s!cCsJ|jtdddgƒO_|j|jtdddddgƒƒdS(Niiiii(R RR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyRSscCsA|jtdgƒO_|j|jtddddgƒƒdS(Niiii(R RR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyRTscCsK|jjtdddgƒƒ|j|jtdddddgƒƒdS(Niiiii(R t union_updateRR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_union_method_callscCs2|jtdƒM_|j|jtdƒƒdS(Nii(ii(ii(R RR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyRUscCsG|jtddddgƒM_|j|jtdddgƒƒdS(Niiii(R RR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyRV!s!cCs>|jtdddgƒM_|j|jtdgƒƒdS(Niii(R RR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyRW%scCs/|jtdgƒM_|j|jtƒdS(Ni(R RRR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyRX)scCs?|jjtdddgƒƒ|j|jtdgƒƒdS(Niii(R tintersection_updateRR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_intersection_method_call-scCs5|jtdƒN_|j|jtdgƒƒdS(Niii(ii(R RR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyRY1scCs5|jtdƒN_|j|jtdgƒƒdS(Niiii(iiii(R RR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyRZ5scCs>|jtdƒN_|j|jtddddgƒƒdS(Niiiii(iii(R RR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyR[9scCsA|jtdgƒN_|j|jtddddgƒƒdS(Niiii(R RR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyR\=scCsH|jjtdddgƒƒ|j|jtddddgƒƒdS(Niiiii(R tsymmetric_difference_updateRR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_sym_difference_method_callAscCs5|jtdƒ8_|j|jtdgƒƒdS(Niii(ii(R RR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_difference_subsetEscCs2|jtdƒ8_|j|jtgƒƒdS(Niiii(iiii(R RR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_difference_supersetIscCs8|jtdƒ8_|j|jtddgƒƒdS(Niiiii(iii(R RR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_difference_overlapMscCs>|jtdgƒ8_|j|jtdddgƒƒdS(Niiii(R RR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_difference_non_overlapQscCsB|jjtdddgƒƒ|j|jtddgƒƒdS(Niiiii(R tdifference_updateRR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_difference_method_callUs(R*R+R.RQRRRSRTReRURVRWRXRgRYRZR[R\RiRjRkRlRmRo(((s*/usr/local/lib/python2.7/test/test_sets.pyRcs*                    t TestMutatecBs†eZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „ZRS(cCs(dddg|_t|jƒ|_dS(NR]R^tc(R"RR (R ((s*/usr/local/lib/python2.7/test/test_sets.pyR.\scCs-|jjdƒ|j|jtdƒƒdS(NRqRB(R R7RR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_add_present`scCs-|jjdƒ|j|jtdƒƒdS(Ntdtabcd(R R7RR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_add_absentdscCsgtƒ}d}x>|jD]3}|j|ƒ|d7}|jt|ƒ|ƒqW|j||jƒdS(Nii(RR"R7RR R (R ttmpt expected_lenR#((s*/usr/local/lib/python2.7/test/test_sets.pyttest_add_until_fullhs   cCs-|jjdƒ|j|jtdƒƒdS(NR^tac(R RIRR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_remove_presentqscCs9y!|jjdƒ|jdƒWntk r4nXdS(NRss7Removing missing element should have raised LookupError(R RItfailt LookupError(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_remove_absentus  cCsZt|jƒ}xD|jD]9}|jj|ƒ|d8}|jt|jƒ|ƒqWdS(Ni(R R R"RIR(R RwR#((s*/usr/local/lib/python2.7/test/test_sets.pyttest_remove_until_empty|s  cCs-|jjdƒ|j|jtdƒƒdS(NRqtab(R RJRR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_discard_presentƒscCs-|jjdƒ|j|jtdƒƒdS(NRsRB(R RJRR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_discard_absent‡scCs*|jjƒ|jt|jƒdƒdS(Ni(R tclearRR (R ((s*/usr/local/lib/python2.7/test/test_sets.pyt test_clear‹s cCspi}x |jr(d||jjƒ=s==s!=t>t=txty(s!=s==RŽs<=Rs>=( tlefttrighttcasestevaltlocalsRRŠt case2methodtgetattrtreverse(R RRR-texpectedRtmethodtrcase((s*/usr/local/lib/python2.7/test/test_sets.pyt test_issubset³s"      (R*R+R–R˜Rœ(((s*/usr/local/lib/python2.7/test/test_sets.pyRŠ¥s    tTestSubsetEqualEmptycBs&eZeƒZeƒZdZdZRS(s both emptys==s<=s>=(s==s<=s>=(R*R+RR‘R’tnameR“(((s*/usr/local/lib/python2.7/test/test_sets.pyRËs  tTestSubsetEqualNonEmptycBs8eZeddgƒZeddgƒZdZdZRS(iis equal pairs==s<=s>=(s==s<=s>=(R*R+RR‘R’RžR“(((s*/usr/local/lib/python2.7/test/test_sets.pyRŸÓstTestSubsetEmptyNonEmptycBs/eZeƒZeddgƒZdZdZRS(iisone empty, one non-emptys!=RŽs<=(s!=RŽs<=(R*R+RR‘R’RžR“(((s*/usr/local/lib/python2.7/test/test_sets.pyR Ûs tTestSubsetPartialcBs5eZedgƒZeddgƒZdZdZRS(iis&one a non-empty proper subset of others!=RŽs<=(s!=RŽs<=(R*R+RR‘R’RžR“(((s*/usr/local/lib/python2.7/test/test_sets.pyR¡ãstTestSubsetNonOverlapcBs2eZedgƒZedgƒZdZdZRS(iisneither empty, neither containss!=(R*R+RR‘R’RžR“(((s*/usr/local/lib/python2.7/test/test_sets.pyR¢ëstTestOnlySetsInBinaryOpscBs†eZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „ZRS(cCst|j|j|jktƒ|j|j|jktƒ|j|j|jktƒ|j|j|jktƒdS(N(RtotherR tFalseR9(R ((s*/usr/local/lib/python2.7/test/test_sets.pyt test_eq_neõscs̈jt‡fd†ƒˆjt‡fd†ƒˆjt‡fd†ƒˆjt‡fd†ƒˆjt‡fd†ƒˆjt‡fd†ƒˆjt‡fd†ƒˆjt‡fd†ƒdS( NcsˆjˆjkS(N(R R¤((R (s*/usr/local/lib/python2.7/test/test_sets.pytýscsˆjˆjkS(N(R R¤((R (s*/usr/local/lib/python2.7/test/test_sets.pyR§þscsˆjˆjkS(N(R R¤((R (s*/usr/local/lib/python2.7/test/test_sets.pyR§ÿscsˆjˆjkS(N(R R¤((R (s*/usr/local/lib/python2.7/test/test_sets.pyR§scsˆjˆjkS(N(R¤R ((R (s*/usr/local/lib/python2.7/test/test_sets.pyR§scsˆjˆjkS(N(R¤R ((R (s*/usr/local/lib/python2.7/test/test_sets.pyR§scsˆjˆjkS(N(R¤R ((R (s*/usr/local/lib/python2.7/test/test_sets.pyR§scsˆjˆjkS(N(R¤R ((R (s*/usr/local/lib/python2.7/test/test_sets.pyR§s(R=R8(R ((R s*/usr/local/lib/python2.7/test/test_sets.pyttest_ge_gt_le_ltüscCs;y|j|jO_Wntk r)nX|jdƒdS(Nsexpected TypeError(R R¤R8R{(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_union_update_operators  cCs?|jr|jj|jƒn|jt|jj|jƒdS(N(totherIsIterableR RdR¤R=R8(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_union_updates csqˆjt‡fd†ƒˆjt‡fd†ƒˆjrQˆjjˆjƒnˆjtˆjjˆjƒdS(NcsˆjˆjBS(N(R R¤((R (s*/usr/local/lib/python2.7/test/test_sets.pyR§scsˆjˆjBS(N(R¤R ((R (s*/usr/local/lib/python2.7/test/test_sets.pyR§s(R=R8RªR tunionR¤(R ((R s*/usr/local/lib/python2.7/test/test_sets.pyt test_unions  cCs;y|j|jM_Wntk r)nX|jdƒdS(Nsexpected TypeError(R R¤R8R{(R ((s*/usr/local/lib/python2.7/test/test_sets.pyt!test_intersection_update_operators  cCs?|jr|jj|jƒn|jt|jj|jƒdS(N(RªR RfR¤R=R8(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_intersection_update%s    csqˆjt‡fd†ƒˆjt‡fd†ƒˆjrQˆjjˆjƒnˆjtˆjjˆjƒdS(Ncsˆjˆj@S(N(R R¤((R (s*/usr/local/lib/python2.7/test/test_sets.pyR§.scsˆjˆj@S(N(R¤R ((R (s*/usr/local/lib/python2.7/test/test_sets.pyR§/s(R=R8RªR t intersectionR¤(R ((R s*/usr/local/lib/python2.7/test/test_sets.pyttest_intersection-s  cCs;y|j|jN_Wntk r)nX|jdƒdS(Nsexpected TypeError(R R¤R8R{(R ((s*/usr/local/lib/python2.7/test/test_sets.pyt#test_sym_difference_update_operator5s  cCs?|jr|jj|jƒn|jt|jj|jƒdS(N(RªR RhR¤R=R8(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_sym_difference_update=s    csqˆjt‡fd†ƒˆjt‡fd†ƒˆjrQˆjjˆjƒnˆjtˆjjˆjƒdS(NcsˆjˆjAS(N(R R¤((R (s*/usr/local/lib/python2.7/test/test_sets.pyR§FscsˆjˆjAS(N(R¤R ((R (s*/usr/local/lib/python2.7/test/test_sets.pyR§Gs(R=R8RªR tsymmetric_differenceR¤(R ((R s*/usr/local/lib/python2.7/test/test_sets.pyttest_sym_differenceEs  cCs;y|j|j8_Wntk r)nX|jdƒdS(Nsexpected TypeError(R R¤R8R{(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_difference_update_operatorMs  cCs?|jr|jj|jƒn|jt|jj|jƒdS(N(RªR RnR¤R=R8(R ((s*/usr/local/lib/python2.7/test/test_sets.pyttest_difference_updateUs    csqˆjt‡fd†ƒˆjt‡fd†ƒˆjrQˆjjˆjƒnˆjtˆjjˆjƒdS(NcsˆjˆjS(N(R R¤((R (s*/usr/local/lib/python2.7/test/test_sets.pyR§^scsˆjˆjS(N(R¤R ((R (s*/usr/local/lib/python2.7/test/test_sets.pyR§_s(R=R8RªR t differenceR¤(R ((R s*/usr/local/lib/python2.7/test/test_sets.pyttest_difference]s  (R*R+R¦R¨R©R«R­R®R¯R±R²R³RµR¶R·R¹(((s*/usr/local/lib/python2.7/test/test_sets.pyR£ós            tTestOnlySetsNumericcBseZd„ZRS(cCs%tdƒ|_d|_t|_dS(Niiii(iii(RR R¤R¥Rª(R ((s*/usr/local/lib/python2.7/test/test_sets.pyR.hs (R*R+R.(((s*/usr/local/lib/python2.7/test/test_sets.pyRºgstTestOnlySetsDictcBseZd„ZRS(cCs3tdƒ|_idd6dd6|_t|_dS(Niiii(iii(RR R¤R9Rª(R ((s*/usr/local/lib/python2.7/test/test_sets.pyR.ps(R*R+R.(((s*/usr/local/lib/python2.7/test/test_sets.pyR»ostTestOnlySetsOperatorcBseZd„Zd„ZRS(cCs(tdƒ|_tj|_t|_dS(Niii(iii(RR R6R7R¤R¥Rª(R ((s*/usr/local/lib/python2.7/test/test_sets.pyR.xs cCs*tjƒtt|ƒjƒWdQXdS(N(Rtcheck_py3k_warningstsuperR¼R¨(R ((s*/usr/local/lib/python2.7/test/test_sets.pyR¨}s (R*R+R.R¨(((s*/usr/local/lib/python2.7/test/test_sets.pyR¼ws tTestOnlySetsTuplecBseZd„ZRS(cCs%tdƒ|_d|_t|_dS(Niiiii(iii(iii(RR R¤R9Rª(R ((s*/usr/local/lib/python2.7/test/test_sets.pyR.„s (R*R+R.(((s*/usr/local/lib/python2.7/test/test_sets.pyR¿ƒstTestOnlySetsStringcBseZd„ZRS(cCs%tdƒ|_d|_t|_dS(NiiiRB(iii(RR R¤R9Rª(R ((s*/usr/local/lib/python2.7/test/test_sets.pyR.Œs (R*R+R.(((s*/usr/local/lib/python2.7/test/test_sets.pyRÀ‹stTestOnlySetsGeneratorcBseZd„ZRS(cCs1d„}tdƒ|_|ƒ|_t|_dS(Ncss&xtdddƒD] }|VqWdS(Nii i(RC(ti((s*/usr/local/lib/python2.7/test/test_sets.pytgen•siii(iii(RR R¤R9Rª(R RÃ((s*/usr/local/lib/python2.7/test/test_sets.pyR.”s  (R*R+R.(((s*/usr/local/lib/python2.7/test/test_sets.pyRÁ“stTestOnlySetsofSetscBseZd„ZRS(cCs7tdƒ|_tdƒtdƒg|_t|_dS(NiiiRtcd(iii(RR RR¤R9Rª(R ((s*/usr/local/lib/python2.7/test/test_sets.pyR.Ÿs(R*R+R.(((s*/usr/local/lib/python2.7/test/test_sets.pyRÄžst TestCopyingcBseZd„Zd„ZRS(cCsš|jjƒ}|jt|ƒt|jƒƒt|ƒ}t|jƒ}|jt|ƒt|ƒƒx.t|ƒD] \}}|j|||ƒqrWdS(N(R RRR tsortedt enumeratetassertIs(R Rtdup_listtset_listRÂtel((s*/usr/local/lib/python2.7/test/test_sets.pyR¨s cCs)tj|jƒ}|j||jƒdS(N(RtdeepcopyR tassertSetEqual(R R((s*/usr/local/lib/python2.7/test/test_sets.pyttest_deep_copy±s(R*R+RRÏ(((s*/usr/local/lib/python2.7/test/test_sets.pyRƦs tTestCopyingEmptycBseZd„ZRS(cCstƒ|_dS(N(RR (R ((s*/usr/local/lib/python2.7/test/test_sets.pyR.¸s(R*R+R.(((s*/usr/local/lib/python2.7/test/test_sets.pyRзstTestCopyingSingletoncBseZd„ZRS(cCstdgƒ|_dS(Nthello(RR (R ((s*/usr/local/lib/python2.7/test/test_sets.pyR.¾s(R*R+R.(((s*/usr/local/lib/python2.7/test/test_sets.pyRѽstTestCopyingTriplecBseZd„Zd„ZRS(cCstdddgƒ|_dS(NR4i(RRR (R ((s*/usr/local/lib/python2.7/test/test_sets.pyR.ÄscCs*tjƒtt|ƒjƒWdQXdS(N(RR½R¾RÓR(R ((s*/usr/local/lib/python2.7/test/test_sets.pyRÇs (R*R+R.R(((s*/usr/local/lib/python2.7/test/test_sets.pyRÓÃs tTestCopyingTuplecBseZd„ZRS(cCstdgƒ|_dS(Nii(ii(RR (R ((s*/usr/local/lib/python2.7/test/test_sets.pyR.Îs(R*R+R.(((s*/usr/local/lib/python2.7/test/test_sets.pyRÔÍstTestCopyingNestedcBseZd„ZRS(cCstddfgƒ|_dS(Niiii(ii(ii(RR (R ((s*/usr/local/lib/python2.7/test/test_sets.pyR.Ôs(R*R+R.(((s*/usr/local/lib/python2.7/test/test_sets.pyRÕÓstTestIdentitiescBsGeZd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(cCsftgtdƒD]}tjdƒ^qƒ|_tgtdƒD]}tjdƒ^qAƒ|_dS(Ni2id(RRCtrandomt randrangeR]R^(R RÂ((s*/usr/local/lib/python2.7/test/test_sets.pyR.Ús1cCs¼|j|j}}|j|||kƒ|j|||kƒ|j||@|kƒ|j||@|kƒ|j||B|kƒ|j||B|kƒ|j||A||BkƒdS(N(R]R^R0(R R]R^((s*/usr/local/lib/python2.7/test/test_sets.pyttest_binopsVsSubsetsÞscCs†|j|j}}|j||@||@ƒ|j||B||Bƒ|j||A||Aƒ||kr‚|j||||ƒndS(N(R]R^RtassertNotEqual(R R]R^((s*/usr/local/lib/python2.7/test/test_sets.pyttest_commutativityès  cCs |jtƒ}}|j||A|ƒ|j|||ƒ|j||B|ƒ|j||@|ƒ|j||kƒ|j||kƒ|j||kƒdS(N(R]RRR0(R R]R4((s*/usr/local/lib/python2.7/test/test_sets.pyttest_reflexsive_relationsðscCsï|j|j}}|j||||@B||B||Bƒ|j||@||AB||Bƒ|j|||B||Bƒ|j|||B||Bƒ|j||||@B|ƒ|j||||@B|ƒ|j||||B||AƒdS(N(R]R^R(R R]R^((s*/usr/local/lib/python2.7/test/test_sets.pyttest_summationsús( cCsm|j|jtƒ}}}|j|||@|ƒ|j|||@|ƒ|j||@||A@|ƒdS(N(R]R^RR(R R]R^R4((s*/usr/local/lib/python2.7/test/test_sets.pyttest_exclusionscCs|j|j}}|jt|ƒt||ƒt||@ƒƒ|jt|ƒt||ƒt||@ƒƒ|jt||Aƒt||ƒt||ƒƒ|jt||Bƒt||ƒt||@ƒt||ƒƒ|jt||Aƒt||@ƒt||BƒƒdS(N(R]R^RR (R R]R^((s*/usr/local/lib/python2.7/test/test_sets.pyttest_cardinality_relations s ..2@( R*R+R.RÙRÛRÜRÝRÞRß(((s*/usr/local/lib/python2.7/test/test_sets.pyRÖÙs   sÓ Example from the Library Reference: Doc/lib/libsets.tex >>> from sets import Set as Base # override _repr to get sorted output >>> class Set(Base): ... def _repr(self): ... return Base._repr(self, sorted=True) >>> engineers = Set(['John', 'Jane', 'Jack', 'Janice']) >>> programmers = Set(['Jack', 'Sam', 'Susan', 'Janice']) >>> managers = Set(['Jane', 'Jack', 'Susan', 'Zack']) >>> employees = engineers | programmers | managers # union >>> engineering_management = engineers & managers # intersection >>> fulltime_management = managers - engineers - programmers # difference >>> engineers.add('Marvin') >>> print engineers Set(['Jack', 'Jane', 'Janice', 'John', 'Marvin']) >>> employees.issuperset(engineers) # superset test False >>> employees.union_update(engineers) # update from another set >>> employees.issuperset(engineers) True >>> for group in [engineers, programmers, managers, employees]: ... group.discard('Susan') # unconditionally remove element ... print group ... Set(['Jack', 'Jane', 'Janice', 'John', 'Marvin']) Set(['Jack', 'Janice', 'Sam']) Set(['Jack', 'Jane', 'Zack']) Set(['Jack', 'Jane', 'Janice', 'John', 'Marvin', 'Sam', 'Zack']) t libreftestcCs‡ddl}ddlm}tjttttt t t t t tttttttttttttttttt|j |ƒƒdS(Niÿÿÿÿ(t test_sets(!tdoctestttestRáRt run_unittestRFR<R,R/R3R5RORcRpRRŸR R¡R¢RºR»R¼R¿RÀRÁRÄRÐRÑRÓRÔRÕRÖt DocTestSuite(tverboseRâRá((s*/usr/local/lib/python2.7/test/test_sets.pyt test_main9s> t__main__Ræ(4tunittestR6RR%R×RãRt import_moduleR9RRRRtTestCaseRR,R/R3R5R:R;R<RFRORcRpRŠRRŸR R¡R¢R£RºR»R¼R¿RÀRÁRÄRÆRÐRÑRÓRÔRÕRÖRàt__test__RRçR*(((s*/usr/local/lib/python2.7/test/test_sets.pytsT< J    SVJ&t   Z  "