
    i                    v    d Z ddlmZ ddlmZmZ ddlmZ ddlm	Z	 ddl
mZ  ed       G d d	e	e             Zy
)zj
frozen (immutable) data structures to support MultiIndexing

These are used for:

- .names (FrozenList)

    )annotations)NoReturnSelf)
set_module)PandasObjectpprint_thingzpandas.api.typingc                       e Zd ZdZd fdZddZexZZ fdZddZ	d fdZ
e
Zd fdZeZd Zdd	Zdd
ZddZddZexZZexZZexZxZZexZxZZ xZS )
FrozenListz
    Container that doesn't allow setting item *but*
    because it's technically hashable, will be used
    for lookups, appropriately, etc.
    c                v    t        |t              rt        |      } t        |       t        |   |            S )aF  
        Returns a FrozenList with other concatenated to the end of self.

        Parameters
        ----------
        other : array-like
            The array-like whose elements we are concatenating.

        Returns
        -------
        FrozenList
            The collection difference between self and other.
        )
isinstancetuplelisttypesuper__add__selfother	__class__s     W/app/cer_product_mecsu/.venv/lib/python3.12/site-packages/pandas/core/indexes/frozen.pyunionzFrozenList.union#   s2     eU#KEtDz%'/%011    c                l    t        |      }| D cg c]	  }||vs| }} t        |       |      S c c}w )aF  
        Returns a FrozenList with elements from other removed from self.

        Parameters
        ----------
        other : array-like
            The array-like whose elements we are removing self.

        Returns
        -------
        FrozenList
            The collection difference between self and other.
        )setr   )r   r   xtemps       r   
differencezFrozenList.difference5   s<     E
2a1E>22tDz$ 3s   	11c                ~    t        |t              r t        |       t        |   |            S t        |   |      S N)r   slicer   r   __getitem__)r   nr   s     r   r"   zFrozenList.__getitem__K   s8    a4:eg1!455w"1%%r   c                r    t        |t              rt        |      } t        |       |t        |       z         S r    )r   r   r   r   )r   r   s     r   __radd__zFrozenList.__radd__P   s/    eU#KEtDz%$t*,--r   c                d    t        |t        t        f      rt        |      }t        |   |      S r    )r   r   r   r   r   __eq__r   s     r   r'   zFrozenList.__eq__U   s*    eeZ01KEw~e$$r   c                @     t        |       t        | 	  |            S r    )r   r   __mul__r   s     r   r)   zFrozenList.__mul__\   s    tDz%'/%011r   c                0    t        |       t        |       ffS r    )r   r   r   s    r   
__reduce__zFrozenList.__reduce__a   s    DzDJ=((r   c                *    t        t        |             S r    )hashr   r+   s    r   __hash__zFrozenList.__hash__e   s    E$K  r   c                F    t        dt        |       j                   d      )zL
        This method will not function because object is immutable.
        'z&' does not support mutable operations.)	TypeErrorr   __name__)r   argskwargss      r   	_disabledzFrozenList._disabledh   s$     !DJ//00VWXXr   c                    t        | dd      S )NT)	
r1   )quote_stringsescape_charsr   r+   s    r   __str__zFrozenList.__str__n   s    3J
 	
r   c                8    t        |       j                   d| dS )N())r   r3   r+   s    r   __repr__zFrozenList.__repr__s   s     t*%%&axq11r   )returnr   )rB   r   )r   objectrB   bool)rB   int)rB   r   )rB   str)r3   
__module____qualname____doc__r   r   r   __iadd__r"   r%   r'   __req__r)   __imul__r,   r/   r6   r=   rA   __setitem____setslice____delitem____delslice__popappendextendremovesortinsert__classcell__)r   s   @r   r   r      s    2$ ( Gh&
.
%
 G2 H)!Y

2 "+*K,!**K,%%C%&6&&F&TFr   r   N)rI   
__future__r   typingr   r   pandas.util._decoratorsr   pandas.core.baser   pandas.io.formats.printingr	   r   r    r   r   <module>r^      sE    #
 / ) 3  `'t `' !`'r   