+
    ei.  c                   s.     ! R  R4      t  ! R R4      tR# )c                   s4   a  ] tR t^t o RtR tRR ltRtV tR# )NonDataPropertyaO  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                sX    Vf   Q R4       h\        V4      '       g   Q R4       hWn        R # )Nzfget cannot be nonezfget must be callable)Zcallablefget)selfr      &&>/usr/lib/python3.14/site-packages/keyring/compat/properties.py__init__ZNonDataProperty.__init__   s-    6!66~~666~	    Nc                s0    Vf   V # V P                  V4      # Nr   )r   objZobjtype   &&&r   __get__ZNonDataProperty.__get__   s    ;Kyy~r   r   r   )	__name__
__module____qualname____firstlineno____doc__r   r   __static_attributes____classdictcell____classdict__   @r   r    r       s     $
 r   r    c                   sj   a  ] tR t^"t o Rt ! R R]4      tRR ltRR ltR t	R t
]R	 4       tR
tV tR# )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                   s2   a a ] tR t^t oV 3R ltRtVtV ;t# )classproperty.Metac                s   < V P                   P                  VR 4      p\        V4      \        J d   VP	                  W4      # \
        SV `  W4      # r   )Z__dict__Zgettyper   __set__Zsuper__setattr__)r   Zkeyvaluer	   	__class__s   &&& r   r   Zclassproperty.Meta.__setattr__   sD    --##C.CCyM){{4//7&s22r    )r   r   r   r   r   r   r   Z__classcell__)r   r   s   @@r   Metar      s     	3 	3r   r   Nc                sz    V P                  V4      V n        W n        T;'       d    V P                  V4       R #  R # r   )_ensure_methodr   fsetsetter)r   r   r    r
   r   r   Zclassproperty.__init__   s0    ''-		""T""r   c                sD    V P                   P                  R V4      ! 4       # r   )r   r   )r   Zinstanceownerr
   r   r   Zclassproperty.__get__   s    yy  u-//r   c                s    V P                   '       g   \        R 4      h\        V4      \        P                  Jd   \        V4      pV P                   P                  RV4      ! V4      # )zcan't set attributeN)r    ZAttributeErrorr   r   r   r   )r   r"   r   r
   r   r   Zclassproperty.__set__   sN    yyy !677;m000KEyy  u-e44r   c                s2    V P                  V4      V n        V # r   )r   r    )r   r    r   r   r!   Zclassproperty.setter   s    ''-	r   c                sb    \        V\        \        34      '       * pV'       d   \        V4      # T# )z-
Ensure fn is a classmethod or staticmethod.
)Z
isinstanceclassmethodZstaticmethod)ZclsZfnZneeds_methods   && r   r   Zclassproperty._ensure_method   s)    
 &b;*EFF".{26B6r   )r   r    r   )r   r   r   r   r   r   r   r   r   r   r!   r#   r   r   r   r   r   r   r   r   "   s@     dL3t 3#
05 7 7r   r   N)r    r   r   r   r   <module>r$      s    <G7 G7r   