grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026a ´iÍ ã@sZdZddlmZddlmZddlmZddlm Z m 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_contextÚ parenthesizec@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.filtercCsL| |¡rdSg}d|vr6|dD]}| | ¡¡q"d|vrª| d¡ ¡}|jtjkrfd|_t|ƒ}t | d¡ ¡| d¡ ¡| d¡ ¡|ƒ}t tj |g|dd�}n–d|vrìt t d ƒt d ƒ|d  ¡t d ƒƒ}t tj |g|dd�}nTt |ƒrødS|d  ¡}t tj t d ƒ|gdd�}t tj t d ƒt|gƒg|ƒ}d|_|j|_|S)NZextra_trailersZ filter_lambdaÚxpÚÚfpÚit)ÚprefixZnoneZ_fÚseqÚargsÚfilterÚlist)Z should_skipÚappendZcloneÚgetÚtypeÚsymsÚtestrr rrZpowerrrr)ÚselfZnodeÚresultsZtrailersÚtr Únewr©rú0/usr/lib64/python3.9/lib2to3/fixes/fix_filter.pyÚ transform:s>    þ ý zFixFilter.transformN)Ú__name__Ú __module__Ú __qualname__Z BM_compatibleZPATTERNZskip_onrrrrrr sr N)Ú__doc__r rZpytreerZpygramrrZ fixer_utilrrrrr ZConditionalFixr rrrrÚs