
    .Ph.                     :     G d  d          Z  G d d          ZdS )c                        e Zd ZdZd Z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
    c                 ^    |
J d            t          |          s
J d            || _        d S )Nzfget cannot be nonezfget must be callable)callablefget)selfr   s     Y/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/keyring/compat/properties.py__init__zNonDataProperty.__init__   s=    !6~~666666			    Nc                 4    || S |                      |          S N)r   )r   objobjtypes      r   __get__zNonDataProperty.__get__   s    ;Kyy~~r
   r   )__name__
__module____qualname____doc__r	   r    r
   r   r   r      sA         $  
     r
   r   c                   `    e Zd ZdZ G d de          Zd
dZd
dZd Zd Z	e
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
    c                        e Zd Z fdZ xZS )classproperty.Metac                     | j                             |d           }t          |          t          u r|                    | |          S t                                          ||          S r   )__dict__gettyper   __set__super__setattr__)r   keyvaluer   	__class__s       r   r   zclassproperty.Meta.__setattr__   sY    -##C..CCyyM)){{4///77&&sE222r
   )r   r   r   r   __classcell__)r"   s   @r   Metar      s8        	3 	3 	3 	3 	3 	3 	3 	3 	3r
   r$   Nc                 |    |                      |          | _        || _        |o|                     |           d S  d S r   )_ensure_methodr   fsetsetter)r   r   r'   s      r   r	   zclassproperty.__init__   sD    ''--		"T""""""""r
   c                 H     | j                             d |                      S r   )r   r   )r   instanceowners      r   r   zclassproperty.__get__   s"    -ty  u--///r
   c                     | j         st          d          t          |          t          j        urt          |          } | j                             d |          |          S )Nzcan't set attribute)r'   AttributeErrorr   r   r$   r   )r   r+   r!   s      r   r   zclassproperty.__set__   s\    y 	8 !6777;;m000KKE-ty  u--e444r
   c                 :    |                      |          | _        | S r   )r&   r'   )r   r'   s     r   r(   zclassproperty.setter   s    ''--	r
   c                 b    t          |t          t          f           }|rt          |          n|S )z=
        Ensure fn is a classmethod or staticmethod.
        )
isinstanceclassmethodstaticmethod)clsfnneeds_methods      r   r&   zclassproperty._ensure_method   s0    
 &b;*EFFF".6{2B6r
   r   )r   r   r   r   r   r$   r	   r   r   r(   r1   r&   r   r
   r   r   r   "   s        d dL3 3 3 3 3t 3 3 3# # # #
0 0 0 05 5 5   7 7 [7 7 7r
   r   N)r   r   r   r
   r   <module>r6      si          <G7 G7 G7 G7 G7 G7 G7 G7 G7 G7r
   