o
    �¨Êhš  ã                   @  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__© úL/var/www/html/env/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    