???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................3

  \[
                 @   sV   d Z ddlmZ ddlmZ ddlmZ ddlm	Z	m
Z
mZmZ G dd dejZdS )	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    e Zd ZdZdZdZdd ZdS )	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*]
    >
    zfuture_builtins.filterc             C   s2  | j |rd S g }d|kr:x|d D ]}|j|j  q$W d|krt|jdj |jdj |jdj |jdj }ttj|g| dd}nd|krttd	td	|d
 j td	}ttj|g| dd}nTt	|rd S |d j }ttjtd|gdd}ttjtdt
|gg| }d|_|j|_|S )NZextra_trailersZfilter_lambdafpitZxp )prefixZnoneZ_fseqargsfilterlist)Zshould_skipappendZcloner   getr   symsZpowerr   r   r   r   )selfZnodeZresultsZtrailerstnewr    r   0/usr/lib64/python3.6/lib2to3/fixes/fix_filter.py	transform:   s4    


zFixFilter.transformN)__name__
__module____qualname__ZBM_compatibleZPATTERNZskip_onr   r   r   r   r   r	      s   r	   N)__doc__r   r   Zpytreer   Zpygramr   r   Z
fixer_utilr   r   r   r   ZConditionalFixr	   r   r   r   r   <module>   s
   