
    daf	                     j    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y)	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y)FixZipTzN
    power< 'zip' args=trailer< '(' [any] ')' > [trailers=trailer*]
    >
    zfuture_builtins.zipc                    | j                  |      ry t        |      ry |d   j                         }d|_        g }d|v r.|d   D cg c]  }|j                          }}|D ]	  }d|_         t	        t
        j                  t        d      |gd      }t	        t
        j                  t        d      t        |g      g|z         }|j                  |_        |S c c}w )Nargs trailerszip)prefixlist)	should_skipr   cloner   r   symspowerr   r   )selfnoderesultsr   r   nnews          0/root/Python-3.12.4/Lib/lib2to3/fixes/fix_zip.py	transformzFixZip.transform   s    D!d#v$$& +2:+>?a	?H?  4::UT22>4::Vgsen=HI[[

 @s   CN)__name__
__module____qualname__BM_compatiblePATTERNskip_onr        r   r
   r
      s    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$   