Your IP : 216.73.216.196


Current Path : /opt/alt/python37/lib/python3.7/site-packages/astroid/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/astroid/__pycache__/util.cpython-37.pyc

B

��\��@s�ddlZddlmZddlZddlZdd�Zdd�ZejGdd�d��Z	Gd	d
�d
�Z
Gdd�de
�ZGd
d�de
�Zdd�Z
dd�Zdd�ZdS)�N)�islicecCsGdd�dtj�}||�S)Nc@seZdZddd�ZdS)z(lazy_descriptor.<locals>.DescriptorProxyNcSs|j�||�S)N)�	__class__�__get__)�self�instance�owner�r�=/opt/alt/python37/lib/python3.7/site-packages/astroid/util.pyrsz0lazy_descriptor.<locals>.DescriptorProxy.__get__)N)�__name__�
__module__�__qualname__rrrrr	�DescriptorProxysr
)�lazy_object_proxy�Proxy)�objr
rrr	�lazy_descriptorsrcst��fdd��S)Ncst�d�d�S)N�.�astroid)�	importlib�
import_moduler)�module_namerr	�<lambda>�zlazy_import.<locals>.<lambda>)rr)rr)rr	�lazy_importsrc@s@eZdZdZdd�ZeZdd�Zdd�Zdd	�ZeZ	d
d�Z
dS)
�UninferablezASpecial inference object, which is returned when inference fails.cCsdS)Nrr)rrrr	�__repr__"szUninferable.__repr__cCsH|dkrtd��|�d�r0|�d�r0t�||�S|dkrDt�||�S|S)N�nextz next method should not be called�__�accept)�AttributeError�
startswith�endswith�object�__getattribute__)r�namerrr	r#'szUninferable.__getattribute__cOs|S)Nr)r�args�kwargsrrr	�__call__0szUninferable.__call__cCsdS)NFr)rrrr	�__bool__3szUninferable.__bool__cCst|d�}||�S)NZvisit_uninferable)�getattr)rZvisitor�funcrrr	r8s
zUninferable.acceptN)r
rr�__doc__r�__str__r#r'r(�__nonzero__rrrrr	rs	rc@seZdZdZdS)�BadOperationMessagez�Object which describes a TypeError occurred somewhere in the inference chain

    This is not an exception, but a container object which holds the types and
    the error which occurred.
    N)r
rrr+rrrr	r.=sr.c@s4eZdZdZdd�Zedd��Zdd�Zdd	�Zd
S)�BadUnaryOperationMessagez8Object which describes operational failures on UnaryOps.cCs||_||_||_dS)N)�operand�op�error)rr0r1r2rrr	�__init__Hsz!BadUnaryOperationMessage.__init__cCstd�}|jS)N�helpers)r�object_type)rr4rrr	�_object_type_helperMsz,BadUnaryOperationMessage._object_type_helpercCs|�|�}|tkrdS|S)N)r6r)rrZobjtyperrr	�_object_typeRs
z%BadUnaryOperationMessage._object_typecCsNt|jd�r|jj}n&|�|j�}t|d�r4|j}n|��}d}|�|j|�S)Nr$z!bad operand type for unary {}: {})�hasattrr0r$r7�	as_string�formatr1)rZoperand_typer5�msgrrr	r,Zs

z BadUnaryOperationMessage.__str__N)	r
rrr+r3�propertyr6r7r,rrrr	r/Es
r/c@s eZdZdZdd�Zdd�ZdS)�BadBinaryOperationMessagez.Object which describes type errors for BinOps.cCs||_||_||_dS)N)�	left_type�
right_typer1)rr>r1r?rrr	r3lsz"BadBinaryOperationMessage.__init__cCsd}|�|j|jj|jj�S)Nz1unsupported operand type(s) for {}: {!r} and {!r})r:r1r>r$r?)rr;rrr	r,qsz!BadBinaryOperationMessage.__str__N)r
rrr+r3r,rrrr	r=isr=cCs@|j}|j}||kpt||�}tjd|jj|jftdd�|S)NzF%r is deprecated and slated for removal in astroid 2.0, use %r instead�)�
stacklevel)�__wrapped__r�
issubclass�warnings�warnr
�PendingDeprecationWarning)�cls�other�wrappedZ	other_clsZis_instance_ofrrr	�_instancecheckvsrJcs,t|tjftjdtd��}|�fdd��S)z7Get a Proxy from the given name to the given node type.r)r�__instancecheck__cs�S)Nrr)�	node_typerr	r�rzproxy_alias.<locals>.<lambda>)�typerrr"�__dict__rJ)Z
alias_namerL�proxyr)rLr	�proxy_alias�s
rPccs0t||�EdHt|d�}|dk	r,tVdSdS)a�Limit inference amount.

    Limit inference amount to help with performance issues with
    exponentially exploding possible results.

    :param iterator: Inference generator to limit
    :type iterator: Iterator(NodeNG)

    :param size: Maximum mount of nodes yielded plus an
        Uninferable at the end if limit reached
    :type size: int

    :yields: A possibly modified generator
    :rtype param: Iterable
    NF)rrr)�iterator�sizeZhas_morerrr	�limit_inference�s

rS)rD�	itertoolsrrrrrr"�__new__rr.r/r=rJrPrSrrrr	�<module>	s$