a
    DBìjš  ã                   @  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__© úY/mnt/bigstor/www/usecases/.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   