관리-도구
편집 파일: fix_unpacking.cpython-37.pyc
B �A�[: � @ s~ d Z ddlmZ ddlmZ ddlmZmZmZm Z m Z mZmZm Z mZmZ ddlmZmZmZ dd� ZG dd � d ej�Zd S )zD Fixer for: (a,)* *b (,c)* [,] = s for (a,)* *b (,c)* [,] in d: ... � )� fixer_base)�count) �Assign�Comma�Call�Newline�Name�Number�token�syms�Node�Leaf)�indentation�suitify� commatizec C s� g }t | �}t |�}| dkr�ttjt|�ttjttjd�ttj ttj d�t|�g�ttjd�g�g�}|� |� |� ttjddd�� ttjttjddd�t|�ttjttjd�ttj | dkr�t|�ntdd �ttj d�|dkr�ttjttjd �t|�g�ntdd �g�ttjd�ttjd�g�g�}|� |� |dk�r�|� ttjddd�� ttjt|dd�ttjttjd�ttj ttjttjd �t|�g�ttj d�g�ttjd�g�g�} |� | � ttj|�} | S )z� Accepts num_pre and num_post, which are counts of values before and after the starg (not including the starg) Returns a source fit for Assign() from fixer_util r �[�:�]�+� )�prefix� � �-)�unicoder r Zpowerr �trailerr r �LSQBZ subscript�COLONr �RSQB�append�PLUSZfactor�MINUSZ arith_expr)Znum_preZnum_post�LISTNAME�ITERNAME�children�pre�postZpre_partZ main_partZ post_part�source� r( �R/opt/alt/python37/lib/python3.7/site-packages/libpasteurize/fixes/fix_unpacking.py�assignment_source s J � b r* c @ s( e Zd ZdZdd� Zdd� Zdd� ZdS ) �FixUnpackinga9 expl=expr_stmt< testlist_star_expr< pre=(any ',')* star_expr< '*' name=NAME > post=(',' any)* [','] > '=' source=any > | impl=for_stmt< 'for' lst=exprlist< pre=(any ',')* star_expr< '*' name=NAME > post=(',' any)* [','] > 'in' it=any ':' suite=any>c s� � fdd�dD �\}}}}dd� |D �}d|_ dd� |D �}dd� t||�� g | �D �}|�t� � d |_ tt| j�ttd �|�� g��}t|t t |�t |�| j| j��} || fS )Nc 3 s | ]}� � |�V qd S )N)�get)�.0�n)�resultsr( r) � <genexpr>3 s z4FixUnpacking.fix_explicit_context.<locals>.<genexpr>)r% �namer&