Files
ServerSync/lib/keyring/compat/__pycache__/properties.cpython-314.pyc

128 lines
5.4 KiB
Plaintext
Raw Normal View History

2026-02-19 00:55:27 +02:00
+
<00>;<3B>i.<00><00>.<00>!RR4t!RR4tR#)c<00>4a<00>]tRt^toRtRtRRltRtVtR#)<07>NonDataPropertyaOMuch 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<08>X<00>VfQR4h\V4'gQR4hWnR#)Nzfget cannot be nonezfget must be callable)<02>callable<6C>fget)<02>selfrs&&<26>@/tmp/pip-target-ugtna5l2/lib/python/keyring/compat/properties.py<70>__init__<5F>NonDataProperty.__init__s-<00><00><13><1F>6<>!6<>6<><1F><17><04>~<7E>~<7E>6<>6<>6<>~<7E><18> <09>Nc<08>0<00>VfV#VPV4#<00>N<>r)r<00>obj<62>objtypes&&&r<00>__get__<5F>NonDataProperty.__get__s<00><00> <0E>;<3B><17>K<EFBFBD><13>y<EFBFBD>y<EFBFBD><13>~<7E>r rr ) <09>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__firstlineno__<5F>__doc__r r<00>__static_attributes__<5F>__classdictcell__<5F><01> __classdict__s@rrrs<00><><00><00><08>$<19>
<1E>r rc<00>ja<00>]tRt^"toRt!RR]4tR RltR RltRt Rt
] R 4t R
t VtR#) <0C> 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<00>2aa<01>]tRt^<5E>toV3RltRtVtV;t#)<03>classproperty.Metac<08><><<01>VPPVR4p\V4\JdVP W4#\
SV`W4#r )<07>__dict__<5F>get<65>typer<00>__set__<5F>super<65> __setattr__)r<00>key<65>valuer<00> __class__s&&& <20>rr&<00>classproperty.Meta.__setattr__<5F>sD<00><><00><16>-<2D>-<2D>#<23>#<23>C<EFBFBD><14>.<2E>C<EFBFBD><13>C<EFBFBD>y<EFBFBD>M<EFBFBD>)<29><1A>{<7B>{<7B>4<EFBFBD>/<2F>/<2F><18>7<EFBFBD>&<26>s<EFBFBD>2<> 2r <00>)rrrrr&rr<00> __classcell__)r)rs@@r<00>Metar<00>s<00><><00><00> 3<> 3r r-Nc<08>z<00>VPV4VnW nT;'dVPV4R#R#r )<04>_ensure_methodr<00>fset<65>setter)rrr0s&&&rr <00>classproperty.__init__<5F>s0<00><00><18>'<27>'<27><04>-<2D><04> <09><18> <09> <0C>"<22>"<22><14><1B><1B>T<EFBFBD>"<22>"r c<08>D<00>VPPRV4!4#r )rr)r<00>instance<63>owners&&&rr<00>classproperty.__get__<5F>s<00><00><13>y<EFBFBD>y<EFBFBD> <20> <20><14>u<EFBFBD>-<2D>/<2F>/r c<08><><00>VP'g \R4h\V4\PJd \V4pVPP RV4!V4#)zcan't set attributeN)r0<00>AttributeErrorr#rr-r)rr5r(s&&&rr$<00>classproperty.__set__<5F>sN<00><00><13>y<EFBFBD>y<EFBFBD>y<EFBFBD> <20>!6<>7<> 7<> <0F><05>;<3B>m<EFBFBD>0<>0<> 0<><18><15>K<EFBFBD>E<EFBFBD><13>y<EFBFBD>y<EFBFBD> <20> <20><14>u<EFBFBD>-<2D>e<EFBFBD>4<>4r c<08>2<00>VPV4VnV#r )r/r0)rr0s&&rr1<00>classproperty.setter<65>s<00><00><18>'<27>'<27><04>-<2D><04> <09><13> r c <0C>b<00>\V\\34'*pV'd \V4#T#)z-
Ensure fn is a classmethod or staticmethod.
)<03>
isinstance<EFBFBD> classmethod<6F> staticmethod)<03>cls<6C>fn<66> needs_methods&& rr/<00>classproperty._ensure_method<6F>s)<00><00>
&<26>b<EFBFBD>;<3B> <0C>*E<>F<>F<> <0C>".<2E>{<7B>2<EFBFBD><EFBFBD>6<>B<EFBFBD>6r )rr0r )rrrrrr#r-r rr$r1r>r/rrrs@rrr"s@<00><><00><00>d<08>L3<>t<EFBFBD>3<>#<23>
0<>5<><14><11>7<><11>7r rN)rrr+r r<00><module>rDs<00><01><1E><1E><G7<>G7r