a0bimT SSKrSSKrSSKrSSKrSSKrSSKr\R SSS:r\(a\r OSSKJ r J r Sr Sr /SQr \(a\ R/SQ5 \"\S 5(a \R rO"S S \R"S S 9r\"S S 9r\R&"S5r\R&"S5r\R&"S5r\R&"SS S9r\R&"SS S9r\R2r\"\S5(a \R SSS:a \R4rOI\R SSS:a"SS\R6S S 9r\"SSS9rO"SS\R"S S 9r\"S S 9r\"\S5(a \R<rOSrS r\"\S!5(a \R@r OI\R SSS:a"S"S#\R6S S 9r!\!"S!S$S9r O"S%S&\R"S S 9r"\""S S 9r \RFr#\RHr$\RJr%"S'S(\ 5r&\RNr'\RPr(\RRr)\RTr*\"\S)5(a \RVr+O-"S*S)\RX\RZ\\&\RXS+9r+\R\r.\"\S,5(a \R^r/OSS-K0J1r2 "S.S,\Rf\5r/\Rhr4\"\S/5(a \Rjr5OlS\R SSs=::aS0:a#O O \Rl"\Rj\\45r5O/"S1S/\Rj\Rn\\4\&\RjS+9r5\"\S25(a \Rpr8O/"S3S2\Rp\Rr\\:4\&\RpS+9r8\"\S45(a \Rvr;O=\"\S45(a/"S5S4\Rv\Rn\\4\&\RvS+9r;\"\S65(a \Rxr\R~r?S8r@/S9QrAS:rBS;rC\"\S<5(a \RrDON\(a(SS=KJErE S>rF"S?S@\R5rH"SAS<\HSB9rDOSSCKJIrIJJrJ SDrF"SES@\ 5rH"SFS<\HSB9rD\"\SG5(a \RrKOSHrK\KrL\"\SI5(a \RrMO\K"SJSI\D55rM\R SK:a \RrNO?SLrOSMrPSN\PlQS SO.SPjrRSQ\RlQ"SRSS\5rS\S"ST\T405rN\U\NlVSU\NlW\"\SV5(a%\RrX\RrY\RrZOO\(a'"SWSX\RS S 9rZ"SYSV5rXSZr\SS[jrYO!S\r]"S]S^\R5r^"S_SV\^SB9rX\R SSS`:a\Rr_\Rr`O\(aSSaKJara SSbKJcrc Scr_Sdr`\"\Se5(a \RrdO\R SSSf:a"SgSh\R6S S 9re\eSi5rdO_\R SSS:a"SjSh\R6S S 9re\e"SeSkS9rdO0"SlSm\R5rg"SnSo\R"\gS Sp9rh\h"S S 9rd\"\Sq5(a\Rri\RrjO "SrSs5rk"StSq\k5ri"SuSv\k5rj\"\Sw5(a \RrlO "SxSw\m5rl\"\Sy5(d "SzS{\m5rn\RS|5rp\"\Sy5(a\Rrq\RrnO{\R SSSf:a \eS}5rqO_\R SSS:a"S~S\R6S S 9rr\r"SySS9rqO0"SS\R5rs"SS\R"\sS Sp9rt\t"S S 9rq\"\S5(a \RruOy\R SSSf:a"SS\R6S S 9rv\vS5ruOI\R SSS:a"SS\R6S S 9rv\v"SSS9ruO"SS\R"S S 9rw\w"S S 9ru\"\S5(a \RrxOJ\R SSS:a"SS\R:S S 9r\S5rxO"SS\R"S S 9ry\y"S S 9rx\"\S5(a\Rrz\Rr{g\R SSSf:a%"SS\R6S S 9r|\|S5rz\|S5r{g\R SSS:a#"SS\R6S S 9r}\}"SSS9rz\}"SSS9r{g"SS\R"S S 9r~"SS\~S S 9r"SS\~S S 9r\"S S 9rz\"S S 9r{g!\ba \RraGNf=f!\ba \RrcGNf=f)N)rr) GenericMeta _type_varscd[U5nSU;aUSHnURUS5 M U$)N __slots__)dictpop)dct dict_copyslots ڝ/builddir/build/BUILDROOT/alt-python313-setuptools-69.0.2-3.el8.x86_64/opt/alt/python313/lib/python3.13/site-packages/setuptools/_vendor/typing_extensions.py_no_slots_copyrs6S Iik*D MM$ %+ c UR(d[US35e[U5n[UR5nX#:wa[SX#:aSOSSUSUSU35eg)Nz is not a generic classzToo manyfewz arguments for z ; actual z , expected )__parameters__ TypeErrorlen)cls parametersalenelens r_check_genericrsx   3%6788 z?D s!! "D |$v%@PSuU##'& D6;< <r)!ClassVar ConcatenateFinal ParamSpecSelfType Awaitable AsyncIterator AsyncIterable CoroutineAsyncGeneratorAsyncContextManagerChainMapContextManagerCounterDeque DefaultDict OrderedDict TypedDict SupportsIndex AnnotatedfinalIntVarLiteralNewTypeoverloadProtocolruntimeruntime_checkableText TypeAlias TypeGuard TYPE_CHECKING)get_args get_originget_type_hintsNoReturnc(\rSrSrSrSrSrSrSrg) _NoReturn_zSpecial type indicating functions that never return. Example:: from typing import NoReturn def stop() -> NoReturn: raise Exception('no way') This type is invalid in other positions, e.g., ``List[NoReturn]`` will fail in static type checkers. c[S5e)Nz*NoReturn cannot be used with isinstance().rselfobjs r__instancecheck___NoReturn.__instancecheck__mHI Irc[S5e)Nz*NoReturn cannot be used with issubclass().rFrHrs r__subclasscheck___NoReturn.__subclasscheck__prLrN __name__ __module__ __qualname____firstlineno____doc__rrJrO__static_attributes__rDrrrBrB_s   J JrrBT_rootTKTVTT_co) covariantT_contra) contravariantr)rrc \rSrSrSrSrSrg) _FinalFormc SUR-$Nztyping_extensions._namerHs r__repr___FinalForm.__repr__'$**4 4rcx[R"UURS35n[R"X45$)N accepts only single typetyping _type_checkrh _GenericAliasrHritems r __getitem___FinalForm.__getitem__s7%%j)- 4M&NPD''g6 6rrDNrRrSrTrUrjrurWrDrrrcrc  5 7rrcaWA special typing construct to indicate that a name cannot be re-assigned or overridden in a subclass. For example: MAX_SIZE: Final = 9000 MAX_SIZE += 1 # Error reported by type checker class Connection: TIMEOUT: Final[int] = 10 class FastConnector(Connection): TIMEOUT = 1 # Error reported by type checker There is no runtime checking of these properties.)doccR^\rSrSrSrSrS SjrSrSrU4Sjr Sr S r Sr U=r $) _FinalaA special typing construct to indicate that a name cannot be re-assigned or overridden in a subclass. For example: MAX_SIZE: Final = 9000 MAX_SIZE += 1 # Error reported by type checker class Connection: TIMEOUT: Final[int] = 10 class FastConnector(Connection): TIMEOUT = 1 # Error reported by type checker There is no runtime checking of these properties. __type__c XlgNr}rHtpkwdss r__init___Final.__init__Mrc[U5nURc,U"[R"UURSSS35SS9$[ URSSS35e)N accepts only single type.TrX cannot be further subscriptedtyper~rprqrRrrHrtrs rru_Final.__getitem__smt*C}}$6--d!ll12.//IJL!%''s||AB/00NOP Prc[R"URX5nX0R:XaU$[U5"USS9$NTrXrp _eval_typer~rrHglobalnslocalnsnew_tps rr_Final._eval_type8&&t}}hHF& :fD1 1rc>[TU]5nURb'US[R"UR5S3- nU$N[]superrjr~rp _type_reprrHr __class__s rrj_Final.__repr__B "A}}(q**4==9:!<<HrcV[[U5RUR45$rhashrrRr~ris r__hash___Final.__hash__ d,,dmm<= =rc[U[5(d[$URbURUR:H$XL$r) isinstancer{NotImplementedr~rHothers r__eq__ _Final.__eq__s:eV,,%%}}(}}66= rrrRrSrTrUrVrrrurrjrrrW __classcell__rs@rr{r{s3 "   Q 2    > ! !rr{r1cU$)aThis decorator can be used to indicate to type checkers that the decorated method cannot be overridden, and decorated class cannot be subclassed. For example: class Base: @final def done(self) -> None: ... class Sub(Base): def done(self) -> None: # Error reported by type checker ... @final class Leaf: ... class Other(Leaf): # Error reported by type checker ... There is no runtime checking of these properties. rD)fs rr1r1s (rc.[R"U5$r)rpTypeVarnames rr2r2s >>$ rr3c \rSrSrSrSrSrg) _LiteralFormc SUR-$rfrgris rrj_LiteralForm.__repr__rlrc.[R"X5$r)rprrrHrs rru_LiteralForm.__getitem__s''9 9rrDNrwrDrrrrs  5 :rraoA type that can be used to indicate to type checkers that the corresponding value has a value literally equivalent to the provided parameter. For example: var: Literal[4] = 4 The type checker understands that 'var' is literally equal to the value 4 and no other value. Literal[...] cannot be subclassed. There is no runtime checking verifying that the parameter is actually a value instead of a type.cR^\rSrSrSrSrS SjrSrSrU4Sjr Sr S r Sr U=r $) _LiteraliaA type that can be used to indicate to type checkers that the corresponding value has a value literally equivalent to the provided parameter. For example: var: Literal[4] = 4 The type checker understands that 'var' is literally equal to the value 4 and no other value. Literal[...] cannot be subclassed. There is no runtime checking verifying that the parameter is actually a value instead of a type.  __values__c Xlgrr)rHvaluesrs rr_Literal.__init__!$Orc[U5nURc[U[5(dU4nU"USS9$[ UR SSS35e)NTrXrr)rrrtuplerrR)rHrrs rru_Literal.__getitem__$sUt*C&!&%00$YF6..s||AB/00NOP PrcU$rrD)rHrrs rr_Literal._eval_type,Krc>[TU]5nURb:USSR[ [ R UR55S3- nU$)Nr, r)rrjrjoinmaprprrs rrj_Literal.__repr__/sM "A*q3v'8'8$//#JKLANNHrcV[[U5RUR45$r)rrrRrris rr_Literal.__hash__5s d,,doo>? ?rc[U[5(d[$URbURUR:H$XL$r)rrrrrs rr_Literal.__eq__8s<eX..%%*%*:*:::= rrrrs@rrrs4 $  % Q    @ ! !rrc(^\rSrSrU4SjrSrU=r$)_ExtensionsGenericMetaiMc>URb3[R"S5RSS;a [ S5egUR (d[ TU]U5$UR RU5nU[LaU$UR UR;agUR R5H,n[U[5(aM[X5(dM, g g)a This mimics a more modern GenericMeta.__subclasscheck__() logic (that does not have problems with recursion) to work around interactions between collections, typing, and typing_extensions on older versions of Python, see https://github.com/python/typing/issues/501. rrRabc functoolsCParameterized generics cannot be used with class or instance checksFT) __origin__sys _getframe f_globalsr __extra__rrO__subclasshook__r__mro____subclasses__rr issubclass)rHsubclassressclsrs rrO(_ExtensionsGenericMeta.__subclasscheck__Ns ?? &}}Q))*5=QQ!566~~7,X6 6nn--h7 n $J >>X-- -NN113D$ ,,()) 4 rrD)rRrSrTrUrOrWrrs@rrrMs rrr+c\rSrSrSrSrSrg)r+irrDcUR[La[R"U0UD6$[R "[RU/UQ70UD6$r)_gorgr+ collectionsdequerp _generic_newrargsrs r__new__ Deque.__new__wsGyyE!"(($7$77&&{'8'8#MMM MrNrRrSrTrUrrrWrDrrr+r+rs  Nr) metaclassextrar')_check_methodscR\rSrSrSrSr\RS5r\ S5r Sr g)r'irDc# U$7frrDris r __aenter__AsyncContextManager.__aenter__s Ksc # g7frrD)rHexc_type exc_value tracebacks r __aexit__AsyncContextManager.__aexit__ssc:U[La [USS5$[$)Nrr)r'_check_methods_in_mror)rCs rr$AsyncContextManager.__subclasshook__s )),Q kJJ! !rN) rRrSrTrUrrrabstractmethodr classmethodrrWrDrrr'r's:         "  "rr-)rrrac\rSrSrSrSrSrg)r-irDcUR[La[R"U0UD6$[R"[RU/UQ70UD6$r)rr-rrprrs rrOrderedDict.__new__sGyyK'"..===&&{'>'>SdSdS SrNrrDrrr-r-s  Trr*c\rSrSrSrSrSrg)r*irDcUR[La[R"U0UD6$[R"[RU/UQ70UD6$r)rr*rrprrs rrCounter.__new__sGyyG#"**D9D99&&{':':CO$O$O OrNrrDrrr*r*s  Prr(c\rSrSrSrSrSrg)r(irDcUR[La[R"U0UD6$[R"[RU/UQ70UD6$r)rr(rrprrs rrChainMap.__new__sGyyH$"++T:T::&&{';';SP4P4P PrNrrDrrr(r(s  Qrr&c\rSrSrSrSrg)r&irDN)rRrSrTrUrrWrDrrr&r&s  rc[U[5(de[US5(a UR$URbURnURbMU$)z@This function exists for compatibility with old typing versions.r)rrhasattrrrrs rrrsP c; ' '' 'sGyy .. $nn .. $ Jr) Callabler"IterableIteratorr$r#HashableSized Container Collection Reversibler)r'cn[5nURSSHnURS;aM[US05n[ UR R 55[ UR 55-H4nURS5(aMUS;dM#URU5 M6 M U$)N)r6Generic__annotations___abc_)__abstractmethods__r$ __weakref__ _is_protocol_is_runtime_protocol__dict____args__r__next_in_mro__rr__orig_bases__r __tree_hash__rVrrrrS_MutableMapping__markerr) setrrRgetattrlistr*keys startswithadd)rattrsbase annotationsattrs r_get_protocol_attrsr:s EE CR  ==3 3 d$5r: ++-.k6F6F6H1IIDOOG,,>F2F $J ! Lrc@^[U4Sj[T555$)Nc3P># UHn[[TUS55v M g7fr)callabler1).0r9rs r ,_is_callable_members_only..s$W>VdxT4011>Vs#&)allr:rs`r_is_callable_members_onlyrBs W>QRU>VW WWrr6)_collect_type_varscN[U5R(a [S5egNz Protocols cannot be instantiatedrr(rrHrkwargss r_no_initrI : " ">? ? #rc(^\rSrSrU4SjrSrU=r$) _ProtocolMetai c>^^[TSS5(a[T5(a[TRT5(agTR(a%[ UU4Sj[ T555(ag[TT]!T5$)Nr(FTc3># UHHn[TU5=(a0 [[TUS55(+=(d [TU5SLv MJ g7frrr=r1)r>r9rinstances rr?2_ProtocolMeta.__instancecheck__..sU=$<4x.=$WS$%=>><$/t;=$<AA) r1rBrrr(rAr:rrJ)rrPrs``rrJ_ProtocolMeta.__instancecheck__ stS.%88*3//x11377=$7s#;=== 7,X6 6rrD)rRrSrTrUrJrWrrs@rrLrL s  7 7rrLc^^\rSrSrSrSrSrU4Sjr\RS5r Sr Sr U=r $)r6ia Base class for protocol classes. Protocol classes are defined as:: class Proto(Protocol): def meth(self) -> int: ... Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing), for example:: class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check See PEP 544 for details. Protocol classes decorated with @typing_extensions.runtime act as simple-minded runtime protocol that checks only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:: class GenProto(Protocol[T]): def meth(self) -> T: ... rDTcJ>U[La [S5e[TU] U5$)NzIType Protocol cannot be instantiated; it can only be used as a base class)r6rrr)rrrrs rrProtocol.__new__>s.h!FGG7?3' 'rcf^[U[5(dU4nU(d,U[RLa[ SUR S35eSm[U4SjU55nU[ La[SU55(daSn[X[R5(a(US- n[X[R5(aM([ SUS-S X35e[[U55[U5:wa [ S 5eO [X5 [R"X5$) NParameter list to [...] cannot be empty*Parameters to generic types must be types.c3R># UHn[R"UT5v M g7frrprqr>pmsgs rr?-Protocol.__class_getitem__..Ls!Fv!6--a55v$'c3V# UHn[U[R5v M! g7frrrprr>r^s rr?r`OI&Q:a88&')rrzBParameters to Protocol[...] must all be type variables. Parameter z is z.Parameters to Protocol[...] must all be unique) rrrpTuplerrTr6rArrr0rrr)rparamsir_s @r__class_getitem__Protocol.__class_getitem__Dsfe,, c5()9)9(::OPRR>CFvFFFhI&IIIA$VY??Q%VY??#&&'!eWD =>>s6{#s6{2#HJJ3 s+''4 4rc >^^ /nSTR;a[RTR;nO[RTR;nU(a [ S5eSTR;Ga [ TR5nSnTRHzn[U[R5(dM$UR[R[4;dMJURRnUb [ S5eURnM| UcUnOf[U5n[U5m UT ::dHSRU 4SjU55n SRSU55n [ SU SWS U S 35eUn[U5Tl TRR!S S5(d![#S TR55TlU4S jn STR;aU TlTR$(dgTRHnU[([R4;aMUR*S:XaUR[,;aME[U[.5(aUR$(aMm[ S[1U535e [2Tlg)Nr-!Cannot inherit from plain GenericzECannot inherit from Generic[...] and/or Protocol[...] multiple types.rc3H># UHoT;dM [U5v M g7frstrr>tgvarsets rr?-Protocol.__init_subclass__..~*U5aWDT63q665 ""c38# UHn[U5v M g7frror>gs rr?rt*A5a3q665Some type variables () are not listed in rrr(c30# UH o[Lv M g7fr)r6r>bs rr?rts&LmH}mc&>TRRSS5(d[$[TSS5(d8[R "S5R SS;a[$[S5e[T5(d8[R "S5R SS;a[$[S5e[U[5(d [S 5e[T5HnURHnXR;aURUc [s s $ M>[US 05n[U[R5(dM]X;dMd[U[5(dM{UR (dM M [s $ g ) Nr(r)FrarRrBInstance and class checks can only be used with @runtime protocols._proto_hooksO||''==))s$:EBB}}Q'11*=AUU--#%:;;055}}Q'11*=AUU--#%BCC!%..#$HII/4D % ==0#}}T2:'5 5!&-d4Er&J &{FNNCC $ 3 *5- @ @ % 2 2 2!!. .-5rrcollections.abc5Protocols can only inherit from other protocols, got )r*rpr#r- __bases__rrCrrrrr6rRrr0rrranyr(robjectrS_PROTO_WHITELISTrLreprrIr) rrrHtvarserrorgvarsr7the_basetvarsets_varss_argsrrss ` @r__init_subclass__Protocol.__init_subclass__^sAE3<</#*<*<<#--7 CDD3<</*3+=+=> ..D"4)=)=>> OO/II#'??#;#; ,"+!H#II!% 3 3/=!E!%jG!%jG"g-!%*U5*U!U!%*A5*A!A'*?xH::B1VHA)OPP!E!&uC <<##ND99#&&Lcmm&L#L  >"5'2$##  88+<< )99"477D^UbeUb%Uce[SU55(dU5eGO[U5nSn UHxn U [RLa [ S5e[ U [ 5(dM8U R[R[4;dM^U b [ S5eU Rn Mz U cUn O[U5n [U 5mU T::dcSRU4SjU55n SRSU 55n [SU55(aSOS n[ S U S US U S 35eU nUnUb'[U5[RLa Xr;aU4U-n[!SU55n[SU55(a[!SU55nUR#XgS.5 [$[ U]OXX#SS9n[$[ U]SSU(dUO [+U55 UUl U(a[!SU55OSUl[/U5UlUcUUlO%Ub"UR4UlUR6UlS5(a7U(a[;UR=55O[$[ U]5Ul U$)Nc3V# UHn[U[R5v M! g7frrc)r>rrs rr?(_ProtocolMeta.__new__..sH%Q:a88%rfrmzACannot inherit from Generic[...] or Protocol[...] multiple times.rc3H># UHoT;dM [U5v M g7frrorqs rr?rrurvc38# UHn[U5v M g7frrorxs rr?rrzr{c3Z# UH!nUR[RLv M# g7fr)rrpr#rs rr?rs%4D=B56LLFNN4R=Bs)+r#r6r|r}rrc3f# UH'n[U[5(a [U5OUv M) g7fr)rrrrs rr?rs,*#(a'1K&@&@%(aG#(s/1c3t# UH.n[U[5=(a U[RLv M0 g7fr)rrrpr#rs rr?rs*YSXa:a-I!6>>2IISXs68c3N# UHo[RLdMUv M g7fr)rpr#rs rr?rsJA6>>2Iaas% %)rrTrXrc3z# UH1nU[RLaSOU[RLaSOUv M3 g7f).rDN)rp_TypingEllipsis _TypingEmptyr>as rr?rs<"3-1*+f.D.D)D#()V-@-@(@""##$-1s9; _subs_tree)!rArrpr#rrrrr6rr0rrrrABCMetarupdaterr __setattr__rr+rr,r- _abc_registry _abc_cacherrrrr.)rrbases namespacerroriginr orig_basesrr7rrrcls_name initial_basesrHrsrs @rr_ProtocolMeta.__new__s= = )))H%HHHO%OH"5)!Dv~~-'(KLL"455 OO/II ,"+!A#BB!% 3 3"=!E!%jG!%jG"g-!%*U5*U!U!%*A5*A!A034D=B4D1D1D9IS!'*?xH::B1VHA)OPP!E!M!d5kS[[&@&5(*#(**EYSXYYYJJJ   FG Hc23e9=3?D +t 0=C16v @#(D 7;""3-1"33@D M$0#5D !&3##%+%9%9""("3"3t\**AGd4??+<&=&+K&G&I"Krc>^[TT]"U0UD6 TRRSS5(d![ STR 55TlTR (aTRSSHnU[[R4;aMURS:XaUR[;aME[U[R5(aUR (aMw[U[ 5(aUR"[RLaM[%S['U535e [(TlU4SjnSTR;aUTlgg)Nr(c3# UH=nU[L=(d) [U[5=(a UR[Lv M? g7fr)r6rrLrrs rr?)_ProtocolMeta.__init__.. sG'?1>1()H}(@'1!]'C(@'(||x'?(@1>sAArrrc>TRRSS5(d[$[U[5(d [ S5e[ T5HnURHnXR;aURUc [s s $ M>[US05n[U[R5(dM]X;dMd[U[5(dM{UR(dM M [s $ g)Nr(rr$T) r*rrrrrr:rr1rprrLr(rs rr+_ProtocolMeta.__init__.._proto_hooks||''==))!%..#$HII/4D % ==0#}}T2:'5 5!&-d4Er&J &{FNNCC $ 3 *5- @ @ % 2 2 2!!. .-5rr)rrr*rrrr(rrrpr#rSrRrr TypingMetarrrrrIr)rrrHr7rrs` rr_ProtocolMeta.__init__s G d -f -<<##ND99#&'?14 '?$? KKOD VV^^$<< OO/@@ MM-==&tV->->??DDUDUDU&t[99 OOv~~='+;;?:,)HII, (  *"5'2$6rc>^^[TSS5(a[T5(a[TRT5(agTR(a%[ UU4Sj[ T555(ag[[T]'T5$)Nr(FTc3># UHHn[TU5=(a0 [[TUS55(+=(d [TU5SLv MJ g7frrO)r>r9rPrHs rr?rQ;sU?%>Dx.>%gdD$&?@@= 40<>%>rR) r1rBrrr(rAr:rrrJ)rHrPrs``rrJrS3svT>599-d33x11488  ?%8$=??? d=hG Grc>URb3[R"S5RSS;a [ S5egUR R SS5(aTUR R SS5(d3[R"S5RSS;ag[ S 5eUR R SS5(aU[U5(dE[R"S5RSS;a[[U]+U5$[ S 5e[[U]+U5$) NrrRrrFr(r)rrrprr) rrrrrr*rrBrrrO)rHrrs rrO_ProtocolMeta.__subclasscheck__Bs&*==#--j9AUU#%9:: !!.$77 ))*@$GG==#--j9>HH!!677 !!"8$??1$77==#--j9>HH!dEcJJ!>??d=cB Brc ^[U[5(dU4nU(d5[U5[RLa[ SUR S35eSm[U4SjU55nU[R[4;am[SU55(d[ S[U5S35e[[U55[U5:wa[ S[U5S35eUnUnOU[R[R4;a[U5nUnOSUR[R[4;a[ S [U535e[!X5 [U5nUnURcU4OS nUR#UR$X@R&-[)UR*5UUUUR,UR.S 9$) NrXrYrZc3<># UHn[UT5v M g7fr)rqr]s rr?,_ProtocolMeta.__getitem__..ds?1;q#..sc3V# UHn[U[R5v M! g7frrcrds rr?rfrerfzParameters to z [...] must all be type variablesz[...] must all be uniquez%Cannot subscript already-subscripted rD)rrrrr)rrrrprgrrTr#r6rArrr0rrrrrrRrrr*rr-)rHrhrrprependr_s @rru_ProtocolMeta.__getitem__Zsfe,, eDk=():):(;;PQSS>C???F11I&III#(d 4TUWWs6{#s6{2#(d 4LMOO&,,88"6*V^^X$>>"GT | TUUt,"6*!%!8tgbG>>$--")NN":"0"?(-'+)-(,-1-@-@"B Br)r+r,r-rr.rr)NNNNN)rRrSrTrUrVrrrJrOrprrurWrrs@rrLrLsC PT> @* 3X H C0   % B % Brc&\rSrSrSrSrSrSrSrg)r6iaBase class for protocol classes. Protocol classes are defined as:: class Proto(Protocol): def meth(self) -> int: ... Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing), for example:: class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check See PEP 544 for details. Protocol classes decorated with @typing_extensions.runtime act as simple-minded runtime protocol that checks only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:: class GenProto(Protocol[T]): def meth(self) -> T: ... rDTc[U5[La [S5e[R"UR U/UQ70UD6$)NzIType Protocol cannot be instantiated; it can be used only as a base class)rr6rrprr,rs rrrVsFSzX%!FGG&&s':':CO$O$O OrN) rRrSrTrUrVrr(rrWrDrrr6r6s 8   Prr8c~[U[5(aUR(d[SU<35eSUlU$)a Mark a protocol class as a runtime protocol, so that it can be used with isinstance() and issubclass(). Raise TypeError if applied to a non-protocol class. This allows a simple-minded structural check very similar to the one-offs in collections.abc such as Hashable. z@@runtime_checkable can be only applied to protocol classes, got T)rrLr(rr)rs rr8r8sB#}--S5E5E$$'7,- -#'  rr/cD\rSrSrSr\R S\4Sj5rSr g)r/irDreturncgrrDris r __index__SupportsIndex.__index__s rN) rRrSrTrUrrr intrrWrDrrr/r/s&   s   r)r rac[R"S5RSS;a [S5eg![[ 4a gf=f)NrrRrz4TypedDict does not support instance and class checksF)rrrrAttributeError ValueError)rrs r _check_failsrs_ }}Q))*5>HH VWW H +   s26A A cNU(d [S5eUSUSSp[U0UD6$)N)TypedDict.__new__(): not enough argumentsrr)rr )rrH_s r _dict_newrs2GH Hq'484T$V$$rz,($cls, _typename, _fields=None, /, **kwargs)totalcU(d [S5eUSUSSpU(a USUSSpOF ,- - f . "}}Q/99==j*UB| hB<<3 .!<[TU]XU5 gr)rr)rrrrrrs rr_TypedDictMeta.__init__s G T" -rc f>US:Xa[O[US'[TU] X[4U5n0nUR S05n[ UR55nSn UR5V V s0sHupU [R"X5_M nn n [ 5n [ 5n UHnURURR S055 U RURR SS55 U RURR SS55 M URU5 U(aU RU5 OU RU5 Xel [U 5Ul[U 5Ul[#US5(dXElU$s sn n f) Nr.rr$z?TypedDict('Name', {f0: t0, f1: t1, ...}); each t must be a type__required_keys__rD__optional_keys__ __total__)rrrrr rr0r3itemsrprqrr*r$ frozensetrrrr)rrrrrtp_dictr8own_annotationsown_annotation_keysr_nr required_keys optional_keysr7rs rr_TypedDictMeta.__new__sz/3k.ANyByMgoc$"=GK ff%6;O"%o&:&:&<"= SC[U[5(aURU-nURn[TU]X5 X lgr)rr __metadata__rrr)rHrmetadatars rr_AnnotatedAlias.__init__vs>&/22!..9** G V , ( rcX[U5S:XdeUSn[X R5$)Nrr)rrr)rHrhnew_types r copy_with_AnnotatedAlias.copy_with}s.v;!# ##ayH"8->->? ?rcS[R"UR5SSRSUR55S3$)Nztyping_extensions.Annotated[rc38# UHn[U5v M g7frrrs rr?+_AnnotatedAlias.__repr__..s D2CQa2Cr{r)rprrrrris rrj_AnnotatedAlias.__repr__sE263D3DT__3U2VVXyy D$2C2C DDEQH Ircb[R[UR4UR-44$r)operatorgetitemr0rrris r __reduce___AnnotatedAlias.__reduce__s1##DOO-0A0AA& rc[U[5(d[$URUR:wagURUR:H$)NF)rrrrrrs rr_AnnotatedAlias.__eq__sAe_55%%%"2"22$$(:(:: :rcD[URUR45$r)rrrris rr_AnnotatedAlias.__hash__s$*;*;<= =r)r) rRrSrTrUrVrrrjrrrrWrrs@rrrns-  ) @  I   ; > >rrcL\rSrSrSrSrSr\RS5r Sr Sr g)r0iaAdd context specific metadata to a type. Example: Annotated[int, runtime_check.Unsigned] indicates to the hypothetical runtime_check module that this type is an unsigned int. Every other consumer of this type can ignore this metadata and treat this type as int. The first argument to Annotated must be a valid type (and will be in the __origin__ field), the remaining arguments are kept as a tuple in the __extra__ field. Details: - It's an error to call `Annotated` with less than two arguments. - Nested Annotated are flattened:: Annotated[Annotated[T, Ann1, Ann2], Ann3] == Annotated[T, Ann1, Ann2, Ann3] - Instantiating an annotated type is equivalent to instantiating the underlying type:: Annotated[C, Ann1](5) == C(5) - Annotated can be used as a generic type alias:: Optimized = Annotated[T, runtime.Optimize()] Optimized[int] == Annotated[int, runtime.Optimize()] OptimizedList = Annotated[List[T], runtime.Optimize()] OptimizedList[int] == Annotated[List[int], runtime.Optimize()] rDc[S5e)Nz&Type Annotated cannot be instantiated.rFrrrHs rrAnnotated.__new__sDE Erc[U[5(a[U5S:a [S5eSn[R "USU5n[USS5n[ X45$)NrazUAnnotated[...] should be used with at least two arguments (a type and an annotation).$Annotated[t, ...]: t must be a type.rr)rrrrrprqr)rrhr_rrs rrjAnnotated.__class_getitem__scfe,,F a!/009C''q 37FVABZ(H"64 4rc4[SURS35e)NCannot subclass z .Annotated)rrSrs rrAnnotated.__init_subclass__s "3>>"2*= rN) rRrSrTrUrVrrrprrjrrWrDrrr0r0s4 @  F    5  5 rc:[U[5(a[UR5$[U[R 5(aQ[ SUR55nXR:XaU$URU5nURUl U$U$)z2Strips the annotations from a given type. c38# UHn[U5v M g7fr)_strip_annotationsrs rr?%_strip_annotations..s!LA"4Q"7"7r{) rrr!rrprrrr+r_special)rr stripped_argsrs rr!r!sy a ) )%all3 3 a-- . .!!L!LLM *++m,C::CLJrc[R"XUS9nU(aU$UR5VVs0sHupVU[U5_M snn$s snnf)aReturn type hints for an object. This is often the same as obj.__annotations__, but it handles forward references encoded as string literals, adds Optional[t] if a default value equal to None is set and recursively replaces all 'Annotated[T, ...]' with 'T' (unless 'include_extras=True'). The argument may be a module, class, method, or function. The annotations are returned as a dictionary. For classes, annotations include also inherited members. TypeError is raised if the argument is not of a type that can contain annotations, and an empty dictionary is returned if no annotations are present. BEWARE -- the behavior of globalns and localns is counterintuitive (unless you are familiar with how eval() and exec() work). The search order is locals first, then globals. - If no dict arguments are passed, an attempt is made to use the globals from obj (or the respective module's globals for classes), and these are also used as the locals. If the object does not appear to have globals, an empty dictionary is used. - If one dict argument is passed, it is used for both globals and locals. - If two dict arguments are passed, they specify globals and locals, respectively. )rr)rpr?rr!)rIrrinclude_extrashintkrrs rr?r?sI>$$SWM K59ZZ\B\TQ%a((\BBBsAc~[U5S:=(a) URS5=(a URS5$)z3Returns True if name is a __dunder_variable_name__.__)rr4endswithrs r _is_dunderr-s,4y1}N!6N4==;NNrc^\rSrSrSrU4Sjr\S5rSrSU4Sjjr Sr \ RU4Sj5r S rS rU4S jrS rS rSrU=r$) AnnotatedMetaizMetaclass for Annotatedc >[SU55(a[S[[5-5e[TU]"XX#40UD6$)Nc30# UH o[Lv M g7fr)rrs rr?(AnnotatedMeta.__new__.. s2EqF?Err)rrrpr0rr)rrrrrHrs rrAnnotatedMeta.__new__ s?2E222 2S^ CDD7?3eI&I Irc(UR5S$)Nra)rris rrAnnotatedMeta.__metadata__s??$Q' 'rcUup#n[U[5(d[R"U5nOUSR U5nSR SU55nUSUSUS3$)Nrrc38# UHn[U5v M g7frr )r>args rr?+AnnotatedMeta._tree_repr..s&EHStCyyHr{rr)rrrpr _tree_reprr)rHtreerrrtp_reprmetadata_reprss rr:AnnotatedMeta._tree_reprsk$( !Cfe,, ++F3 )..v6!YY&EH&EENU!G9B~&6a8 8rc>U[La[$[TU] XS9n[US[5(a-USS[LaUSSnUSSn[XEUS-4$U$)N)rrrrra)r0rrrr)rHrrrsub_tp sub_annotrs rrAnnotatedMeta._subs_treesvy   '$5$>JrcURc [S5eUR5n[U[5(a4US[ La(USn[U[5(aUS[ LaM([U[5(aUS$U$)z6Return the class used to create instance of this type.zCCannot get the underlying type of a non-specialized Annotated type.rr)rrrrrr0)rHr;s r _get_consAnnotatedMeta._get_cons's&!BCC??$DT5))d1g.BAwT5))d1g.B$&&Aw rc >[U[5(dU4nURb[TU]U5$[U[5(a[ U5S:a [ S5eSn[R"USU5n[USS5nURURUR[UR5[U45X44US9$)Nraz]Annotated[...] should be instantiated with at least two arguments (a type and an annotation).rrr)rrr)rrrrrurrrprqrrRrrr*r)rHrhr_rrrs rruAnnotatedMeta.__getitem__4sfe,, *w*622..#f+/!/00=''q 37 ,>> t}}- "'^" rcfUR5nU"U0UD6nXlU$![a U$f=fr)rD__orig_class__r)rHrrHconsresults r__call__AnnotatedMeta.__call__LsH>>#D4*6*F (,%M" M s " 00cURb*[U5(d[UR5U5$[ U5er)rr-r1rDr)rHr9s r __getattr__AnnotatedMeta.__getattr__Us5*:d3C3Ct~~/66 & &rc>[U5(dURS5(a[TU] X5 gURc [ U5e[ UR5X5 g)Nr%)r-r4rrrrsetattrrD)rHr9valuers rrAnnotatedMeta.__setattr__[sO$4??7#;#;#D0($T**($6rc[S5e)Nz+Annotated cannot be used with isinstance().rFrGs rrJAnnotatedMeta.__instancecheck__cIJ Jrc[S5e)Nz+Annotated cannot be used with issubclass().rFrNs rrOAnnotatedMeta.__subclasscheck__frWrrD)NN)rRrSrTrUrVrpropertyrr:rrDrprrurLrOrrJrOrWrrs@rr/r/sj% J  (  ( 9        .  '  7 K K Krr/c\rSrSrSrSrg)r0iiaAdd context specific metadata to a type. Example: Annotated[int, runtime_check.Unsigned] indicates to the hypothetical runtime_check module that this type is an unsigned int. Every other consumer of this type can ignore this metadata and treat this type as int. The first argument to Annotated must be a valid type, the remaining arguments are kept as a tuple in the __metadata__ field. Details: - It's an error to call `Annotated` with less than two arguments. - Nested Annotated are flattened:: Annotated[Annotated[T, Ann1, Ann2], Ann3] == Annotated[T, Ann1, Ann2, Ann3] - Instantiating an annotated type is equivalent to instantiating the underlying type:: Annotated[C, Ann1](5) == C(5) - Annotated can be used as a generic type alias:: Optimized = Annotated[T, runtime.Optimize()] Optimized[int] == Annotated[int, runtime.Optimize()] OptimizedList = Annotated[List[T], runtime.Optimize()] OptimizedList[int] == Annotated[List[int], runtime.Optimize()] rDNrRrSrTrUrVrWrDrrr0r0is r)r )_BaseGenericAlias) GenericAliasc[U[5(a[$[U[R[ [ [[45(a UR$U[RLa[R$g)aGet the unsubscripted version of a type. This supports generic types, Callable, Tuple, Union, Literal, Final, ClassVar and Annotated. Return None for unsupported types. Examples:: get_origin(Literal[42]) is Literal get_origin(int) is None get_origin(ClassVar[int]) is ClassVar get_origin(Generic) is Generic get_origin(Generic[T]) is Generic get_origin(Union[T, int]) is Union get_origin(List[Tuple[T, T]][int]) == list get_origin(P.args) is P N) rrr0rprrr_r^ ParamSpecArgsParamSpecKwargsrr#)rs rr>r>s` b/ * *  b6//?P(/; < <==  >> !rcx[U[5(aUR4UR-$[U[R [ 45(af[USS5(agURn[U5[RRLaUS[La[USS5US4nU$g)aGet type arguments with all substitutions performed. For unions, basic simplifications used by Union constructor are performed. Examples:: get_args(Dict[str, int]) == (str, int) get_args(int) == () get_args(Union[int, Union[T, int], str][int]) == (int, str) get_args(Union[int, Tuple[T, int]][str]) == (int, Tuple[str, int]) get_args(Callable[[], T][int]) == ([], int) r#FrDrNr")rrrrrprrr_r1r+r>rrrEllipsisr2)rrs rr=r=s b/ * *MM#boo5 5 b6//> ? ?r:u--++C"~!9!99c!fH>TCH~s2w/Jrr:)rrc\rSrSrSrSrg)_TypeAliasFormic SUR-$rfrgris rrj_TypeAliasForm.__repr__rlrrDNrRrSrTrUrjrWrDrrrfrf 5rrfc[US35e)Special marker indicating that an assignment should be recognized as a proper type alias definition by type checkers. For example:: Predicate: TypeAlias = Callable[..., bool] It's invalid when used anywhere except as in the example above.  is not subscriptablerFrs rr:r:s4& 5677rc\rSrSrSrSrg)rfic SUR-$rfrgris rrjrhrlrrDNrirDrrrfrfrjraSpecial marker indicating that an assignment should be recognized as a proper type alias definition by type checkers. For example:: Predicate: TypeAlias = Callable[..., bool] It's invalid when used anywhere except as in the example above.c\rSrSrSrSrSrg)_TypeAliasMetaizMetaclass for TypeAliascgNztyping_extensions.TypeAliasrDris rrj_TypeAliasMeta.__repr__0rrDNrRrSrTrUrVrjrWrDrrrqrqs % 1rrqc.\rSrSrSrSrSrSrSrSr g)_TypeAliasBaseirlrDc[S5e)Nz+TypeAlias cannot be used with isinstance().rFrGs rrJ _TypeAliasBase.__instancecheck__rWrc[S5e)Nz+TypeAlias cannot be used with issubclass().rFrNs rrO _TypeAliasBase.__subclasscheck__ rWrcgrsrDris rrj_TypeAliasBase.__repr__ rurN) rRrSrTrUrVrrJrOrjrWrDrrrxrxs   K K 1rrx)rrYrac(\rSrSrSrSrSrSrSrg) _Immutableiz3Mixin to indicate that object should not be copied.rDcU$rrDris r__copy___Immutable.__copy__rrcU$rrD)rHmemos r __deepcopy___Immutable.__deepcopy__ rrN) rRrSrTrUrVrrrrWrDrrrrsA   rrc$\rSrSrSrSrSrSrg)rai#a!The args for a ParamSpec object. Given a ParamSpec object P, P.args is an instance of ParamSpecArgs. ParamSpecArgs objects have a reference back to their ParamSpec: P.args.__origin__ is P This type is meant for runtime introspection and has no special meaning to static type checkers. cXlgrrrHrs rrParamSpecArgs.__init__/rrc4URRS3$)Nz.argsrrRris rrjParamSpecArgs.__repr__2soo../u5 5rrNrRrSrTrUrVrrjrWrDrrrara#s  % 6rc$\rSrSrSrSrSrSrg)rbi5a+The kwargs for a ParamSpec object. Given a ParamSpec object P, P.kwargs is an instance of ParamSpecKwargs. ParamSpecKwargs objects have a reference back to their ParamSpec: P.kwargs.__origin__ is P This type is meant for runtime introspection and has no special meaning to static type checkers. cXlgrrrs rrParamSpecKwargs.__init__Arrc4URRS3$)Nz.kwargsrris rrjParamSpecKwargs.__repr__Dsoo../w7 7rrNrrDrrrbrb5s  % 8rrbrc^\rSrSrSr\R r\S5r \S5r SSSS.U4Sjjr S r S r S rS rS r\(d SrSrU=r$SrU=r$)riNaParameter specification variable. Usage:: P = ParamSpec('P') Parameter specification variables exist primarily for the benefit of static type checkers. They are used to forward the parameter types of one callable to another callable, a pattern commonly found in higher order functions and decorators. They are only valid when used in ``Concatenate``, or s the first argument to ``Callable``. In Python 3.10 and higher, they are also supported in user-defined Generics at runtime. See class Generic for more information on generic types. An example for annotating a decorator:: T = TypeVar('T') P = ParamSpec('P') def add_logging(f: Callable[P, T]) -> Callable[P, T]: '''A type-safe decorator to add logging to a function.''' def inner(*args: P.args, **kwargs: P.kwargs) -> T: logging.info(f'{f.__name__} was called') return f(*args, **kwargs) return inner @add_logging def add_two(x: float, y: float) -> float: '''Add two numbers together.''' return x + y Parameter specification variables defined with covariant=True or contravariant=True can be used to declare covariant or contravariant generic types. These keyword arguments are valid, but their actual semantics are yet to be decided. See PEP 612 for details. Parameter specification variables can be introspected. e.g.: P.__name__ == 'T' P.__bound__ == None P.__covariant__ == False P.__contravariant__ == False Note that only parameter specification variables defined in global scope can be pickled. c[U5$r)raris rrParamSpec.argss  & &rc[U5$r)rbris rrHParamSpec.kwargss "4( (rNF)boundr^r`ct>[TU]U/5 Xl[U5Ul[U5UlU(a[ R"US5UlOSUl[R"S5RRSS5nUS:waXPlgg![[4a SnN"f=f)NzBound must be a type.rrRrtyping_extensions)rrrRbool __covariant____contravariant__rprq __bound__rrrrrrrS)rHrrr^r`def_modrs rrParamSpec.__init__s G dV $ M!%iD %)-%8D "!'!3!3E;R!S!% --*4488ZP--").#J/  s$0B""B76B7crUR(aSnOUR(aSnOSnXR-$)N+-~)rrrR)rHprefixs rrjParamSpec.__repr__s0!!''MM) )rc,[RU5$r)rrris rrParamSpec.__hash__s??4( (rcXL$rrDrs rrParamSpec.__eq__s = rcUR$r)rRris rrParamSpec.__reduce__s == rcgrrDrGs rrLParamSpec.__call__ rc2X;aURU5 ggr)appendrHrs r_get_type_varsParamSpec._get_type_varss$LL&%r)rrrrSrR)rRrSrTrUrVrprrrZrrHrrjrrrrLPEP_560rrWrrs@rrrNsz, ^NN  '  '  )  )+/%u * *$ * ) ! !  ' 'rrc^\rSrSr\(a \R rO \RrSr \Rr U4Sjr Sr SrSr\S5r\(d SrS rU=r$S rU=r$) _ConcatenateGenericAliasiFc<>[TU]U5 XlX lgr)rrrr+)rHrrrs rr!_ConcatenateGenericAlias.__init__s G T "$O Mrc^[RmT"UR5SSRU4SjUR55S3$)Nrrc34># UH nT"U5v M g7frrD)r>r8rs rr?4_ConcatenateGenericAlias.__repr__..s!K]c*S//]sr)rprrrr+)rHrs @rrj!_ConcatenateGenericAlias.__repr__sF**J!$//23 !KT]]!KKLAO PrcD[URUR45$r)rrr+ris rr!_ConcatenateGenericAlias.__hash__s$--89 9rcgrrDrGs rrL!_ConcatenateGenericAlias.__call__rrc:[SUR55$)Nc3t# UH.n[U[R[45(dM*Uv M0 g7fr)rrprr)r>rs rr?:_ConcatenateGenericAlias.__parameters__..s'*rjfnni=X.Y]s)8 8)rr+ris rr'_ConcatenateGenericAlias.__parameters__s !]] rcUR(a4UR(a"[R"URU5 gggr)rrrprrs rr'_ConcatenateGenericAlias._get_type_varss.??t':':))$*=*=uE(;?r)r+r)rRrSrTrUrrprrr _TypingBaser#r#rrrjrrLrZrrrWrrs@rrrsm ,,I**I !  P  :       F Frrc^US:Xa [S5e[U[5(dU4n[US[5(d [S5eSm[U4SjU55n[ X5$)NrDz&Cannot take a Concatenate of no types.r"zAThe last parameter to Concatenate should be a ParamSpec variable.z/Concatenate[arg, ...]: each arg must be a type.c3R># UHn[R"UT5v M g7frr\r]s rr?'_concatenate_getitem..s!F:av))!S11:ra)rrrrr)rHrr_s @r_concatenate_getitemrsnR@AA j% ( ( ] jni 0 0./ / ;CF:FFJ #D 55rc[X5$)Used in conjunction with ``ParamSpec`` and ``Callable`` to represent a higher order function which adds, removes or transforms parameters of a callable. For example:: Callable[Concatenate[int, P], int] See PEP 612 for detailed information. rrs rrrs$D55rc \rSrSrSrSrSrg)_ConcatenateFormi c SUR-$rfrgris rrj_ConcatenateForm.__repr__ rlrc[X5$rrrs rru_ConcatenateForm.__getitem__  '9 9rrDNrwrDrrrr s  5 :rra&Used in conjunction with ``ParamSpec`` and ``Callable`` to represent a higher order function which adds, removes or transforms parameters of a callable. For example:: Callable[Concatenate[int, P], int] See PEP 612 for detailed information. c\rSrSrSrSrSrg)_ConcatenateAliasMetaizMetaclass for Concatenate.cgNztyping_extensions.ConcatenaterDris rrj_ConcatenateAliasMeta.__repr__!2rrDNrvrDrrrrs ( 3rrc4\rSrSrSrSrSrSrSrSr Sr g) _ConcatenateAliasBasei$rrDc[S5e)Nz-Concatenate cannot be used with isinstance().rFrGs rrJ'_ConcatenateAliasBase.__instancecheck__3KL Lrc[S5e)Nz-Concatenate cannot be used with issubclass().rFrNs rrO'_ConcatenateAliasBase.__subclasscheck__6rrcgrrDris rrj_ConcatenateAliasBase.__repr__9rrc[X5$rrrs rru!_ConcatenateAliasBase.__getitem__<rrN) rRrSrTrUrVrrJrOrjrurWrDrrrr$s$   M M 3 :rrr;c\rSrSrSrSrg)_TypeGuardFormiFc SUR-$rfrgris rrj_TypeGuardForm.__repr__GrlrrDNrirDrrrrFrjrrcb[R"XS35n[R"X45$)Special typing form used to annotate the return type of a user-defined type guard function. ``TypeGuard`` only accepts a single type argument. At runtime, functions marked this way should return a boolean. ``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static type checkers to determine a more precise type of an expression within a program's code flow. Usually type narrowing is done by analyzing conditional code flow and applying the narrowing to a block of code. The conditional expression here is sometimes referred to as a "type guard". Sometimes it would be convenient to use a user-defined boolean function as a type guard. Such a function should use ``TypeGuard[...]`` as its return type to alert static type checkers to this intention. Using ``-> TypeGuard`` tells the static type checker that for a given function: 1. The return value is a boolean. 2. If the return value is ``True``, the type of its argument is the type inside ``TypeGuard``. For example:: def is_str(val: Union[str, float]): # "isinstance" type guard if isinstance(val, str): # Type of ``val`` is narrowed to ``str`` ... else: # Else, type of ``val`` is narrowed to ``float``. ... Strict type narrowing is not enforced -- ``TypeB`` need not be a narrower form of ``TypeA`` (it can even be a wider form) and this may lead to type-unsafe results. The main reason is to allow for things like narrowing ``List[object]`` to ``List[str]`` even though the latter is not a subtype of the former, since ``List`` is invariant. The responsibility of writing type-safe type guards is left to the user. ``TypeGuard`` also works with type variables. For more information, see PEP 647 (User-Defined Type Guards). r)rprqrrrss rr;r;Js0X!!*6P.QR##D'22rc \rSrSrSrSrSrg)rizc SUR-$rfrgris rrjr|rlrcx[R"UURS35n[R"X45$)Nz accepts only a single typerorss rru_TypeGuardForm.__getitem__s7%%j)- 4O&PRD''g6 6rrDNrwrDrrrrzrxra Special typing form used to annotate the return type of a user-defined type guard function. ``TypeGuard`` only accepts a single type argument. At runtime, functions marked this way should return a boolean. ``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static type checkers to determine a more precise type of an expression within a program's code flow. Usually type narrowing is done by analyzing conditional code flow and applying the narrowing to a block of code. The conditional expression here is sometimes referred to as a "type guard". Sometimes it would be convenient to use a user-defined boolean function as a type guard. Such a function should use ``TypeGuard[...]`` as its return type to alert static type checkers to this intention. Using ``-> TypeGuard`` tells the static type checker that for a given function: 1. The return value is a boolean. 2. If the return value is ``True``, the type of its argument is the type inside ``TypeGuard``. For example:: def is_str(val: Union[str, float]): # "isinstance" type guard if isinstance(val, str): # Type of ``val`` is narrowed to ``str`` ... else: # Else, type of ``val`` is narrowed to ``float``. ... Strict type narrowing is not enforced -- ``TypeB`` need not be a narrower form of ``TypeA`` (it can even be a wider form) and this may lead to type-unsafe results. The main reason is to allow for things like narrowing ``List[object]`` to ``List[str]`` even though the latter is not a subtype of the former, since ``List`` is invariant. The responsibility of writing type-safe type guards is left to the user. ``TypeGuard`` also works with type variables. For more information, see PEP 647 (User-Defined Type Guards). cR^\rSrSrSrSrS SjrSrSrU4Sjr Sr S r Sr U=r $) _TypeGuardirr}c Xlgrr}rs rr_TypeGuard.__init__rrc[U5nURc,U"[R"UURSSS35SS9$[ URSSS35e)Nrz accepts only a single type.TrXrrrs rru_TypeGuard.__getitem__smt*C}}$6--d!ll12.//KLN!%''s||AB/00NOP Prc[R"URX5nX0R:XaU$[U5"USS9$rrrs rr_TypeGuard._eval_typerrc>[TU]5nURb'US[R"UR5S3- nU$rrrs rrj_TypeGuard.__repr__rrcV[[U5RUR45$rrris rr_TypeGuard.__hash__rrc[U[5(d[$URbURUR:H$XL$r)rrrr~rs rr_TypeGuard.__eq__s:eZ00%%}}(}}66= rrrrs@rrrs4) V"   Q 2    > ! !rrr cx\rSrSrSrSrSrSrSrSr Sr S r S r S r S r\R S 5rSrg) _SpecialFormi)rhrV_getitemcTXlURUlURUlgr)rrRrhrV)rHrs rr_SpecialForm.__init__ s#M ))DJ"??DLrc<US;a UR$[U5e)N>rRrT)rhr)rHrts rrO_SpecialForm.__getattr__s 33zz! & &rc [SU<35e)NrrF)rHrs r__mro_entries___SpecialForm.__mro_entries__s.th78 8rc SUR3$rfrgris rrj_SpecialForm.__repr__s' |4 4rcUR$rrgris rr_SpecialForm.__reduce__s :: rc [SU<35e)NzCannot instantiate rF)rHrrs rrL_SpecialForm.__call__s1$:; ;rc*[RX4$rrpUnionrs r__or___SpecialForm.__or__!s<< , ,rc*[RX4$rrrs r__ror___SpecialForm.__ror__$s<< , ,rc[US35e)Nz! cannot be used with isinstance()rFrGs rrJ_SpecialForm.__instancecheck__'tf$EFG Grc[US35e)Nz! cannot be used with issubclass()rFrNs rrO_SpecialForm.__subclasscheck__*rrc$URX5$r)rrs rru_SpecialForm.__getitem__-s==2 2r)rVrrhN)rRrSrTrUrrrOr rjrrLrrrJrOrprrurWrDrrrrsU4  +  '  9 5  < - - H H    3  3rrc[US35e)Used to spell the type of "self" in classes. Example:: from typing import Self class ReturnsSelf: def parse(self, data: bytes) -> Self: ... return self rmrF)rHrhs rr r 1s4& 5677rc(\rSrSrSrSrSrSrSrg)_SelfiBr#rDc[US35e)Nz" cannot be used with isinstance().rFrGs rrJ_Self.__instancecheck__Rtf$FGH Hrc[US35e)Nz" cannot be used with issubclass().rFrNs rrO_Self.__subclasscheck__Ur(rNrQrDrrr%r%Bs   I Irr%Requiredc\rSrSrSrSrg)_ExtensionsSpecialFormi_c SUR-$rfrgris rrj_ExtensionsSpecialForm.__repr__`rlrrDNrirDrrr-r-_rjrr-cv[R"XRS35n[R"X45$)A special typing construct to mark a key of a total=False TypedDict as required. For example: class Movie(TypedDict, total=False): title: Required[str] year: int m = Movie( title='The Matrix', # typechecker error if key is omitted year=1999, ) There is no runtime checking that a required key is actually provided when instantiating a related TypedDict. rnrorss rr+r+cs3"!!* #VCLL$457 7rc[R"URX5nX0R:XaU$[U5"USS9$rrrs rr_MaybeRequired._eval_typerrc>[TU]5nURb2USR[R "UR55- nU$)Nz[{}])rrjr~r:rprrs rrj_MaybeRequired.__repr__sA "A}}(V]]6#4#4T]]#CDDHrcV[[U5RUR45$rrris rr_MaybeRequired.__hash__rrc[U[U55(d[$URbURUR:H$XL$r)rrrr~rs rr_MaybeRequired.__eq__s>eT$Z00%%}}(}}66= rr) rRrSrTrUrrrurrjrrrWrrs@rr=r=s+!   7 2    > ! !rr=c\rSrSrSrSrg) _Requiredir1rDNr\rDrrrKrKs rrKc\rSrSrSrSrg) _NotRequiredir3rDNr\rDrrrMrMs rrM)NNF)rrcollections.abcr rrp version_inforrrrrr__all__extendrr@_FinalTypingBaserBrrZr[r\r]r_rrrrcr{r1r2r3rr_overload_dummyr5r!rr"r%r$r#r+rMutableSequencer)r'_collections_abcrrr#r,r-_aliasMutableMappingr*Dictrr(r&r4r9r<rrr:rBr6rCrIrrLrrqr8r7r/r.rr__text_signature__rrr rRrSrVr0r?rrrr!r-r/r>r=r^ ImportErrorr_r:rfrrqrxrarbrrr2rrrrrrrr;rrr r%r+r4r-r6r=rKrMrDrrr[sb     2A ) + K/ <+ Z  NN?@ 6:HJF++4J(t$H NN3 ^^D ^^D ~~f- >>*D 9 ?? 67 0 0! 4 > LLEbqV#7V((7 w L ME 1!((1!f  E 67 LLE.  69nnGbqV#:v**$:9 1 2G,!6**$,!\T"G(( ??{{ [6       $$ $$  67 LLEN !!6#9#9!#<0!''N&& 6()) 44I"fnnT2"    6=!!$$K#""2A&22-- 7 7"bBK Tk--v/D/DRV/L 6'33 T 69nnG P+%%++af%2+:M:M P 6:H [*%% Q;'')>)>r2v)F3$-- Q 6#$$**Nt,fnnT8^.L#9*== .. {{$$ = &X  6:H )@7 7$]$]]$@1@B BB$P]$PP 6&''00   6?##((My   I % $RI $(*=X*HN%*=*=X{TGR8I#I @ 6;  I**N,,O %>&..d%>N44l "CLO`K**`KD m FBQ7"""JH 1,,'00 6;  IbqV#5,,D5 8 8 bqV#5,,D5{ $) *I1**1 100NRV1,T*I 6?##((M,,O6 6$8*8& 6;  I f'Df'Tv}%%(F4(FX 6 6 6=!!$$K%>>bqV# 6 6 bqV#:6..d:#   K3 1 13 : 7 7*?&*:6(d3K 6;  IbqV#5,,D5,3,3\ bqV#7,,D7) + I\M!V,,DM!^&I 66 ;;DbqV#(3v}}D(3T88 I''tI, t D 6:H$$KbqV#5!4!4D533&33  bqV#7++47  H"    K #!00#!J N$ "  ~T  t$HT*KI 1"001 ,++ ,s$h"h.h+*h+.ii