o
    թZh"                     @   sD   d Z ddlZddlmZmZ ddlmZ G dd deZ	dd Z
dS )z)
Tests involving custom Index subclasses
    N)	DataFrameIndexc                   @   s   e Zd ZdddZdS )CustomIndexNc                 C   sL   t dd |D rtd|d u rt|dr|j}tj|dd}| ||S )Nc                 s   s    | ]}t |tV  qd S N)
isinstancestr).0val r
   Y/var/www/html/lang_env/lib/python3.10/site-packages/pandas/tests/indexes/test_subclass.py	<genexpr>   s    z&CustomIndex.__new__.<locals>.<genexpr>zCustomIndex cannot hold stringsnameOZdtype)any	TypeErrorhasattrr   nparrayZ_simple_new)clsdatar   r
   r
   r   __new__   s   zCustomIndex.__new__r   )__name__
__module____qualname__r   r
   r
   r
   r   r      s    r   c                  C   sv   t g d} | dd}tg dtd}t|| ttj	d
d| tddgdd	d
}| }t|j| d S )N)         r   string)r   r   r   r   r   r   )r   r   r   )r   )columnsindex)r   insertr   objecttmZassert_index_equalr   r   randomZdefault_rngZstandard_normalZreset_indexr   )idxresultexpecteddfr
   r
   r   "test_insert_fallback_to_base_index   s   r)   )__doc__numpyr   Zpandasr   r   Zpandas._testingZ_testingr#   r   r)   r
   r
   r
   r   <module>   s    