File: //lib/python3/dist-packages/libfuturize/fixes/__pycache__/fix_UserDict.cpython-310.pyc
o
,�] � @ sP d Z ddlmZ ddlmZmZ ddlmZmZm Z ddiZ
G dd� de �Zd S )
zCFix UserDict.
Incomplete!
TODO: base this on fix_urllib perhaps?
� )�
fixer_base)�Name�
attr_chain)�
alternates�
build_pattern�
FixImports�UserDict�collectionsc sT e Zd ZdZdZeZdZdd� Z� fdd�Z � fdd�Z
� fd d
�Zdd� Z� Z
S )
�FixUserdictT� c C s d� t| j��S )N�|)�joinr �mapping��self� r �@/usr/lib/python3/dist-packages/libfuturize/fixes/fix_UserDict.pyr 5 s zFixUserdict.build_patternc s | � � | _tt| ��� d S �N)r �PATTERN�superr �compile_patternr �� __class__r r r 8 s
zFixUserdict.compile_patternc sH t t| �j� � |�}|r"d|vr t� fdd�t|d�D ��r dS |S dS )N�bare_with_attrc 3 s � | ]}� |�V qd S r r )�.0�obj��matchr r � <genexpr>F s � z$FixUserdict.match.<locals>.<genexpr>�parentF)r r r �anyr )r �node�resultsr r r r ? s �zFixUserdict.matchc s t t| ��||� i | _d S r )r r �
start_tree�replace)r �tree�filenamer r r r# K s
zFixUserdict.start_treec C s� |� d�}|r;|j}t| j| �}|�t||jd�� d|v r$|| j|<