o
    ŀg                     @  s^   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 deeZd	S )
zj
frozen (immutable) data structures to support MultiIndexing

These are used for:

- .names (FrozenList)

    )annotations)TYPE_CHECKINGNoReturn)PandasObjectpprint_thing)Selfc                      s   e Zd ZdZd  fddZd ddZe ZZ fddZd!d
dZ	d" fddZ
e
Zd! fddZeZdd Zd#ddZd$ddZd%ddZd%ddZe ZZe ZZe Z ZZe Z ZZ  ZS )&
FrozenListz
    Container that doesn't allow setting item *but*
    because it's technically hashable, will be used
    for lookups, appropriately, etc.
    returnc                   s&   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__ N/var/www/html/myenv/lib/python3.10/site-packages/pandas/core/indexes/frozen.pyunion"   s   
zFrozenList.unionc                   s&   t    fdd| D }t| |S )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.
        c                   s   g | ]}| vr|qS r   r   ).0xr   r   r   
<listcomp>C   s    z)FrozenList.difference.<locals>.<listcomp>)setr   )r   r   tempr   r   r   
difference4   s   zFrozenList.differencec                   s*   t |trt| t |S t |S N)r   slicer   r   __getitem__)r   nr   r   r   r"   L   s   
zFrozenList.__getitem__r   c                 C  s&   t |tr	t|}t| |t|  S r    )r   r   r   r   r   r   r   r   __radd__Q   s   
zFrozenList.__radd__r   objectboolc                   s"   t |ttfrt|}t |S r    )r   r   r	   r   r   __eq__r   r   r   r   r'   V   s   zFrozenList.__eq__c                   s   t | t |S r    )r   r   __mul__r   r   r   r   r(   ]   s   zFrozenList.__mul__c                 C  s   t | t| ffS r    )r   r   r   r   r   r   
__reduce__b   s   zFrozenList.__reduce__intc                 C  s   t t| S r    )hashr   r)   r   r   r   __hash__f   s   zFrozenList.__hash__r   c                 O  s   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kwargsr   r   r   	_disabledi   s   zFrozenList._disabledstrc                 C  s   t | dddS )NT)	
)quote_stringsescape_charsr   r)   r   r   r   __str__o   s   zFrozenList.__str__c                 C  s   t | j dt|  dS )N())r   r0   r4   r)   r   r   r   __repr__r   s   zFrozenList.__repr__)r
   r	   )r
   r   )r   r%   r
   r&   )r
   r+   )r
   r   )r
   r4   )r0   
__module____qualname____doc__r   r   r   __iadd__r"   r$   r'   __req__r(   __imul__r*   r-   r3   r:   r=   __setitem____setslice____delitem____delslice__popappendextendremovesortinsert__classcell__r   r   r   r   r	      s(    	





r	   N)r@   
__future__r   typingr   r   pandas.core.baser   pandas.io.formats.printingr   pandas._typingr   r   r	   r   r   r   r   <module>   s    