Files
PowerToys/PythonHome/Lib/lib2to3/fixes/fix_print.pyc

29 lines
2.6 KiB
Plaintext
Raw Normal View History

2014-07-09 18:15:23 +08:00
<03>
<EFBFBD>W`Sc@s<>dZddlmZddlmZddlmZddlmZddlmZm Z m
Z
m Z m Z ej d<00>Zdejfd <00><00>YZd
S( s Fixer for print.
Change:
'print' into 'print()'
'print ...' into 'print(...)'
'print ... ,' into 'print(..., end=" ")'
'print >>x, ...' into 'print(..., file=x)'
No changes are applied if print_function is imported from __future__
i(tpatcomp(tpytree(ttoken(t
fixer_base(tNametCalltCommatStringtis_tuples"atom< '(' [atom|STRING|NAME] ')' >tFixPrintcBs&eZeZdZd<00>Zd<00>ZRS(sP
simple_stmt< any* bare='print' any* > | print_stmt
c Cs2|s t<00>|jd<00>}|rJ|jttd<00>gd|j<00><01>dS|jdtd<00>ksit<00>|jd}t|<00>dkr<>tj |d<19>r<>dSd}}}|r<>|dt <00>kr<>|d }d}n|r3|dt j tjd<00>kr3t|<00>d kst<00>|dj<00>}|d
}ng|D]}|j<00>^q:} | rhd | d_n|dk s<>|dk s<>|dk r |dk r<>|j| d tt|<00><00><00>n|dk r<>|j| d tt|<00><00><00>n|dk r |j| d|<00>q nttd<00>| <00>}
|j|
_|
S(Ntbareuprinttprefixiii<><69><EFBFBD><EFBFBD>t u>>iiuusepuendufile(tAssertionErrortgettreplaceRRR tchildrentlent parend_exprtmatchtNoneRRtLeafRt
RIGHTSHIFTtclonet add_kwargRtrepr( tselftnodetresultst
bare_printtargstseptendtfiletargtl_argstn_stmt((s .\Lib\lib2to3\fixes\fix_print.pyt transform%s>   %
 % $ " "  cCsrd|_tj|jjt|<00>tjtjd<00>|f<00>}|ra|j t
<00><00>d|_n|j |<00>dS(Nuu=u ( R RtNodetsymstargumentRRRtEQUALtappendR(Rtl_nodests_kwdtn_exprt
n_argument((s .\Lib\lib2to3\fixes\fix_print.pyRMs    (t__name__t
__module__tTruet BM_compatibletPATTERNR%R(((s .\Lib\lib2to3\fixes\fix_print.pyR s (N(t__doc__tRRtpgen2RRt
fixer_utilRRRRRtcompile_patternRtBaseFixR (((s .\Lib\lib2to3\fixes\fix_print.pyt<module>s(