python (3.11.7)

(root)/
lib/
python3.11/
lib2to3/
fixes/
__pycache__/
fix_idioms.cpython-311.opt-1.pyc

eddZddlmZddlmZmZmZmZmZm	Z	dZ
dZGddejZ
dS)	aAdjust some old Python 2 idioms to their modern counterparts.

* Change some type comparisons to isinstance() calls:
    type(x) == T -> isinstance(x, T)
    type(x) is T -> isinstance(x, T)
    type(x) != T -> not isinstance(x, T)
    type(x) is not T -> not isinstance(x, T)

* Change "while 1:" into "while True:".

* Change both

    v = list(EXPR)
    v.sort()
    foo(v)

and the more general

    v = EXPR
    v.sort()
    foo(v)

into

    v = sorted(EXPR)
    foo(v)
)
fixer_base)CallCommaNameNode	BlankLinesymsz0(n='!=' | '==' | 'is' | n=comp_op< 'is' 'not' >)z(power< 'type' trailer< '(' x=any ')' > >c	XeZdZdZdedededed	ZfdZdZdZ	d	Z
d
ZxZS)	FixIdiomsTz 
        isinstance=comparison<  z8 T=any >
        |
        isinstance=comparison< T=any aX >
        |
        while_stmt< 'while' while='1' ':' any+ >
        |
        sorted=any<
            any*
            simple_stmt<
              expr_stmt< id1=any '='
                         power< list='list' trailer< '(' (not arglist<any+>) any ')' > >
              >
              '\n'
            >
            sort=
            simple_stmt<
              power< id2=any
                     trailer< '.' 'sort' > trailer< '(' ')' >
              >
              '\n'
            >
            next=any*
        >
        |
        sorted=any<
            any*
            simple_stmt< expr_stmt< id1=any '=' expr=any > '\n' >
            sort=
            simple_stmt<
              power< id2=any
                     trailer< '.' 'sort' > trailer< '(' ')' >
              >
              '\n'
            >
            next=any*
        >
    ctt||}|rd|vr|d|dkr|SdS|S)Nsortedid1id2)superrmatch)selfnoder	__class__s   L/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/lib2to3/fixes/fix_idioms.pyrzFixIdioms.matchOsT)T""((..
	Qx1U8##4cd|vr|||Sd|vr|||Sd|vr|||Std)N
isinstancewhilerz
Invalid match)transform_isinstancetransform_whiletransform_sortRuntimeError)rrresultss   r	transformzFixIdioms.transformZss7"",,T7;;;


''g666

 
 &&tW555///rcb|d}|d}d|_d|_ttd|t	|g}d|vr0d|_ttjtd|g}|j|_|S)NxTrrnnot)cloneprefixrrrrr	not_test)rrr r#r$tests      rrzFixIdioms.transform_isinstancedsCL  CL  D&&EGGQ88'>>DK
UT':;;Dkrch|d}|td|jdS)NrTruer))replacerr))rrr ones    rrzFixIdioms.transform_whileps3gD
33344444rc|d}|d}|d}|d}|r*|td|jne|rT|}d|_|ttd|g|jnt
d||j}d	|vr|rJ|d	d
|d
jf}	d		|	|d
_dSt}
|j|
|d	d
|
_dSdS)Nsortnextlistexprrr.r%zshould not have reached here
)
getr/rr)r(rrremove
rpartitionjoinrparentappend_child)rrr 	sort_stmt	next_stmt	list_callsimple_exprnewbtwnprefix_linesend_lines           rrzFixIdioms.transform_sorttsFO	FO	KK''	kk&))	?d8I4DEEEFFFF
	?##%%CCJT(^^cU,7,>!@!@!@
A
A
A
A=>>>4<<
;!% 5 5a 8)A,:MN&*ii&=&=	!###
%;; --h777#'//$"7"7":!<r)
__name__
__module____qualname__explicitTYPECMPPATTERNrr!rrr
__classcell__)rs@rrr%sHHN44ccc444K%!GN					000


555$;$;$;$;$;$;$;rrN)__doc__r%r
fixer_utilrrrrrr	rKrJBaseFixrrr<module>rRs<AAAAAAAAAAAAAAAA81s;s;s;s;s;
"s;s;s;s;s;r