/usr/lib/python3.10/lib2to3/fixes/__pycache__
NameSizeModeActions
fix_apply.cpython-310.pyc16520644editdlrm
fix_asserts.cpython-310.pyc12770644editdlrm
fix_basestring.cpython-310.pyc6610644editdlrm
fix_buffer.cpython-310.pyc8060644editdlrm
fix_dict.cpython-310.pyc32870644editdlrm
fix_except.cpython-310.pyc27720644editdlrm
fix_exec.cpython-310.pyc11310644editdlrm
fix_execfile.cpython-310.pyc16770644editdlrm
fix_exitfunc.cpython-310.pyc23060644editdlrm
fix_filter.cpython-310.pyc24400644editdlrm
fix_funcattrs.cpython-310.pyc9740644editdlrm
fix_future.cpython-310.pyc7820644editdlrm
fix_getcwdu.cpython-310.pyc7860644editdlrm
fix_has_key.cpython-310.pyc28770644editdlrm
fix_idioms.cpython-310.pyc39050644editdlrm
fix_import.cpython-310.pyc28110644editdlrm
fix_imports.cpython-310.pyc46270644editdlrm
fix_imports2.cpython-310.pyc5440644editdlrm
fix_input.cpython-310.pyc9480644editdlrm
fix_intern.cpython-310.pyc11300644editdlrm
fix_isinstance.cpython-310.pyc15550644editdlrm
fix_itertools.cpython-310.pyc15460644editdlrm
fix_itertools_imports.cpython-310.pyc15660644editdlrm
fix_long.cpython-310.pyc7090644editdlrm
fix_map.cpython-310.pyc30750644editdlrm
fix_metaclass.cpython-310.pyc54050644editdlrm
fix_methodattrs.cpython-310.pyc9360644editdlrm
fix_ne.cpython-310.pyc8090644editdlrm
fix_next.cpython-310.pyc30770644editdlrm
fix_nonzero.cpython-310.pyc9210644editdlrm
fix_numliterals.cpython-310.pyc10210644editdlrm
fix_operator.cpython-310.pyc41520644editdlrm
fix_paren.cpython-310.pyc13870644editdlrm
fix_print.cpython-310.pyc23090644editdlrm
fix_raise.cpython-310.pyc22490644editdlrm
fix_raw_input.cpython-310.pyc7930644editdlrm
fix_reduce.cpython-310.pyc11260644editdlrm
fix_reload.cpython-310.pyc11420644editdlrm
fix_renames.cpython-310.pyc20250644editdlrm
fix_repr.cpython-310.pyc8430644editdlrm
fix_set_literal.cpython-310.pyc16830644editdlrm
fix_standarderror.cpython-310.pyc7180644editdlrm
fix_sys_exc.cpython-310.pyc14110644editdlrm
fix_throw.cpython-310.pyc18060644editdlrm
fix_tuple_params.cpython-310.pyc45890644editdlrm
fix_types.cpython-310.pyc19410644editdlrm
fix_unicode.cpython-310.pyc15530644editdlrm
fix_urllib.cpython-310.pyc58800644editdlrm
fix_ws_comma.cpython-310.pyc11170644editdlrm
fix_xrange.cpython-310.pyc25270644editdlrm
fix_xreadlines.cpython-310.pyc11210644editdlrm
fix_zip.cpython-310.pyc15790644editdlrm
__init__.cpython-310.pyc1380644editdlrm
Edit: /usr/lib/python3.10/lib2to3/fixes/__pycache__/fix_metaclass.cpython-310.pyc (5405B)
o bc @svdZddlmZddlmZddlmZmZmZddZ ddZ d d Z d d Z d dZ ddZGdddejZdS)aFixer for __metaclass__ = X -> (metaclass=X) methods. The various forms of classef (inherits nothing, inherits once, inherits many) don't parse the same in the CST so we look at ALL classes for a __metaclass__ and if we find one normalize the inherits to all be an arglist. For one-liner classes ('class X: pass') there is no indent/dedent so we normalize those into having a suite. Moving the __metaclass__ into the classdef can also cause the class body to be empty so there is some special casing for that as well. This fixer also tries very hard to keep original indenting and spacing in all those corner cases. ) fixer_base)token)symsNodeLeafcCsz|jD]7}|jtjkrt|S|jtjkr:|jr:|jd}|jtjkr:|jr:|jd}t|tr:|j dkr:dSqdS)z we have to check the cls_node without changing it. There are two possibilities: 1) clsdef => suite => simple_stmt => expr_stmt => Leaf('__meta') 2) clsdef => simple_stmt => expr_stmt => Leaf('__meta') __metaclass__TF) childrentypersuite has_metaclass simple_stmt expr_stmt isinstancervalue)parentnode expr_node left_sider2/usr/lib/python3.10/lib2to3/fixes/fix_metaclass.pyr s       r cCs|jD] }|jtjkrdSqt|jD] \}}|jtjkr nqtdttjg}|j|ddrO|j|d}| | | |j|dds4| ||}dS)zf one-line classes don't get a suite in the parse tree so we add one to normalize the tree NzNo class suite and no ':'!) r r rr enumeraterCOLON ValueErrorr append_childcloneremove)cls_noderir move_noderrrfixup_parse_tree-s"     r!c Cst|jD] \}}|jtjkrnqdS|ttjg}ttj |g}|j|drC|j|}| | ||j|ds,| |||jdjd}|jdjd} | j |_ dS)z if there is a semi-colon all the parts count as part of the same simple_stmt. We just want the __metaclass__ part so we move everything after the semi-colon into its own simple_stmt node Nr)rr r rSEMIrrrrr rr insert_childprefix) rr stmt_nodesemi_indrnew_exprnew_stmtr new_leaf1 old_leaf1rrrfixup_simple_stmtGs"     r+cCs2|jr|jdjtjkr|jddSdSdS)N)r r rNEWLINEr)rrrrremove_trailing_newline_sr.ccs|jD] }|jtjkrnqtdtt|jD]:\}}|jtjkrT|jrT|jd}|jtjkrT|jrT|jd}t |t rT|j dkrTt |||t ||||fVqdS)NzNo class suite!rr)r r rr rlistrr rrrrr+r.)rrr simple_noder left_noderrr find_metasds$        r2cCs|jddd}|r|}|jtjkrn|s |r?|}t|tr0|jtjkr0|jr.d|_dS| |jddd|sdSdS)z If an INDENT is followed by a thing with a prefix then nuke the prefix Otherwise we get in trouble when removing __metaclass__ at suite start Nr,) r popr rINDENTrrDEDENTr$extend)r kidsrrrr fixup_indent{s  r9c@seZdZdZdZddZdS) FixMetaclassTz classdef cCsPt|sdSt|d}t|D] \}}}|}|q|jdj}t|jdkrM|jdjtjkr8|jd}nU|jd } t tj| g}| d|n@t|jdkrat tjg}| d|n,t|jdkrt tjg}| dt tjd| d|| dt tjdntd |jdjd} d | _| j} |jr|t tjd d | _nd | _|jd} | jtjksJd | jd_d | jd_||t||js|t |d} | | _|| |t tjddSt|jdkr"|jdjtjkr$|jdjtjkr&t |d} | d| | dt tjddSdSdSdS)Nrr)(zUnexpected class definition metaclass, r3rpass r,)r r!r2rr r lenrarglistrr set_childr#rrRPARLPARrrr$rCOMMArr9r-r5r6)selfrresultslast_metaclassr rstmt text_typerHrmeta_txtorig_meta_prefixr pass_leafrrr transformsf              zFixMetaclass.transformN)__name__ __module__ __qualname__ BM_compatiblePATTERNrUrrrrr:s r:N)__doc__r3rpygramr fixer_utilrrrr r!r+r.r2r9BaseFixr:rrrrs