python (3.12.0)
̑eH J d Z ddlmZ ddlmZ G d dej
Zy)a, Fixer that cleans up a tuple argument to isinstance after the tokens
in it were fixed. This is mainly used to remove double occurrences of
tokens as a leftover of the long -> int / unicode -> str conversion.
eg. isinstance(x, (int, long)) -> isinstance(x, (int, int))
-> isinstance(x, int)
)
fixer_base)tokenc e Zd ZdZdZdZd Zy)
FixIsinstanceTz
power<
'isinstance'
trailer< '(' arglist< any ',' atom< '('
args=testlist_gexp< any+ >
')' > > ')' >
>
c t }|d }|j }g }t | }|D ] \ }} | j t j
k( rP| j |v rB|t | dz
k sC||dz j t j k( sgt | s|j | | j t j
k( s|j | j |r#|d j t j k( r|d= t | dk( r5|j }
|
j |d _
|
j |d y ||d d |j y )Nargs )setchildren enumeratetyper NAMEvaluelenCOMMAnextappendaddparentprefixreplacechanged)selfnoderesultsnames_insertedtestlistr new_argsiteratoridxargatoms P/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/lib2to3/fixes/fix_isinstance.py transformzFixIsinstance.transform s" 6? T? 2HCxx5::%#))~*ETQ&4a=+=+=+LN$88uzz)"&&syy1 2 ))U[[8x=A??D!%HQKLL!%DGLLN N)__name__
__module____qualname__
BM_compatiblePATTERN run_orderr'