a
    Of                     @  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rHd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 d fddZd dddZe ZZ fddZd	dd
dZ	ddd fddZ
e
Zd	d fddZeZdd ZddddZddddZddddZd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__ S/var/www/ai-form-bot/venv/lib/python3.9/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       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__objectbool)r   r
   c                   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dS )zL
        This method will not function because object is immutable.
        'z&' does not support mutable operations.N)	TypeErrorr   __name__)r   argskwargsr   r   r   	_disabledi   s    zFrozenList._disabledstrc                 C  s   t | dddS )NT)	
)Zquote_stringsZescape_charsr   r*   r   r   r   __str__o   s    zFrozenList.__str__c                 C  s   t | j dt|  dS )N())r   r1   r5   r*   r   r   r   __repr__r   s    zFrozenList.__repr__)r1   
__module____qualname____doc__r   r    r   __iadd__r#   r%   r(   Z__req__r)   __imul__r+   r.   r4   r9   r<   __setitem__Z__setslice____delitem__Z__delslice__popappendextendremovesortinsert__classcell__r   r   r   r   r	      s&   	r	   N)r?   
__future__r   typingr   r   Zpandas.core.baser   Zpandas.io.formats.printingr   Zpandas._typingr   r   r	   r   r   r   r   <module>   s   