o
    ýÑÐb  ã                   @   s¨   d Z ddlmZ ddlmZ dd„ Zdd„ Zdd	„ Zd
d„ Zdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ ZG dd„ deƒZdd„ Zd d!„ Zd"d#„ Zd$S )%z*Check possible unbalanced tuple unpacking é    )Úabsolute_import©Úunpackc                  C   ó   d\} }| | S ©úThis is not right.)é   é   é   © ©ÚfirstÚsecondr   r   úp/var/www/secure340b-portal/env/lib/python3.10/site-packages/pylint/test/functional/unbalanced_tuple_unpacking.pyÚdo_stuff   ó   r   c                  C   s   g d¢\} }| | S r   r   r   r   r   r   Ú	do_stuff1   ó   r   c                  C   r   r   r   r   r   r   r   Ú	do_stuff2   r   r   c                  C   s   t dƒ\} }| | S )r   éd   )Úranger   r   r   r   Ú	do_stuff3   r   r   c                  C   r   ©z This is right ©r   r	   r   r   r   r   r   Ú	do_stuff4   r   r   c                  C   r   )z This is also right r   r   r   r   r   r   Ú	do_stuff5    r   r   c                  C   r   r   r   r   r   r   r   Ú	do_stuff6%   r   r   c                   C   s
   	 ddgS )z This is not weird Tr   r	   r   r   r   r   r   Útemp*   s   r   c                  C   ó   t ƒ \} }| | S )z' This is not right, but we're not sure )r   r   r   r   r   Ú	do_stuff70   ó   
r   c                   C   s   	 dS )z This is weird, but correct Tr   r   r   r   r   r   Útemp25   s   r!   c                  C   r   )z This is correct )r!   r   r   r   r   Ú	do_stuff8>   r    r"   c                  C   r   )z This is not correct r   r   r   r   r   Ú	do_stuff9C   r    r#   c                   @   s   e Zd ZdZdd„ ZdS )ÚUnbalancedUnpackingz9 Test unbalanced tuple unpacking in instance attributes. c                 C   s.   t ƒ \| _| _tƒ \| _| _tƒ \| _| _dS )z" unpacking in instance attributes N)r   ÚaÚbr!   r   )Úselfr   r   r   ÚtestK   s   zUnbalancedUnpacking.testN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r(   r   r   r   r   r$   H   s    r$   c                  G   s   | \}}}|||fS )z¥ Don't emit unbalanced tuple unpacking if the
    rhs of the assignment is a variable-length argument,
    because we don't know the actual length of the tuple.
    r   )Úargsr   r   Úthirdr   r   r   Úissue329T   s   

r/   c                  C   s,   ddl m}  | dƒ}| ¡ \}}}|||fS )zzTest a false positive with decimal.Decimal.as_tuple

    See astroid https://bitbucket.org/logilab/astroid/issues/92/
    r   )ÚDecimalr	   )Údecimalr0   Úas_tuple)r0   Údecr   r   r.   r   r   r   Útest_decimal]   s   
r4   c                  C   s,   ddl m}  | ƒ gd \}}}}||||fS )z;Test that we don't have a false positive wrt to issue #559.r   )Úc_inté   )Úctypesr5   )r5   Zroot_xZroot_yZwin_xZwin_yr   r   r   Útest_issue_559h   s   r8   N)r,   Ú
__future__r   Zfunctional.unpackingr   r   r   r   r   r   r   r   r   r   r!   r"   r#   Úobjectr$   r/   r4   r8   r   r   r   r   Ú<module>   s&    		