관리-도구
편집 파일: fix_xrange.cpython-33.pyc
� ��f� c @ s_ d Z d d l m Z d d l m Z m Z m Z d d l m Z Gd d � d e j � Z d S( u/ Fixer that changes xrange(...) into range(...).i ( u fixer_base( u Nameu Callu consuming_calls( u patcompc s� | Ee Z d Z d Z d Z � f d d � Z d d � Z d d � Z d d � Z d d � Z d Z e j e � Z d Z e j e � Z d d � Z � S( u FixXrangeu� power< (name='range'|name='xrange') trailer< '(' args=any ')' > rest=any* > c s) t t | � j | | � t � | _ d S( N( u superu FixXrangeu start_treeu setu transformed_xranges( u selfu treeu filename( u __class__( u= /opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_xrange.pyu start_tree s u FixXrange.start_treec C s d | _ d S( N( u Noneu transformed_xranges( u selfu treeu filename( ( u= /opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_xrange.pyu finish_tree s u FixXrange.finish_treec C s^ | d } | j d k r) | j | | � S| j d k rH | j | | � St t | � � � d S( Nu nameu xrangeu range( u valueu transform_xrangeu transform_rangeu ValueErroru repr( u selfu nodeu resultsu name( ( u= /opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_xrange.pyu transform s u FixXrange.transformc C s@ | d } | j t d d | j �� | j j t | � � d S( Nu nameu rangeu prefix( u replaceu Nameu prefixu transformed_xrangesu addu id( u selfu nodeu resultsu name( ( u= /opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_xrange.pyu transform_xrange$ s u FixXrange.transform_xrangec C s� t | � | j k r� | j | � r� t t d � | d j � g � } t t d � | g d | j �} x | d D] } | j | � qs W| Sd S( Nu rangeu argsu listu prefixu rest( u idu transformed_xrangesu in_special_contextu Callu Nameu cloneu prefixu append_child( u selfu nodeu resultsu range_callu list_callu n( ( u= /opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_xrange.pyu transform_range* s "u FixXrange.transform_rangeu3 power< func=NAME trailer< '(' node=any ')' > any* >u� for_stmt< 'for' any 'in' node=any ':' any* > | comp_for< 'for' any 'in' node=any any* > | comparison< any 'in' node=any any*> c C s� | j d k r d Si } | j j d k rg | j j | j j | � rg | d | k rg | d j t k S| j j | j | � o� | d | k S( Nu nodeu funcF( u parentu Noneu Falseu p1u matchu valueu consuming_callsu p2( u selfu nodeu results( ( u= /opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_xrange.pyu in_special_context? s u FixXrange.in_special_contextT( u __name__u __module__u __qualname__u Trueu BM_compatibleu PATTERNu start_treeu finish_treeu transformu transform_xrangeu transform_rangeu P1u patcompu compile_patternu p1u P2u p2u in_special_context( u __locals__( ( u __class__u= /opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_xrange.pyu FixXrange s u FixXrangeN( u __doc__u u fixer_baseu fixer_utilu Nameu Callu consuming_callsu patcompu BaseFixu FixXrange( ( ( u= /opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_xrange.pyu <module> s