
    .Ph/                       U d dl mZ d dlmZmZmZmZmZ  ed          Z ed          Z	erqd dl
mZ d dlmZmZ d dlmZmZ edef         Zd	ed
<   eeg ef         Zd	ed<   eee         egdf         Zd	ed<   eeegdf         Zd	ed<    G d dee                   Z G d deee	f                   Z G d dee                   ZdS )    )annotations)TYPE_CHECKINGGenericTypeVarcastoverload_T_U)Callable)AnyProtocol)Self	TypeAlias.r   _GetterCallable_GetterClassMethodN_SetterCallable_SetterClassMethodc                       e Zd ZdddZddZdS )_ClassPropertyAttributeNobjobjectobjtypetype[Any] | Nonereturnr	   c                    d S N selfr   r   s      Y/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/jaraco/classes/properties.py__get__z_ClassPropertyAttribute.__get__             valueNonec                    d S r   r   )r   r   r$   s      r    __set__z_ClassPropertyAttribute.__set__   r"   r#   r   )r   r   r   r   r   r	   )r   r   r$   r	   r   r%   )__name__
__module____qualname__r!   r'   r   r#   r    r   r      s+        SSSSS>>>>>>r#   r   c                  Z    e Zd ZdZddZedd
            Ze	 ddd            Z	 dddZdS )NonDataPropertya  Much like the property builtin, but only implements __get__,
    making it a non-data property, and can be subsequently reset.

    See http://users.rcn.com/python/download/Descriptor.htm for more
    information.

    >>> class X(object):
    ...   @NonDataProperty
    ...   def foo(self):
    ...     return 3
    >>> x = X()
    >>> x.foo
    3
    >>> x.foo = 4
    >>> x.foo
    4

    '...' below should be 'jaraco.classes' but for pytest-dev/pytest#3396
    >>> X.foo
    <....properties.NonDataProperty object at ...>
    fgetCallable[[_T], _U]r   r%   c                ^    |
J d            t          |          s
J d            || _        d S )Nzfget cannot be nonezfget must be callable)callabler-   )r   r-   s     r    __init__zNonDataProperty.__init__2   s=    !6~~666666			r#   r   r   r   c                    d S r   r   r   s      r    r!   zNonDataProperty.__get__7   s	    
 sr#   Nr	   type[_T] | Noner
   c                    d S r   r   r   s      r    r!   zNonDataProperty.__get__>   s	    
 Sr#   	_T | None	Self | _Uc                4    || S |                      |          S r   )r-   r   s      r    r!   zNonDataProperty.__get__E   s    
 ;Kyy~~r#   )r-   r.   r   r%   )r   r%   r   r%   r   r   r   )r   r	   r   r3   r   r
   )r   r5   r   r3   r   r6   )r(   r)   r*   __doc__r1   r   r!   r   r#   r    r,   r,      s         ,   
    X  $(    X $(      r#   r,   c                      e Zd ZU dZded<   ded<    G d de          Z	 d!d"dZd!d#dZd$dZ	d%dZ
eed&d                        Zeed'd                        Zed(d             ZdS ))classpropertya  
    Like @property but applies at the class level.


    >>> class X(metaclass=classproperty.Meta):
    ...   val = None
    ...   @classproperty
    ...   def foo(cls):
    ...     return cls.val
    ...   @foo.setter
    ...   def foo(cls, val):
    ...     cls.val = val
    >>> X.foo
    >>> X.foo = 3
    >>> X.foo
    3
    >>> x = X()
    >>> x.foo
    3
    >>> X.foo = 4
    >>> x.foo
    4

    Setting the property on an instance affects the class.

    >>> x.foo = 5
    >>> x.foo
    5
    >>> X.foo
    5
    >>> vars(x)
    {}
    >>> X().foo
    5

    Attempting to set an attribute where no setter was defined
    results in an AttributeError:

    >>> class GetOnly(metaclass=classproperty.Meta):
    ...   @classproperty
    ...   def foo(cls):
    ...     return 'bar'
    >>> GetOnly.foo = 3
    Traceback (most recent call last):
    ...
    AttributeError: can't set attribute

    It is also possible to wrap a classmethod or staticmethod in
    a classproperty.

    >>> class Static(metaclass=classproperty.Meta):
    ...   @classproperty
    ...   @classmethod
    ...   def foo(cls):
    ...     return 'foo'
    ...   @classproperty
    ...   @staticmethod
    ...   def bar():
    ...     return 'bar'
    >>> Static.foo
    'foo'
    >>> Static.bar
    'bar'

    *Legacy*

    For compatibility, if the metaclass isn't specified, the
    legacy behavior will be invoked.

    >>> class X:
    ...   val = None
    ...   @classproperty
    ...   def foo(cls):
    ...     return cls.val
    ...   @foo.setter
    ...   def foo(cls, val):
    ...     cls.val = val
    >>> X.foo
    >>> X.foo = 3
    >>> X.foo
    3
    >>> x = X()
    >>> x.foo
    3
    >>> X.foo = 4
    >>> x.foo
    4

    Note, because the metaclass was not specified, setting
    a value on an instance does not have the intended effect.

    >>> x.foo = 5
    >>> x.foo
    5
    >>> X.foo  # should be 5
    4
    >>> vars(x)  # should be empty
    {'foo': 5}
    >>> X().foo  # should be 5
    4
    z/_ClassPropertyAttribute[_GetterClassMethod[_T]]r-   z6_ClassPropertyAttribute[_SetterClassMethod[_T] | None]fsetc                        e Zd Zd fdZ xZS )	classproperty.Metakeystrr$   r   r   r%   c                    | j                             |d           }t          |          t          u r|                    | |          S t                                          ||          S r   )__dict__gettyper:   r'   super__setattr__)r   r>   r$   r   	__class__s       r    rE   zclassproperty.Meta.__setattr__   sY    -##C..CCyyM)){{4///77&&sE222r#   )r>   r?   r$   r   r   r%   )r(   r)   r*   rE   __classcell__)rF   s   @r    Metar=      s=        	3 	3 	3 	3 	3 	3 	3 	3 	3 	3r#   rH   N,_GetterCallable[_T] | _GetterClassMethod[_T]3_SetterCallable[_T] | _SetterClassMethod[_T] | Noner   r%   c                |    |                      |          | _        || _        |o|                     |           d S  d S r   )_ensure_methodr-   r;   setter)r   r-   r;   s      r    r1   zclassproperty.__init__   sF    
 ''--		"T""""""""r#   instancer   ownertype[object] | Noner	   c                H     | j                             d |                      S r   )r-   r!   )r   rN   rO   s      r    r!   zclassproperty.__get__   s"    -ty  u--///r#   r$   c                    | j         st          d          t          |          t          j        urt          |          } | j                             d t          d|                    |          S )Nzcan't set attributeztype[object])r;   AttributeErrorrC   r:   rH   r!   r   )r   rO   r$   s      r    r'   zclassproperty.__set__   sf    y 	8 !6777;;m000KKECty  tNE'B'BCCEJJJr#   ,_SetterCallable[_T] | _SetterClassMethod[_T]r   c                :    |                      |          | _        | S r   )rL   r;   )r   r;   s     r    rM   zclassproperty.setter   s    ''--	r#   fn_GetterClassMethod[_T]c                    d S r   r   clsrV   s     r    rL   zclassproperty._ensure_method   	    
 "%r#   _SetterClassMethod[_T]c                    d S r   r   rY   s     r    rL   zclassproperty._ensure_method   r[   r#   [_GetterCallable[_T] | _GetterClassMethod[_T] | _SetterCallable[_T] | _SetterClassMethod[_T]/_GetterClassMethod[_T] | _SetterClassMethod[_T]c                b    t          |t          t          f           }|rt          |          n|S )z=
        Ensure fn is a classmethod or staticmethod.
        )
isinstanceclassmethodstaticmethod)rZ   rV   needs_methods      r    rL   zclassproperty._ensure_method   s0     &b;*EFFF".6{2B6r#   r   )r-   rI   r;   rJ   r   r%   )rN   r   rO   rP   r   r	   )rO   r   r$   r	   r   r%   )r;   rT   r   r   )rV   rI   r   rW   )rV   rT   r   r\   )rV   r^   r   r_   )r(   r)   r*   r8   __annotations__rC   rH   r1   r!   r'   rM   r   rb   rL   r   r#   r    r:   r:   O   s@        d dL :999@@@@3 3 3 3 3t 3 3 3 EI# # # # #0 0 0 0 0K K K K    % % % [ X%
 % % % [ X%
 7 7 7 [7 7 7r#   r:   )
__future__r   typingr   r   r   r   r   r	   r
   collections.abcr   r   r   typing_extensionsr   r   r   re   rb   r   rC   r   r   r   r,   r:   r   r#   r    <module>rj      s   " " " " " " " B B B B B B B B B B B B B BWT]]WT]] ?(((((($$$$$$$$11111111 "*#r'!2O2222$/R$<<<<<!)49b/4*?!@O@@@@$/bT4$@@@@@? ? ? ? ?(2, ? ? ?1 1 1 1 1gb"fo 1 1 1hb7 b7 b7 b7 b7GBK b7 b7 b7 b7 b7r#   