o
    ¹­§iõ  ã                   @  s†   d dl mZ d dlmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ er8d dlmZ d dlmZ d d	lmZ eG d
d„ dƒƒZdS )é    )Úannotations)ÚTYPE_CHECKING)Ú	datatypes)Úunstable)Úwrap_s)Úexpr_dispatch)ÚSeries)ÚPySeries)ÚPolarsDataTypec                   @  s>   e Zd ZdZdZddd„Zeƒ ddd„ƒZeƒ ddd„ƒZdS )ÚExtensionNameSpacezSeries.ext namespace.ÚextÚseriesr   ÚreturnÚNonec                 C  s   |j | _ d S )N)Ú_s)Úselfr   © r   úH/home/app/Keep/.python/lib/python3.10/site-packages/polars/series/ext.pyÚ__init__   s   zExtensionNameSpace.__init__Údtyper
   c                 C  s    t |tjƒsJ ‚t| j |¡ƒS )a>  
        Create a Series with an extension `dtype`.

        The input series must have the storage type of the extension dtype.

        .. warning::
            This functionality is currently considered **unstable**. It may be
            changed at any point without it being considered a breaking change.
        )Ú
isinstanceÚdtZBaseExtensionr   r   Zext_to)r   r   r   r   r   Úto   s   zExtensionNameSpace.toc                 C  s   t | j ¡ ƒS )a_  
        Get the storage values of a Series with an extension data type.

        If the input series does not have an extension data type, it is returned as-is.

        .. warning::
            This functionality is currently considered **unstable**. It may be
            changed at any point without it being considered a breaking change.
        )r   r   Zext_storage)r   r   r   r   Ústorage)   s   zExtensionNameSpace.storageN)r   r   r   r   )r   r
   r   r   )r   r   )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	_accessorr   r   r   r   r   r   r   r   r      s    
r   N)Ú
__future__r   Útypingr   Zpolarsr   r   Zpolars._utils.unstabler   Zpolars._utils.wrapr   Zpolars.series.utilsr   r   Zpolars._plrr	   Zpolars._typingr
   r   r   r   r   r   Ú<module>   s    