/usr/lib/python3.10/lib2to3/fixes/__pycache__
Edit: /usr/lib/python3.10/lib2to3/fixes/__pycache__/fix_zip.cpython-310.pyc (1579B)
o
bc @ sR d Z ddlmZ ddlmZ ddlmZ ddlm Z m
Z
mZ G dd dejZ
dS ) 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)NameArgListin_special_contextc @ s e Zd ZdZdZdZdd ZdS )FixZipTzN
power< 'zip' args=trailer< '(' [any] ')' > [trailers=trailer*]
>
zfuture_builtins.zipc C s | |rd S t|r
d S |d }d|_g }d|v r-dd |d D }|D ]}d|_q'ttjtd|gdd}ttjtdt|gg| }|j|_|S ) Nargs trailersc S s g | ]}| qS )clone).0nr r ,/usr/lib/python3.10/lib2to3/fixes/fix_zip.py
' s z$FixZip.transform..zip)prefixlist) should_skipr r
r r symspowerr r )selfnoderesultsr r r newr r r transform s
zFixZip.transformN)__name__
__module____qualname__
BM_compatiblePATTERNskip_onr r r r r r s
r N)__doc__r
r pytreer pygramr r
fixer_utilr r r ConditionalFixr r r r r s