B
    W0d                 @   s.   d Z ddlZddlZdd ZedddZdS )z#
Templates for invalid operations.
    Nc             C   s\   |t jkrtj| jtd}n<|t jkr8tj| jtd}n t|j	}t
d| j d| |S )a  
    If a comparison has mismatched types and is not necessarily meaningful,
    follow python3 conventions by:

        - returning all-False for equality
        - returning all-True for inequality
        - raising TypeError otherwise

    Parameters
    ----------
    left : array-like
    right : scalar, array-like
    op : operator.{eq, ne, lt, le, gt}

    Raises
    ------
    TypeError : on inequality comparisons
    )dtypez!Invalid comparison between dtype=z and )operatoreqnpZzerosshapeboolneZonestype__name__	TypeErrorr   )leftrightopZ
res_valuestyp r   I/var/www/html/venv/lib/python3.7/site-packages/pandas/core/ops/invalid.pyinvalid_comparison	   s    


r   )namec                s   d fdd	} |_ |S )z
    Return a binary method that always raises a TypeError.

    Parameters
    ----------
    name : str

    Returns
    -------
    invalid_op : function
    Nc                s"   t | j}td  d| d S )Nzcannot perform z with this index type: )r	   r
   r   )selfotherr   )r   r   r   
invalid_op3   s    
z#make_invalid_op.<locals>.invalid_op)N)r
   )r   r   r   )r   r   make_invalid_op&   s    r   )__doc__r   numpyr   r   strr   r   r   r   r   <module>   s   