관리-도구
편집 파일: fix_isinstance.cpython-312.pyc
� �Q�fH � �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 s�C||dz j t j k( s�gt |� �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 )N�args� ���� )�set�children� enumerate�typer �NAME�value�len�COMMA�next�append�add�parent�prefix�replace�changed)�self�node�results�names_inserted�testlistr �new_args�iterator�idx�arg�atoms �C/opt/alt/python312/lib64/python3.12/lib2to3/fixes/fix_isinstance.py� transformzFixIsinstance.transform s � �����6�?��� � �����T�?�� �H�C���x�x�5�:�:�%�#�)�)�~�*E���T��Q��&�4��a��=�+=�+=����+L���N������$��8�8�u�z�z�)�"�&�&�s�y�y�1� !� ����)�)�U�[�[�8�����x�=�A���?�?�D�!%���H�Q�K���L�L��!��%��D��G��L�L�N� N)�__name__� __module__�__qualname__� BM_compatible�PATTERN� run_orderr'