
    ZQd	                     h    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  G d dej                  ZdS )	a7  
Fixer that changes zip(seq0, seq1, ...) into list(zip(seq0, seq1, ...)
unless there exists a 'from future_builtins import zip' statement in the
top-level namespace.

We avoid the transformation if the zip() call is directly contained in
iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or for V in <>:.
   )
fixer_base)Node)python_symbols)NameArgListin_special_contextc                        e Zd ZdZdZdZd ZdS )FixZipTzN
    power< 'zip' args=trailer< '(' [any] ')' > [trailers=trailer*]
    >
    zfuture_builtins.zipc                    |                      |          rd S t          |          rd S |d                                         }d|_        g }d|v rd |d         D             }|D ]	}d|_        
t	          t
          j        t          d          |gd          }t	          t
          j        t          d          t          |g          g|z             }|j        |_        |S )Nargs trailersc                 6    g | ]}|                                 S  )clone).0ns     ,/usr/lib/python3.11/lib2to3/fixes/fix_zip.py
<listcomp>z$FixZip.transform.<locals>.<listcomp>'   s     ???a		???    zip)prefixlist)	should_skipr   r   r   r   symspowerr   r   )selfnoderesultsr   r   r   news          r   	transformzFixZip.transform   s    D!! 	Fd## 	4v$$&&  ??7:+>???H  4:UT22>>>4:Vgsenn=HII[

r   N)__name__
__module____qualname__BM_compatiblePATTERNskip_onr!   r   r   r   r
   r
      s6        MG
 $G    r   r
   N)__doc__r   r   pytreer   pygramr   r   
fixer_utilr   r   r   ConditionalFixr
   r   r   r   <module>r-      s                 + + + + + + : : : : : : : : : :    Z&     r   