U
    ç;ãg  ã                   @   sž   d Z ddlZddlmZ ddlmZmZmZmZm	Z	m
Z
mZmZmZmZ dZejdkrdddlmZ neZedƒZG d	d
„ d
e
ee ƒZG dd„ dee ƒZdS )zVarious helper functions.é    N)Úcached_property)
ÚAnyÚCallableÚDictÚGenericÚOptionalÚProtocolÚTypeÚTypeVarÚUnionÚoverload)Úunder_cached_propertyr   )é   é   )ÚSelfÚ_Tc                   @   s   e Zd ZU eeef ed< dS )Ú_TSelfÚ_cacheN)Ú__name__Ú
__module__Ú__qualname__r   Ústrr   Ú__annotations__© r   r   úU/opt/bot/vods_filmes/script/venv/lib/python3.8/site-packages/propcache/_helpers_py.pyr      s   
r   c                   @   s®   e Zd ZdZedef ddœdd„Zeddee	e
  edœdd	„ƒZedee ee	e
  edœd
d	„ƒZdeee  ee	e
  eeef dœdd	„Zee eddœdd„ZdS )r   aU  Use as a class method decorator.

    It operates almost exactly like
    the Python `@property` decorator, but it puts the result of the
    method it decorates into the instance dict after the first call,
    effectively replacing the function it decorates with an instance
    variable.  It is, in Python parlance, a data descriptor.
    .N)ÚwrappedÚreturnc                 C   s   || _ |j| _|j| _d S ©N)r   Ú__doc__r   Úname)Úselfr   r   r   r   Ú__init__+   s    zunder_cached_property.__init__)ÚinstÚownerr   c                 C   s   d S r   r   ©r    r"   r#   r   r   r   Ú__get__0   s    zunder_cached_property.__get__c                 C   s   d S r   r   r$   r   r   r   r%   5   s    c                 C   sN   |d kr| S z|j | j W S  tk
rH   |  |¡}||j | j< | Y S X d S r   )r   r   ÚKeyErrorr   )r    r"   r#   Úvalr   r   r   r%   :   s    
)r"   Úvaluer   c                 C   s   t dƒ‚d S )Nzcached property is read-only)ÚAttributeError)r    r"   r(   r   r   r   Ú__set__F   s    zunder_cached_property.__set__)N)N)N)r   r   r   r   r   r   r!   r   r   r	   r   r   r%   r   r   r*   r   r   r   r   r   !   s.   	 ÿ 
þ ÿ 
þ ÿ
 

þr   )r   ÚsysÚ	functoolsr   Útypingr   r   r   r   r   r   r	   r
   r   r   Ú__all__Úversion_infor   r   r   r   r   r   r   r   Ú<module>   s   0
