Spade
Mini Shell
| Directory:~$ /proc/self/root/usr/lib/python2.7/site-packages/libpasteurize/fixes/ |
| [Home] [System Details] [Kill Me] |
�
,�]c@sbdZddlmZddlmZddlmZdZd�Zdej fd��YZ
d S(
u&
Fixer to remove function annotations
i����(t
fixer_base(ttoken(tsymsu)Removing function annotations
completely.cCs|jdS(Ni(tchildren(tnode((sG/usr/lib/python2.7/site-packages/libpasteurize/fixes/fix_annotations.pytparam_without_annotationsstFixAnnotationscBs&eZeZd�ZdZd�ZRS(cCs,|js(t|_|j|d|�ndS(Ntreason(twarnedtTruetwarning(tselfRR((sG/usr/lib/python2.7/site-packages/libpasteurize/fixes/fix_annotations.pyt warn_onces um
funcdef< 'def' any parameters< '('
[params=any] ')' > ['->' ret=any] ':'
any* >
cCs+|jd�}|jd�}|dk rx|jjtjksKtd��|j|dt�|jj �|j �n|dkr�dS|jt
jkr�x�|jD]A}|jt
j
kr�|j|dt�|jt|��q�q�Wn;|jt
j
kr'|j|dt�|jt|��ndS(uK
This just strips annotations from the funcdef completely.
uparamsuretuInvalid return
annotationRN(tgettNonetprev_siblingttypeRtRARROWtAssertionErrorRtwarning_texttremoveRt
typedargslistRttnametreplaceR(RRtresultstparamstrettparam((sG/usr/lib/python2.7/site-packages/libpasteurize/fixes/fix_annotations.pyt transforms"!
(t__name__t
__module__tFalseRRtPATTERNR(((sG/usr/lib/python2.7/site-packages/libpasteurize/fixes/fix_annotations.pyRs N(t__doc__tlib2to3Rt
lib2to3.pgen2Rtlib2to3.fixer_utilRRRtBaseFixR(((sG/usr/lib/python2.7/site-packages/libpasteurize/fixes/fix_annotations.pyt<module>s