Your IP : 216.73.216.74


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.opt-1.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�.Zastroid)�	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'Z__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)rr.r/r0rrr	�__init__Hsz!BadUnaryOperationMessage.__init__cCstd�}|jS)N�helpers)r�object_type)rr2rrr	�_object_type_helperMsz,BadUnaryOperationMessage._object_type_helpercCs|�|�}|tkrdS|S)N)r4r)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 {}: {})�hasattrr.r#r5Z	as_string�formatr/)rZoperand_typer3�msgrrr	r+Zs

z BadUnaryOperationMessage.__str__N)	r
rrr*r1�propertyr4r5r+rrrr	r-Es
r-c@s eZdZdZdd�Zdd�ZdS)�BadBinaryOperationMessagez.Object which describes type errors for BinOps.cCs||_||_||_dS)N)�	left_type�
right_typer/)rr;r/r<rrr	r1lsz"BadBinaryOperationMessage.__init__cCsd}|�|j|jj|jj�S)Nz1unsupported operand type(s) for {}: {!r} and {!r})r7r/r;r#r<)rr8rrr	r+qsz!BadBinaryOperationMessage.__str__N)r
rrr*r1r+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	�_instancecheckvsrGcs,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__rG)Z
alias_namerI�proxyr)rIr	�proxy_alias�s
rMccs0t||�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

rP)rA�	itertoolsrrrrrr!�__new__rr,r-r:rGrMrPrrrr	�<module>	s$