grthtrhthjhtyjytjytkergtrhtrjytjerhrfh3 \[ ã@sVdZddlmZddlmZddlmZddlm Z m Z m Z m Z Gdd„dej ƒZdS) a¸Fixer that changes filter(F, X) into list(filter(F, X)). We avoid the transformation if the filter() call is directly contained in iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or for V in <>:. NOTE: This is still not correct if the original code was depending on filter(F, X) to return a string if X is a string and a tuple if X is a tuple. That would require type inference, which we don't do. Let Python 2.6 figure it out. é)Ú fixer_base)ÚNode)Úpython_symbols)ÚNameÚArgListÚListCompÚin_special_contextc@s eZdZdZdZdZdd„ZdS)Ú FixFilterTaV filter_lambda=power< 'filter' trailer< '(' arglist< lambdef< 'lambda' (fp=NAME | vfpdef< '(' fp=NAME ')'> ) ':' xp=any > ',' it=any > ')' > [extra_trailers=trailer*] > | power< 'filter' trailer< '(' arglist< none='None' ',' seq=any > ')' > [extra_trailers=trailer*] > | power< 'filter' args=trailer< '(' [any] ')' > [extra_trailers=trailer*] > zfuture_builtins.filtercCs2|j|ƒrdSg}d|kr:x|dD]}|j|jƒƒq$Wd|kr�t|jdƒjƒ|jdƒjƒ|jdƒjƒ|jdƒjƒƒ}ttj|g|dd�}n–d|krÒttd ƒtd ƒ|d jƒtd ƒƒ}ttj|g|dd�}nTt |ƒrÞdS|d jƒ}ttjtd ƒ|gdd�}ttjtd ƒt |gƒg|ƒ}d|_ |j |_ |S)NZextra_trailersZ filter_lambdaÚfpÚitZxpÚ)ÚprefixZnoneZ_fÚseqÚargsÚfilterÚlist) Z should_skipÚappendZclonerÚgetrÚsymsZpowerrrrr )ÚselfZnodeZresultsZtrailersÚtÚnewr©rú0/usr/lib64/python3.6/lib2to3/fixes/fix_filter.pyÚ transform:s4      zFixFilter.transformN)Ú__name__Ú __module__Ú __qualname__Z BM_compatibleZPATTERNZskip_onrrrrrr sr N)Ú__doc__r rZpytreerZpygramrrZ fixer_utilrrrrZConditionalFixr rrrrÚs