mò *á¸Ec@s·dZd„Zd„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„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd „Z d!„Z!e!Z"d"„Z#d#„Z$d$„Z%d%„Z&d&„Z'd'„Z(d(„Z)d)„Z*d*„Z+d+„Z,d,„Z-d-„Z.d.„Z/d/„Z0d0S(1s7Restricted Python transformation examples This module contains pairs of functions. Each pair has a before and an after function. The after function shows the source code equivalent of the before function after it has been modified by the restricted compiler. These examples are actually used in the testRestrictions.py checkBeforeAndAfter() unit tests, which verifies that the restricted compiler actually produces the same output as would be output by the normal compiler for the after function. $Id: before_and_after.py 40218 2005-11-18 14:39:19Z andreasjung $ cCs|iS(N(txty(R((tF/data/zmath/zope/lib/python/RestrictedPython/tests/before_and_after.pytsimple_getattr_beforescCs t|dƒS(NR(t _getattr_R(R((Rtsimple_getattr_after"scCs dt_dS(Ntbar(RR(((Rtsimple_setattr_before'scCsdttƒ_dS(NR(t_write_RR(((Rtsimple_setattr_after*scCsxdddgD]}qWdS(Niii(R(R((Rtsimple_forloop_before/scCs$xtdddgƒD]}qWdS(Niii(t _getiter_R(R((Rtsimple_forloop_after3scCs/x(dddgD]}xdD]}qWqWdS(Niiitabc(RR(RR((Rtnested_forloop_before7s cCs;x4tdddgƒD]}xtdƒD]}q)WqWdS(NiiiR (R RR(RR((Rtnested_forloop_after<s  cCs:g}tD]"}|djo||dq q ~}dS(Nii(t_[1]twhateverRR(RRR((Rt simple_list_comprehension_beforeAscCs@g}ttƒD]"}|djo||dqq~}dS(Nii(RR RRR(RRR((Rtsimple_list_comprehension_afterDscCs`g}tD]H}|djo5tD].}||jo||d|dq"q"q q ~}dS(Nii(Rt whatever1Rt whatever2R(RRR((Rt nested_list_comprehension_beforeGscCslg}ttƒD]N}|djo;ttƒD].}||jo||d|dq.q.qq~}dS(Nii(RR RRRR(RRR((Rtnested_list_comprehension_afterKscCs dGHdS(Ntfoo((((Rtsimple_print_beforeQscCstƒ}|dIJdS(NR(t_print_t_print(R((Rtsimple_print_afterTs cCstdS(Ni(R(((Rtsimple_getitem_beforeZscCs ttdƒS(Ni(t _getitem_R(((Rtsimple_getitem_after]scCstd}dS(Nii(ii(RR(R((Rtsimple_get_tuple_key_before`scCsttdƒ}dS(Nii(ii(RRR(R((Rtsimple_get_tuple_key_aftercscCsdtdR3R9(((Rt+positional_and_star_and_starstar_call_afteréscCs ttdtdtttŽdS(NRtw(RR>RR1R3R9(((Rt9positional_and_defaults_and_star_and_starstar_call_beforeìsc Cs#tttdtdtttŽdS(NRRA(R5RR>RR1R3R9(((Rt8positional_and_defaults_and_star_and_starstar_call_afterïscCstid„}dS(NcCs|S(N(R(R((Rtós(RR1tf(RE((Rt&lambda_with_getattr_in_defaults_beforeòscCsttdƒd„}dS(NR1cCs|S(N(R(R((RRDös(RRRE(RE((Rt%lambda_with_getattr_in_defaults_afterõsN(1t__doc__RRRR R R RRRRRRRRRRR R!R"R#R$R%R'R(R)R*R+R,R-R.R/R0R2tno_unpack_afterR4R6R7R8R:R;R<R=R?R@RBRCRFRG(0R+R R%R*RRRR R,R#R=RR R(R?RFRR;R2R"RR4RR:RRRR0R)R/RIR!RCRRGR@RR7R'R-R6R R8R<RR$RBR.((Rt?s`