%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/test/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/test/test_ast.pyo


Nac:@sddlZddlZddlZddlmZddlZdZdddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,g)Zd-gZdd.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEgZ	dFej
fdGYZdHej
fdIYZdJZ
dKZdLdMdNdOfdPdNdOfddQfffgfdLdRdNdOfdSdTgeegfdUdNdVffggfgfdLdRdNdOfdSdTdPdNdWfdXdYffgeegfdUdNdZffggfgfdLdRdNdOfdSdTdPdNdWfdXdYffgeed[dNd\fdOfgfdUdNd]ffggfgfdLdRdNdOfdSdTgd^egfdUdNd_ffggfgfdLdRdNdOfdSdTged`gfdUdNdaffggfgfdLdRdNdOfdSdTdPdNdWfdXdYffdPdNdVfdbdYffdPdNd_fdcdYffdPdNddfdedYffdPdNdffdgdYffgd^d`d[dNdhfdNfdPdNdifddQffdjdNdkfgdQffdldNdmfggfgfdUdNdnffggfgfdLdodNdOfdpgdUdNd\ffggfgfdLdodNdOfdpdPdNd\fdqdQffgdUdNdaffggfgfdLdRdNdOfdSdTgeegfdrdNd\fd[dNdsfdNffggfgfdLdtdNdOfdPdNdufd?dvffgfgfdLdwdNdOfdPdNdOfd?dxffgd[dNdufdNffgfdLdydNdOfdPdNdOfd?dxffdzfd[dNd{fdNffgfdLd|dNdOfdPdNd\fdSdQffd[dNdhfdNfgefgfdLd}dNdOfdPdNdufd?dxffdPdNdVfd?dQffdUdNdhffggfgfdLd~dNdOfdPdNdWfd?dQffdUdNd\ffggfgfdLddNdOfdPdNdfd?dQffdUdNd{ffggfgfdLddNdOfdPdNdWfddQffddNdafdfefgfdLddNdOfdUddffgdddOfdPddfddQffedUdudffgfggfgfdLddNdOfdUddffgdUdudffgfgfdLddNdOfdPdNdfd?dQffefgfdLddNdOfddefgfgfdLddNdOfddd?efgdOfgfdLddNdOfddNd{fd?feefgfdLddNdOfd?gfgfdLdMdNdOfd[dNdOfdNffgfdLdUdNdOffgfdLddNdOffgfdLddNdOffgfdLd}dNdOfddNdufdPdNdufdXdxffdPdNdWfdbdxffgdxffdPdNdhfdcdQffdUdNd_ffggfgfdLdMdNdOfddNdNfddNdfdPdNdfdXdQffdPdNdufdbdQffgdQffdddNdhfdPdNdhfdXdxffdPdNdfdbdxffgdxffdPdNdfdcdQffgfgffgfdLdMdNdOfddNdNfddNdfdPdNdfdXdQffdPdNdufdbdQffgdQffdddNdhfdPdNdhfdXdxffdPdNdfdbdxffgdxffdPdNdfdcdQffgfgffgfdLdMdNdOfddNdNfddNdfdPdNdfdXdQffdPdNdufdbdQffgdQffdddNd]fdPdNd]fdXdxffdPdNd_fdbdxffgdxffdPdNdfdcdQffgfgffgfdLdMdNdOfdddufdddufdPddufddQffdPd{dfddQffgdQffddd\dufdPd\dufddxffdPdZdufddxffgdxffdPdZdZfddQffgfgffgfdLdMdNdOfddNdNfdPdNdNfdXdQffdPdNd{fdbdQffddPdNdhfddxffdPdNdifddQffgfddPdNddfddxffdPdNdfddQffdPdNdfddQffgfgffgfdLdMdNdOfddNdNfdPdNdNfdXdQffdPdNd{fdbdQffdddNdhfdPdNdhfd?dxffdPdNdfddxffgdxffdPdNdfddQffgfgffgfdLdMdNdOfddNdNfdPdNdNfddQffddPdNdfddxffdPdNd]fddQffdPdNdafddQffgfgffgfdLdMdNdOfddNdNfdPdNdNfddQffdddNdfdPdNdfddxffdPdNdVfddxffgdxffdPdNd_fddQffgfgffgfdLdRdNdOfdSdTgeegfdUdudVffgdPdNdNfddQffdddNfdPddNfddQffggeefdddNfdPddNfddQffd[ddfdNfggeefgfgfdLdodNdOfdpgdUdudVffgdPdNdNfddQffdddNfdPddNfddQffggeefdddNfdPddNfddQffd[ddfdNfggeefgfgfdLdRdNdOfdSdTgeegfdUddVffgddNdNfdPdNdNfddQffddNdWfdPdNdWfdXdQffddPdNd]fdXdxffdPdNdafdbdQffgfgfggeefgfgfg)ZddMdNdOfddNdOfd[dNdOfdNfdzfd[dNdfdfffgfgZddPdNdOfddQfffdddNdOfdfdPdNdOfdXdQffdPdNdWfdbdQffgffdddNdOfdPdNdOfdXdQffdzfdPdNdufdbdQffffdddNdOfdfdPdNdufd?dQffffdddNdOfdTgeegfdPdNdfddQffffddldNdOfd[dNdfdNfgd[dNdufdfgffddldNdOfggffdddNdOfdPdNdNfddQffgffddldNdOfd[ddWfdNfgd[dudZfdfgffdddNdNfdPdNdNfdXdQffddPdNdfdbdxffdPdNd]fdcdQffdPdNdafdedQffgfgffdddNdNfdPdNdNfdXdQffddPdNdfdbdxffdPdNd]fdcdQffdPdNdafdedQffgfgffdddNdOfd[dNdOfdNfdfdfgd[dNdufdfd[dNd\fdfgffdddNdOfdPdNdOfdSdQffd[dNdfdNfd[dNdufdfgddcd[dNd\fdffgdPdNdhfdedQffdPdNdsfdgdQffffdddNdOfdPdNdNfd?dQffffdd[dNdOfdffdddNdOfdffdddNdOfdPdNdOfdXdQffdbdQfffdddNdOfdPdNdOfdXdQffddPdNdfdbdQffdPdNdufdcdQffefdQfffddPdNdOfd?dQfffddjdNdOfd[dNdNfdNfd[dNdfdfd[dNd{fdfgdQfffddjdNdOfgdQfffdddNdOfd[dNdOfdNfd[dNdfdfd[dNdufdfgdQfffdddNdNfd[dNdNfdNfd[dNdfdfd[dNd{fdfgdQfffdddNdOfgdQfffdddNdOfddNdOfddNdOfddNdOfdPdNdOfdXdQffdbdQffdcdQffdedQffddNd\fddNd\fdPdNd\fdXdQffdbdQffdd[dNd]fdNfd[dNd_fdfefdQffggeeffgZedS(iN(ttest_supportcCs|dks't|ttttfr+|St|trWg|D]}t|^qAS|jj	g}t
|drt
|dr|j|j|j
fn|jdkrt|Sx-|jD]"}|jtt||qWt|S(Ntlinenot
col_offset(tNonet
isinstancet
basestringtinttlongtcomplextlisttto_tuplet	__class__t__name__thasattrtappendRRt_fieldsttupletgetattr(tttetresulttf((s)/usr/local/lib/python2.7/test/test_ast.pyR
s'
 Rs
def f(): passsdef f(a): passsdef f(a=0): passsdef f(*args): passsdef f(**kwargs): passs8def f(a, b=1, c=None, d=[], e={}, *args, **kwargs): passsclass C:passsclass C(object): passsdef f():return 1sdel vsv = 1sv += 1sprint >>f, 1, sfor v in v:passswhile v:passs	if v:passsraise Exception, 'string's$try:
  pass
except Exception:
  passstry:
  pass
finally:
  passsassert vs
import syssfrom sys import vsexec 'v'sglobal vt1tpasstbreaktcontinuesfor a,b in c: passs[(a,b) for a,b in c]s((a,b) for a,b in c)s((a,b) for (a,b) in c)sL(
    (
    Aa
    ,
       Bb
    )
    for
    Aa
    ,
    Bb in Cc
    )s"{a : b for w in x for m in p if g}s{a : b for v,w in x}s{r for l in x if g}s{r for l,m in x}s'@deco1
@deco2()
@deco3(1)
def f(): passs'@deco1
@deco2()
@deco3(1)
class C: passs!@deco(a for a in b)
def f(): passs1+2sa and bsa + bsnot vslambda:Nones{ 1:2 }s{}s{None,}s&{
      1
        :
          2
     }s[a for b in c if d]s(a for b in c if d)s	1 < 2 < 3sf(1,2,c=3,*d,**e)s`v`t10Ls'string'sa.bsa[b:c]tvs[1,2,3]s[]s1,2,3s(1,2,3)s()sa.b.c.d(a.b[1:2])t	AST_TestscBseZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZRS(cCst|tjs"|jdkr&dSt|tjtjtjfr|j|j	f}|j
||k|j|j	f}nxr|jD]g}t||}t|trx@|D]}|j
||qWq|dk	r|j
||qqWdS(N(RtasttASTRRtexprtstmtt
excepthandlerRRt
assertTrueRR	t_assertTrueorder(tselftast_nodet
parent_postnode_postnametvaluetchild((s)/usr/local/lib/python2.7/test/test_ast.pyR#s"!
c	Cstj}|j|jd|jt|jWdQX|jtd|_WdQX|jttjddWdQX|jttjdWdQXdS(NiRi((	RRtassertEqualRtassertRaisestAttributeErrortvarargtfoobart	TypeError(R$tx((s)/usr/local/lib/python2.7/test/test_ast.pyttest_AST_objectss
cCsxttdfttdfttdffD]p\}}}x^tj||D]J\}}t|d|t	j
}|jt|||j
|dqMWq+WdS(Ntexectsingletevalt?i(ii(t
exec_teststexec_resultstsingle_teststsingle_resultst
eval_teststeval_resultst	itertoolstiziptcompileRt
PyCF_ONLY_ASTR+R
R#(R$tinputtoutputtkindtitotast_tree((s)/usr/local/lib/python2.7/test/test_ast.pyt
test_snippetsscCsltjdjdjj}|j|j|j|j|j|j	tj
|j|j	jddS(Nsx[::]iR(
RtparsetbodyR)tslicetassertIsNonetuppertlowertassertIsInstancetsteptNameR+tid(R$tslc((s)/usr/local/lib/python2.7/test/test_ast.pyt
test_slices
cCs*tjdjd}|j|jdS(Nsfrom . import yi(RRHRIRKtmodule(R$tim((s)/usr/local/lib/python2.7/test/test_ast.pyttest_from_importscCsStjd}|j|jdtjdj|jd_t|dddS(Nsfrom __future__ import divisionis __future__ s<test>R3(RRHRNRIt
ImportFromtstripRTR?(R$tmod((s)/usr/local/lib/python2.7/test/test_ast.pyt!test_non_interned_future_from_astscCs|jttjtj|jttjtj|jttjtj|jttjtj|jttjtj|jttj	tjdS(N(
R"t
issubclassRtForR RPRRt
comprehensiontGt(R$((s)/usr/local/lib/python2.7/test/test_ast.pyttest_base_classesscCsxtjjD]q\}}t|tr|dkr|djr|}t|tjr|jt|jt	qqqWdS(NRi(
Rt__dict__t	iteritemsRttypetisupperRR+RR(R$R(titemR1((s)/usr/local/lib/python2.7/test/test_ast.pyttest_field_attr_existences
+	cCsktj}|j|jd	|jt|jWdQXtjdddd}|j|jddS(
NtargsR.tkwargtdefaultsiiii(RfR.RgRh(Rt	argumentsR+RR,R-R.(R$R1((s)/usr/local/lib/python2.7/test/test_ast.pyttest_argumentss
cCs,tj}d|_|j|jddS(Ni(RtNumRR+(R$R1((s)/usr/local/lib/python2.7/test/test_ast.pyttest_field_attr_writables	c
CsGtj}|j|jd|jt|jWdQXtjd}|j|jd|jt|jWdQX|jt|jWdQXtjdd}|j|jdtjddd}|j|jd|j|jd|j|jd|jt	tjdd|jt	tjdddddS(	Ntni*Riii(Rm(Rm(
RRkR+RR,R-RmRR/R0(R$R1((s)/usr/local/lib/python2.7/test/test_ast.pyttest_classattrss$


cCs8tjdg}tj|}|j|j|dS(Ni*(RRktModuleR+RI(R$RIR1((s)/usr/local/lib/python2.7/test/test_ast.pyttest_module0sc	Cstj}|j|jd
d|_|j|jdtjd}tjd}tj}tj|||}|j|j||j|j||j|j	|tjddd}|j|jd|j|jd|j|j	dtjddddd	}|j|jd|j|jd|j|j	d|j|j
d	|jttjdd|jttjdddd
|jttjdddd	|jttjdddd
dd	tjdddddddd	}|j|jd|j|jd|j|j	d|j|j
d	tjddddd}|j|jddS(NtlefttoptrightiiiiRiit	foobarbazi*(RqRrRs(
RtBinOpR+RRtRktAddRqRrRsRR,R0(R$R1tn1tn3taddop((s)/usr/local/lib/python2.7/test/test_ast.pyttest_nodeclasses5s>	%$cCs#tj}|j|jddS(N((RtSubR+R(R$R1((s)/usr/local/lib/python2.7/test/test_ast.pyttest_no_fieldsesc	Csddl}|g}yddl}|j|Wntk
rEnXdddg}xq|D]i}x`|D]X}xOdtDD]=}|j|j||}|jt|t|qWqiWq\WdS(Niiiicss$|]}t|dddVqdS(R6R3iN(R?(t.0RD((s)/usr/local/lib/python2.7/test/test_ast.pys	<genexpr>us(	tpickletcPickleRtImportErrorR7tloadstdumpsR+R
(	R$R~tmodsRt	protocolsRYtprotocolRtast2((s)/usr/local/lib/python2.7/test/test_ast.pyt
test_picklingjs	


cCstjtjtjdtjg}tj||jt}t|ddWdQX|j	dt
|jdS(Nuxs<test>R3sidentifier must be of type str(RRotExprRPtLoadtfix_missing_locationsR,R0R?tassertIntstrt	exception(R$tmtcm((s)/usr/local/lib/python2.7/test/test_ast.pyttest_invalid_identitiferys
-
cCsvtjtjtjdg}tj||jt}t|ddWdQX|jdt	|j
dS(Ni+s<test>R3s!string must be of type str or uni(RRoRtStrRR,R0R?RRR(R$RR((s)/usr/local/lib/python2.7/test/test_ast.pyttest_invalid_strings
$
(Rt
__module__R#R2RGRSRVRZR_ReRjRlRnRpRzR|RRR(((s)/usr/local/lib/python2.7/test/test_ast.pyRs"										
				0			tASTHelpers_TestcBsbeZdZdZdZdZdZdZdZdZ	dZ
d	ZRS(
cCsMtjd}tdddtj}|jtj|tj|dS(Ns
foo(1 + 1)s	<unknown>R3(RRHR?R@R+tdump(R$tatb((s)/usr/local/lib/python2.7/test/test_ast.pyt
test_parsescCsjtjd}|jtj|d|jtj|dtd|jtj|dtddS(Nsspam(eggs, "and cheese")sModule(body=[Expr(value=Call(func=Name(id='spam', ctx=Load()), args=[Name(id='eggs', ctx=Load()), Str(s='and cheese')], keywords=[], starargs=None, kwargs=None))])tannotate_fieldsseModule([Expr(Call(Name('spam', Load()), [Name('eggs', Load()), Str('and cheese')], [], None, None))])tinclude_attributessModule(body=[Expr(value=Call(func=Name(id='spam', ctx=Load(), lineno=1, col_offset=0), args=[Name(id='eggs', ctx=Load(), lineno=1, col_offset=5), Str(s='and cheese', lineno=1, col_offset=11)], keywords=[], starargs=None, kwargs=None, lineno=1, col_offset=0), lineno=1, col_offset=0)])(RRHR+RtFalsetTrue(R$tnode((s)/usr/local/lib/python2.7/test/test_ast.pyt	test_dumpscCs_tjddd}tjtjd|jj|j_|jtj|dtddS(Ns1 + 1tmodeR5iRsExpression(body=BinOp(left=Num(n=1, lineno=1, col_offset=0), op=Add(), right=Num(n=2, lineno=1, col_offset=4), lineno=1, col_offset=0))(	RRHt
copy_locationRkRIRsR+RR(R$tsrc((s)/usr/local/lib/python2.7/test/test_ast.pyttest_copy_locations'cCstjd}|jjtjtjtjdtjtjdggdd|j
|tj||j
tj|dt
ddS(Ns
write("spam")tspamteggsRsModule(body=[Expr(value=Call(func=Name(id='write', ctx=Load(), lineno=1, col_offset=0), args=[Str(s='spam', lineno=1, col_offset=6)], keywords=[], starargs=None, kwargs=None, lineno=1, col_offset=0), lineno=1, col_offset=0), Expr(value=Call(func=Name(id='spam', ctx=Load(), lineno=1, col_offset=0), args=[Str(s='eggs', lineno=1, col_offset=0)], keywords=[], starargs=None, kwargs=None, lineno=1, col_offset=0), lineno=1, col_offset=0)])(RRHRIRRtCallRPRRRR+RRR(R$R((s)/usr/local/lib/python2.7/test/test_ast.pyttest_fix_missing_locationss*"cCstjddd}|jtj|dd||jtj|dtdtjddd}|jtj|jdd|j|jtj|dtddS(Ns1 + 1RR5RmiRsExpression(body=BinOp(left=Num(n=1, lineno=4, col_offset=0), op=Add(), right=Num(n=1, lineno=4, col_offset=4), lineno=4, col_offset=0))(RRHR+tincrement_linenoRRRI(R$R((s)/usr/local/lib/python2.7/test/test_ast.pyttest_increment_linenos%cCsytjddd}ttj|j}|j|jdjd|j|igd6dd6gd6dd	6dS(
Nsfoo()RR5tfunctfootkeywordstkwargsRftstarargs(	RRHtdicttiter_fieldsRIR+tpopRQR(R$Rtd((s)/usr/local/lib/python2.7/test/test_ast.pyttest_iter_fieldss
cCstjddd}|jtttj|jdtj|j}|jt|jd|jt|j	d|jt|j	d|jtj
t|ddS(	Nsspam(23, 42, eggs='leek')RR5iRii*s(keyword(arg='eggs', value=Str(s='leek'))(RRHR+tlenR	titer_child_nodesRItnextRQRmR(R$Rtiterator((s)/usr/local/lib/python2.7/test/test_ast.pyttest_iter_child_nodess(cCs3tjd}|jtj|jdddS(Ns&def foo():
  """line one
  line two"""isline one
line two(RRHR+t
get_docstringRI(R$R((s)/usr/local/lib/python2.7/test/test_ast.pyttest_get_docstringscCs~|jtjddddg|jtjdidd6|jtjdttdf|jttjd	dS(
Ns	[1, 2, 3]iiis{"foo": 42}i*Rs(True, False, None)sfoo()(R+Rtliteral_evalRRRR,t
ValueError(R$((s)/usr/local/lib/python2.7/test/test_ast.pyttest_literal_evals" "cCse|jtjdd|jtjdd|jtjdd	|jttjddS(
Nt2jy@s10 + 2ji
s1.5 - 2jg?s2 + (3 + 4j)y$@@y?(R+RRR,R(R$((s)/usr/local/lib/python2.7/test/test_ast.pyttest_literal_eval_issue4907s(RRRRRRRRRRRR(((s)/usr/local/lib/python2.7/test/test_ast.pyRs										cCs0tjdtftjttWdQXdS(Nsbackquote not supported(Rtcheck_py3k_warningst
SyntaxWarningtrun_unittestRR(((s)/usr/local/lib/python2.7/test/test_ast.pyt	test_mains	
c	CstdkrdStjddgkrxrtdftdftdffD]O\}}|dGHx2|D]*}ttt|d|d	d
GHqdWdGHqHWdGHt	nt
dS(
Nt__main__is-gR3R4R5s_results = [R6it,t]smain()(RtsystargvR7R9R;treprR
R?t
SystemExitR(t
statementsRCts((s)/usr/local/lib/python2.7/test/test_ast.pytmains	
(		RoRiiRPRtFunctionDefRRitPassi	iRtParami
RkiiRfiRiRtciRiRiitListitDictii4tClassDeftCtobjecttReturnitDeleteitDeltAssigntStoret	AugAssignRvitPrintR\tWhiletIfitRaiset	ExceptionRtstringt	TryExceptit
ExceptHandlerit
TryFinallytAsserttImporttaliasRRWtExectGlobaltBreaktContinuetTupletListCompR]i
itGeneratorExpitAatBbtCctDictComptwR1Ritpi tgtSetComptrtltdeco1Rtdeco2tdeco3tdecotInteractiveRut
ExpressiontBoolOptAndtUnaryOptNottLambdatSettComparetLttkeywordtReprl
t	Attributet	SubscripttSlice(RR=tunittestttestRRR
R7R9R;tTestCaseRRRRRRR8R:R<(((s)/usr/local/lib/python2.7/test/test_ast.pyt<module>s$				h		0BZlBB3KT3EHH]EEEl<3'-0*WNK3??0?]-6lTTT

Zerion Mini Shell 1.0