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

These are used for:

- .names (FrozenList)

    )annotations)TYPE_CHECKINGNoReturn)PandasObjectpprint_thing)Selfc                       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     Q/var/www/horilla/myenv/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.difference4   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__L   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__Q   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__V   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__b   s    DzDJ=((r   c                *    t        t        |             S r    )hashr   r+   s    r   __hash__zFrozenList.__hash__f   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._disabledi   s$     !DJ//00VWXXr   c                    t        | dd      S )NT)	
)quote_stringsescape_charsr   r+   s    r   __str__zFrozenList.__str__o   s    DCUVVr   c                J    t        |       j                   dt        |        dS )N())r   r3   strr+   s    r   __repr__zFrozenList.__repr__r   s$    t*%%&aD	{!44r   )returnr   )rC   r	   )r   objectrC   bool)rC   int)rC   r   )rC   rA   )r3   
__module____qualname____doc__r   r   r   __iadd__r"   r%   r'   __req__r)   __imul__r,   r/   r6   r=   rB   __setitem____setslice____delitem____delslice__popappendextendremovesortinsert__classcell__)r   s   @r   r   r      s    2$ , Gh&
.
%
 G2 H)!YW5 "+*K,!**K,%%C%&6&&F&TFr   r   N)rI   
__future__r   typingr   r   pandas.core.baser   pandas.io.formats.printingr   pandas._typingr	   r   r    r   r   <module>r^      s2    #
 * 3#`'t `'r   