3 ^ c@sRdZddlmZddlmZddlmZddlm Z m Z m Z Gdddej Z 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 <>:. i) fixer_base)Node)python_symbols)NameArgListin_special_contextc@s eZdZdZdZdZddZdS)FixZipTzN power< 'zip' args=trailer< '(' [any] ')' > [trailers=trailer*] > zfuture_builtins.zipcCs|j|rdSt|rdS|dj}d|_g}d|kr^dd|dD}x|D] }d|_qPWttjtd|gdd}ttjtdt|gg|}|j|_|S) NargstrailerscSsg|] }|jqS)clone)Z.0nr r -/usr/lib64/python3.6/lib2to3/fixes/fix_zip.pyz 'sz$FixZip.transform..Zzip)prefixZlist) Z should_skiprr rrsymsZpowerrr)ZselfZnodeZresultsrr r Znewr r r transforms    zFixZip.transformN)Z__name__Z __module__Z __qualname__Z BM_compatibleZPATTERNZskip_onrr r r r rsrN)Z__doc__rrZpytreerZpygramrrZ fixer_utilrrrZConditionalFixrr r r r Zs