]ue( ddlmZddlZddlmZddlmZejeje e fe e fZ GddZ de _GddZdd ZeefZGd d eZ d dd Zdd ZGddZy)) annotationsN)ref)BoundMethodWeakrefceZdZdZdZdZy)_symbolc |x|_|_y)zConstruct a new named symbol.N)__name__name)selfr s 4/usr/lib/python3/dist-packages/blinker/_utilities.py__init__z_symbol.__init__ s$((  c(t|jffSN)symbolr r s r __reduce__z_symbol.__reduce__s |##rc|jSr)r rs r __repr__z_symbol.__repr__s yyrN)r __module__ __qualname__r rrrr rr s)$rrrceZdZdZiZdZy)ra?A constant symbol. >>> symbol('foo') is symbol('foo') True >>> symbol('foo') foo A slight refinement of the MAGICCOOKIE=object() pattern. The primary advantage of symbol() is its repr(). They are also singletons. Repeated calls of symbol('name') will all return the same instance. c |j|S#t$r(|jj|t|cYSwxYwr)symbolsKeyError setdefaultr)clsr s r __new__zsymbol.__new__+s@ ?;;t$ $ ?;;))$ > > ?s.AAN)r rr__doc__rrrrr rrs G?rc t|dr*t|jt|jfSt|dr*t|jt|j fSt |ttfr|St|S)N__func__im_func) hasattridr"__self__r#im_self isinstanceintstr)objs r hashable_identityr,2sjsJ3<< "S\\"233 i 3;;CKK11 C#s $ #wrc&eZdZUdZded<ded<y)annotatable_weakrefz7A weakref.ref that supports custom instance attributes.zt.Optional[IdentityType] receiver_id sender_idN)r rrr __annotations__rrr r.r.@sA))''rr.c t|r t||}n t||}|jD]\}}t ||||S)zReturn an annotated weak ref.)callablecallable_referencer.itemssetattr)objectcallbackrweakkeyvalues r referencer<GsS!&(3"684'k'')" Uc5!" Krct|dr|j t||St|dr|j t||St ||S)z@Return an annotated weak ref, supporting bound instance methods.r')target on_deleter&)r$r'rr&r.)r7r8s r r4r4TsOvy!fnn&@!8DD  $)D!8DD vx 00rceZdZdZdZdZy) lazy_propertyz(A @property that is only evaluated once.c4||_|j|_yr) _deferredr )r deferreds r r zlazy_property.__init__`s!'' rcr||S|j|}t||jj||Sr)rCr6r )r r+rr;s r __get__zlazy_property.__get__ds5 ;Ks#T^^,,e4 rN)r rrr r rFrrr rArA]s2(rrA)r+r7return IdentityTyper)rGr.) __future__rtypingtweakrefrblinker._saferefrUnionTupler)r*rHrr rr, WeakTypesr.r<r4rArrr rQs"/wwqwwsCx(#s23   ??0$ % (#(  1  r