3
���h � @ s. d Z ddlZddlZdd� Zed�dd�ZdS )z#
Templates for invalid operations.
� Nc C s\ |t jkrtj| jtd�}n<|t jkr8tj| jtd�}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�np�zeros�shape�bool�neZones�type�__name__� TypeErrorr )�left�right�opZ
res_values�typ� r �9/tmp/pip-build-5_djhm0z/pandas/pandas/core/ops/invalid.py�invalid_comparison s
r )�namec s d� fdd� }� |_ |S )z�
Return a binary method that always raises a TypeError.
Parameters
----------
name : str
Returns
-------
invalid_op : function
Nc s" |