2bijSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK r SSK r /SQr Sr \ r"SS5r\"5r\4Sjr\R$S:aSrO\R$S :aS rOS rSS jr\ R*r\ R,"S 5r\ R,"S5r\ R,"S5r\ R,"SSS9r\ R,"SSS9r\R$S:aSSK Jr O"SS\ 5r"SS\S9r\ R<r"SS\ R>SS9r \!"\ S5(a \R$SSS :a \ RDr"O"S!S"\ SS9r#\#"SS#S$9r"\R$S:a \ RHr$OS%r$S&r%\R$S':a \ RLr&O*S(r'S)r("S*S+\ RRSS9r*"S,S-\ SS9r+\+"S.S$9r&\ RXr,\!"\ S/5(a%\ RZr-\ R\r.\ R^r/O6\R`"\Rb"\R`\255r3S0r-S1r.S2r/\ Rhr4\ Rjr5\ Rlr6\ Rnr7\ Rpr8\ Rrr9\ Rtr:\ Rvr;\ Rxr<\!"\ S35(a \ Rzr=O\ R|"\Rz\\45r=\ R~r?\ Rr@\ RrA\ RrB\ RrC/S4QS5S6/S7/S8.rD1S9krE\R$S::a\E1S;k-rE\R$S :a\ERS<5 \R$S=:a\ERS>5 \G"\E5rES?rHS@rISSAjrJ\R$S=:a \ RrKO|SSBjrLSCrM\R$S::a\ RrN\ "\N5rOO\rN\RrO"SDSE\O5rQ\RSF5rS\R$S::a"SGSH\ R\QS9rKO "SISH\QS9rK\R$S::a \ RrUOSJrU\UrV\R$S=:aU\ RrW\ RrX\ RrY\ RrZ\ Rr[\ Rr\\ Rr]Ov\U"SKSL\K55rW\U"SMSN\K55rX\U"SOSP\K55rY\U"SQSR\K55rZ\U"SSST\K55r[\U"SUSV\K\55r\\U"SWSX\K\55r]SYr^\R$SZ:a%\ Rr_\ Rr`\ RraOS[\R"\ R5R;re\R$S::aSHrfOS\rf"S]S^\ 5r`\ R\`S_S`05rh\^"Sa5\4SSb.Scjj5r_\!"\ S^5(a\ R\`4riO\`4riSdra\!"\ Se5(a \ RrjOSfrj\!"\ Sg5(a \ RrkOShrlSSjjrk\!"\ Sk5(a\ Rrm\ RrnO"SlSm\ RRSS9rn"SnSk5rm\R$SSS:a\ Rro\ RrpOSSoK Jqrq SSpK Jsrt SqroSrrp\!"\ Ss5(a \ RruO#\R$SSS :a \ St5ruO\ "SsSuS$9ruSvrvSwrw"SxSy5rx"SzS{\ 5ry"S|S}\yS9r\!"\ S~5(a\ Rrz\ Rr{O "SS5r|"SS~\|5rz"SS\|5r{\!"\ S5(a "SS\yS9r}O "SS\~\x5r}\!"\ S5(d "SS\~5r\ GRS5r\!"\ S5(a\ GRr\ RrO-\R$SSS :a \ S5rO"SS\ SS9r\"SSS$9r\!"\ S5(a\ GRrO-\R$SSS :a \ S5rO"SS\ SS9r\"SSS$9r"SS\ GR SS9r\!"\ S5(a\ GRrO\S5r\!"\ S5(a\ GRrO\S5r\!"\ S5(a\ GRrO\S5r\!"\ Sg5(a\ GRr\ GRrO<\R$SSS :a\ S5r\ S5rO"SS\ SS9r\"SgSS$9r\"SSS$9rSr\R$S=:a\ GRrSrOe\R$SSS :a*"SS\ SS9r"SS\ RRSS9r\S5rSrO("SS\ RRSS9r"SS\ SS9r\"S\S$9rSr\!"\ S5(a "SS\yS9rO "SS\x5r\!"\ S5(a\ GR(rO S\S\4Sjr\!"\ S5(a\ GR*rO S\S\4Sjr\R$S=:a\ GR,rOSSiSiSiS`S.S\S\S\S\S\ GR0\ GR2\ Rh\ R8\ GR4S\ R844S4S\ R8S\ GR4\/\44Sjjr\!"\ S5(a\ GR6rO4\ R,"S\ GR4S\ R84S9rS\S\4Sjr\!"\ S5(a\ GR:rOP\ R,"S5r\SS.S\S\ GRB\ Rh\S\S\ GR4\/\44Sjjr\!"\ S5(d\\ l\\ l\R$SZ:a\ GRHrOSSjr\ GRLr\G"1Sk5r"SS\ 5r\ R\SS`05rSr\^"\5\4Sj5r\R$S::a5Sr\"\\GR\5(a\\lO\\GR`l\!"\RS75(a\RGRbrOL"SS7\GRd5r\GRg\5 \GRg\5 \GRg\5 \!"\S5(a\GRnrOSr\R$S:a\ GRprO "SS5r\!"\ S5(a\ GRrrO Sr"SS5r\!"\ S5(a\ GRvr\ GRxrO S\ S\4SjrS\ S\ GRz\4Sjr\ GR|r\ GR~r\ GRr\ GR4r\ GRr\ GRr\ GRr\ GRr\ GRzr\ GRr\ RrT\ GRr\ GRr\ GRr\ GRr\ GRr\ GRr\ GRr\ GRr\ GRr\ GRr\ GRr\ GRr\ GRr\ GRBr\ GRr\ GRr\ GRr\ GRr\ GRr\ GRr\ GR0r\ GR2r\ GRr\ GRr\ GRr\ GRrg!\ra \ RRrqGNf=f!\ra \ RRrtGNf=f)N)iAnyClassVar ConcatenateFinal LiteralString ParamSpec ParamSpecArgsParamSpecKwargsSelfTypeTypeVar TypeVarTupleUnpack Awaitable AsyncIterator AsyncIterable CoroutineAsyncGeneratorAsyncContextManagerBufferChainMapContextManagerCounterDeque DefaultDict NamedTuple OrderedDict TypedDict SupportsAbs SupportsBytesSupportsComplex SupportsFloat SupportsIndex SupportsInt SupportsRound Annotated assert_never assert_typeclear_overloadsdataclass_transform deprecated get_overloadsfinalget_args get_originget_original_basesget_protocol_membersget_type_hintsIntVar is_protocol is_typeddictLiteralNewTypeoverloadoverrideProtocol reveal_typeruntimeruntime_checkableText TypeAlias TypeAliasType TypeGuard TYPE_CHECKINGNeverNoReturnRequired NotRequired AbstractSetAnyStrBinaryIOCallable Collection ContainerDict ForwardRef FrozenSet GeneratorGenericHashableIO ItemsViewIterableIteratorKeysViewListMapping MappingViewMatchMutableMappingMutableSequence MutableSetOptionalPattern ReversibleSequenceSetSizedTextIOTupleUnion ValuesViewcast no_type_checkno_type_check_decoratorTc\rSrSrSrSrg) _Sentinelcg)Nz selfs ڏ/builddir/build/BUILDROOT/alt-python313-pip-23.3.1-3.el8.x86_64/opt/alt/python313/lib/python3.13/site-packages/pip/_vendor/typing_extensions.py__repr___Sentinel.__repr__srpN__name__ __module__ __qualname____firstlineno__rt__static_attributes__rprvrsrmrmsrvrmc U(d[US35eU[LaE[US5(aUR(d[US35e[ UR5n[ U5nX2:wa~[US5(aOURVs/sHn[ U5(aMUPM nn[ SU55nUS:a X2U- :ag[SX2:aSOSS US US U35egs snf) zCheck correct count for parameters of a generic cls (internal helper). This gives a nice error message in case of count mismatch. z is not a generic class__parameters__c3B# UHn[U[5v M g7fN) isinstancer.0ps rs !_check_generic..sPZ 1l ; ;ZrNzToo manyfewz parameters for z ; actual z , expected ) TypeError_markerhasattrr~len _is_unpacksum)cls parameterselenalenr num_tv_tupless rs_check_genericrs 3%6788 ws,--S5G5Gse#:;< <3%%& z?D | 3( ) )%(%7%7M%7z!}!%7JMPZPPM!}0D(D$v%@@PQTPUV##'& D6;< < Ms C3+C3 ct[U[R[R[R 45$r)rtyping _GenericAlias_types GenericAlias UnionTypets rs_should_collect_from_parametersrs- $$f&9&96;K;KL  rvr cV[U[R[R45$r)rrrrrrs rsrrs !f22F4G4GHIIrvcf[U[R5=(a UR(+$r)rrr_specialrs rsrrs !V112E1::~ErvcTUc[Rn/nUH~n[X15(a&X2;a![U5(dUR U5 [ U5(dMKUR URVs/sH o3U;dM UPM sn5 M [U5$s snf)zCollect all type variable contained in types in order of first appearance (lexicographic order). For example:: _collect_type_vars((T, List[S, T])) == (T, S) ) rr rrappendrextendr~tuple)types typevar_typestvarsrs rs_collect_type_varsrs  E  q ( ( N1 LLO *1 - - LLQ%5%5H%5%!%5H I <Is < B% B% TKTVTT_co) covariantT_contra) contravariant)r )rc4^\rSrSrU4SjrU4SjrSrU=r$)_AnyMetacJ>U[La [S5e[TU] U5$)Nz6typing_extensions.Any cannot be used with isinstance())rrsuper__instancecheck__)rrobj __class__s rsr_AnyMeta.__instancecheck__s&s{ XYY7,S1 1rvc4>U[Lag[TU] 5$)Nztyping_extensions.Any)rrrt)rrrs rsrt_AnyMeta.__repr__ss{.7#% %rvrp)rxryrzr{rrtr| __classcell__rs@rsrrs 2  & &rvrc,^\rSrSrSrU4SjrSrU=r$)ra9Special type indicating an unconstrained type. - Any is compatible with every type. - Any assumed to have all methods. - All values assumed to be instances of Any. Note that all the above statements are true from the point of view of static type checkers. At runtime, Any should not be used with instance checks. cT>U[La [S5e[TU] "U/UQ70UD6$)NzAny cannot be instantiated)rrr__new__rargskwargsrs rsr Any.__new__s/cz <==7?3888 8rvrp)rxryrzr{__doc__rr|rrs@rsrrs  9 9rvr) metaclassc\rSrSrSrSrg)_ExtensionsSpecialFormc SUR-$Nztyping_extensions._namerqs rsrt_ExtensionsSpecialForm.__repr__s#djj00rvrpNrwrprvrsrrs1rvr)_rootr)rc\rSrSrSrSrg) _FinalFormicx[R"UURS35n[R"X45$N accepts only a single type.r _type_checkrrrrritems rs __getitem___FinalForm.__getitem__7%%j)- 4P&QSD''g6 6rvrpNrxryrzr{rr|rprvrsrr 7rvraWA 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.)doccDSUlU$![[4a U$f=f)ahThis 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. The decorator sets the ``__final__`` attribute to ``True`` on the decorated object to allow runtime introspection. T) __final__AttributeErrorr)fs rsr-r-s5, AK   *      c.[R"U5$r)rr )names rsr3r3<s >>$ rv)rrc/nUHFn[U[5(aURUR5 M5UR U5 MH [ U5$)zJAn internal helper for Literal creation: flatten Literals among parameters)r_LiteralGenericAliasr__args__rr)rparamsrs rs_flatten_literal_paramsrDsGA!122 ajj) a  V}rvc#<# UHnU[U54v M g7fr)type)rrs rs_value_and_type_iterrNsAT!W* sc \rSrSrSrSrSrg)riRc[U[5(d[$[[ UR 55n[[ UR 55nX#:H$r)rrNotImplementedsetrr)rrotherthese_args_dedupedother_args_dedupeds rs__eq___LiteralGenericAlias.__eq__SsIe%9::%%!$%9$--%H!I !$%9%..%I!J %; ;rvcP[[[UR555$r)hash frozensetrrrqs rs__hash___LiteralGenericAlias.__hash__Zs "6t}}"EFG GrvrpN)rxryrzr{rrr|rprvrsrrRs  < Hrvrc(\rSrSrS\4SjrSrSrg) _LiteralFormi]rc.SUlU=UlUlg)Nr6)r_docr)rrrs rs__init___LiteralForm.__init__^s"DJ'* *DI rvc[U[5(dU4n[U5n[[ U55n[ U5n[ U5[ U5:aP/nUH/nXS;dM URUS5 URU5 M1 U(aU5e[U5n[X5$![a Nf=f)Nr) rrrlistrrrrremoverr)rrrval_type_pairs deduped_pairsnew_parameterspairs rsr_LiteralForm.__getitem__bsj%00(] 0 None: ... @overload def utf8(value: bytes) -> bytes: ... @overload def utf8(value: str) -> bytes: ... In a non-stub file (i.e. a regular .py file), do the same but follow it with an implementation. The implementation should *not* be decorated with @overload. For example: @overload def utf8(value: None) -> None: ... @overload def utf8(value: bytes) -> bytes: ... @overload def utf8(value: str) -> bytes: ... def utf8(value): # implementation goes here The overloads for a function can be retrieved at runtime using the get_overloads() function. __func__)getattr_overload_registryryrz__code__co_firstlinenor_overload_dummy)funcrs rsr8r8sg< D*d +  q|| ,Q^^ < ))     s7A AAc[USU5nUR[;a/$[URnURU;a/$[ X!RR 55$)z6Return all defined overloads for *func* as a sequence.r)rryrrzr values)rrmod_dicts rsr,r,s^ D*d + <<1 1I%all3 >> )IH^^,33566rvc,[R5 g)z$Clear all overloads in the registry.N)rclearrprvrsr)r)s  "rvr) rJrrUrVrrRrdrLrKrarAbstractContextManagerAbstractAsyncContextManagerr)zcollections.abc contextlibtyping_extensions>rr__dict__r  __slots__ry __weakref__ _is_protocol__orig_bases____orig_class__r~__annotations____subclasshook____protocol_attrs____abstractmethods___is_runtime_protocol_MutableMapping__marker__callable_proto_members_only__)r>_gorgr __extra__ __origin__ __tree_hash____next_in_mro____class_getitem__)r __type_params__c[5nURSSHonURS;aM[US05n/URQUQ7H8nUR S5(aMU[ ;dM'URU5 M: Mq U$)N>rQr:r,_abc_)r__mro__rxrr& startswith_EXCLUDED_ATTRSadd)rattrsbase annotationsattrs rs_get_protocol_attrsrGs} EE CR  ==3 3 d$5r: 2dmm2k2DOOG,,_1L $3 ! Lrvc f^/nSUR;Ga [UR5nSnURHzn[U[R 5(dM$UR [R[4;dMJUR RnUb [S5eURnM| UcUnOf[U5n[U5mUT::dHSRU4SjU55nSRSU55n[SUSWS US 35eUn[U5Ul g) zHelper function used in Protocol.__init_subclass__ and _TypedDictMeta.__new__. The contents of this function are very similar to logic found in typing.Generic.__init_subclass__ on the CPython main branch. r*NzECannot inherit from Generic[...] and/or Protocol[...] multiple types., c3H># UHoT;dM [U5v M g7frr)rrgvarsets rsr+_maybe_adjust_parameters..:s"M5aWNabc functools)rcras rs_allow_reckless_class_checksrgNs u~!;;;rvcN[U5R(a [S5eg)Nz Protocols cannot be instantiated)rr)rrrrrs rs_no_initrjUs : " ">? ? #rvc@\rSrSrSrSrSrSrSrS\ 4Sjr S r g ) _ProtocolMetaicc US:Xa[U5S:aO[[1[U5-(a~UHxnU[[ R [[1;aM)UR[RUR/5;aMY[U5(aMk[SU<35e [RR"XX#40UD6$)Nr:rz5Protocols can only inherit from other protocols, got )rr:_typing_ProtocolrobjectrrQrx_PROTO_ALLOWLISTr_ryr4rreABCMetar)mclsrbases namespacerrDs rsr_ProtocolMeta.__new__jsz!c%j1n,-E :!DCS TT==,<,@,@RT,UU&t,,'##'(, ";;&&t5NvN Nrvc^[RR"T/UQ70UD6 [TSS5(a5[ T5Tl[ U4SjTR 55Tlgg)Nr)Fc3P># UHn[[TUS55v M g7fr)callabler)rrFrs rsr)_ProtocolMeta.__init__..s&:CY4HWS$566CYs#&)rerqr rrGr.allr2rrrs` rsr _ProtocolMeta.__init__zsb KK  6t 6v 6sNE22)  &S &rvrlcURRSS5(d[$URHnURHnX#R;aURUc [s s $ M>[ US05n[ U[RR5(dMgX$;dMn[U5(dM M [s $ g)Nr)Fr,T) r&r_rr.r?rr collectionsrerYr4)rrrFrDrEs rsrrs||66! !**D ==(}}T*2--&d,=rB {KOO,C,CDD+#E**& &%#+$rvc`^\rSrSr\R R rSrSrSr U4Sjr Sr U=r $)r:irpTFcV>[TU]"U0UD6 URRSS5(d![ SUR 55UlSUR;a [UlUR (a*UR[RLa [Ul ggg)Nr)Fc30# UH o[Lv M g7frr:rbs rsr-Protocol.__init_subclass__..*P-Q=-r-) r__init_subclass__r&r_any __bases__r)rr-r r:rjrs rsrProtocol.__init_subclass__s)4:6:||''>>'**P#--*P'PC$&S\\9+6C(## 8I8I(I#+CL)J#rv) rxryrzr{rr:rr'r)r0rr|rrs@rsr:r:s,oo--GIL#(  , ,rvr:cb^\rSrSrSrSrSrSrU4Sjr\ RS5r Sr Sr U=r$) r:iaBase 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_checkable act as simple-minded runtime-checkable protocols that check 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: ... rpTFcJ>U[La [S5e[TU] U5$)NzIType Protocol cannot be instantiated; it can only be used as a base class)r:rrr)rrkwdsrs rsrProtocol.__new__ s.(?#%JKKws++rvc^[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[X[UR55 [R"X5$) NzParameter list to z[...] cannot be emptyz*Parameters to generic types must be types.c3R># UHn[R"UT5v M g7frrrrrmsgs rsr-Protocol.__class_getitem__...s!J6av11!S996$'c3V# UHn[U[R5v M! g7fr)rrr rs rsrr1sMfz!V^^<>STVVBJ6JJ(?MfMMM(FNNCCFA)FNNCC'**+a%VYKABB3v;'3v;6'LNN7 #3C4F4F0GH++C88rvcSUR;a[RUR;nO[RUR;nU(a [ S5e[ U5 URRSS5(d![SUR55Ul SUR;a [Ul UR(a*UR[RLa [Ul ggg)Nr*z!Cannot inherit from plain Genericr)c30# UH o[Lv M g7frrrs rsrrKrrr-)r&rrQr*rrrYr_rr)rr-r r:rj)rrrerrors rsrr@s#s||3"NNc.@.@@E"NNcmm;E#$GHH(-||''=='**P#--*P'PC$&S\\9+6C(## 8I8I(I#+CL)J#rv)rxryrzr{rr'r)r0rr _tp_cacher9rr|rrs@rsr:r:sC :IL#(  ,    9 92 , ,rvc[U[5(d[U[R5(a[ USS5(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. r)Fz@@runtime_checkable can be only applied to protocol classes, got T)rrl issubclassrrQrrr0rs rsr=r=YsY] + +z#v~~/N/N^U33$$'7,- -#'  rvcH\rSrSrSrSr\RS\4Sj5r Sr g)r$iyz(An ABC with one abstract method __int__.rprcgrrprqs rs__int__SupportsInt.__int__~ rvN) rxryrzr{rr'reabstractmethodrrr|rprvrsr$r$ys)6   S   rvr$cH\rSrSrSrSr\RS\4Sj5r Sr g)r"iz*An ABC with one abstract method __float__.rprcgrrprqs rs __float__SupportsFloat.__float__rrvN) rxryrzr{rr'rerfloatrr|rprvrsr"r")8   u   rvr"cH\rSrSrSrSr\RS\4Sj5r Sr g)r!iz,An ABC with one abstract method __complex__.rprcgrrprqs rs __complex__SupportsComplex.__complex__rrvN) rxryrzr{rr'rercomplexrr|rprvrsr!r!s):      rvr!cH\rSrSrSrSr\RS\4Sj5r Sr g)r iz*An ABC with one abstract method __bytes__.rprcgrrprqs rs __bytes__SupportsBytes.__bytes__rrvN) rxryrzr{rr'rerbytesrr|rprvrsr r rrvr cD\rSrSrSr\R S\4Sj5rSr g)r#irprcgrrprqs rs __index__SupportsIndex.__index__rrvN) rxryrzr{r'rerrrr|rprvrsr#r#s&   s   rvr#cH\rSrSrSrSr\RS\4Sj5r Sr g)rizO An ABC with one abstract method __abs__ that is covariant in its return type. rprcgrrprqs rs__abs__SupportsAbs.__abs__rrvN) rxryrzr{rr'rerrrr|rprvrsrrs-    T   rvrcP\rSrSrSrSr\RSS\S\ 4Sjj5r Sr g) r%izQ An ABC with one abstract method __round__ that is covariant in its return type. rpndigitsrcgrrp)rrrs rs __round__SupportsRound.__round__rrvN)r) rxryrzr{rr'rerrrrr|rprvrsr%r%s4    S    rvr%c^U4SjnU$)Nc>[RRS:Xa^[RS:aJ[ U5[ T5S.n[ UR SU5n[R"U"5U5$TUl U$)Npypyr)__call____mro_entries__rp) r\implementationr version_info staticmethodrrxrfupdate_wrapperr)rcls_dictr mro_entriess rsinner#_ensure_subclassable..innersq    " "f ,1A1AF1J(.#/ #<HT]]B1A++AC6 6#.D Krvrp)rrs` rs_ensure_subclassablers  Lrv)r module _Protocolc,\rSrSrSSjr\rSr\rSr g)_TypedDictMetaic "UH5n[U5[LdMU[RLdM,[ S5e [ SU55(a[R4nOSn[R [[/UQ[P7U5nXl UR[:XaXl [US5(dX'l 0nURS05n Sn [(aCU R5V V s0sH%upU [R "XUR"S9_M' n n n O9U R5V V s0sHupU [R "X5_M n n n [%5n [%5nUHnUR'UR(RS055 U R'UR(RSS55 UR'UR(RS S55 M UR'U 5 U R5Hunn[+U5nU[,La"[/U5nU(aUS n[+U5nU[0LaU R3U5 MXU[4LaUR3U5 MtU(aU R3U5 MUR3U5 M Xl 5Ul[9U5Ul[US 5(dXGlU$s sn n fs sn n f) a Create new typed dict class object. This method is called when TypedDict is subclassed, or when TypedDict is instantiated. This way TypedDict supports all three syntax forms described in its docstring. Subclasses and instances of TypedDict return actual dictionaries. zHcannot inherit from both a TypedDict type and a non-TypedDict base classc3V# UHn[U[R5v M! g7fr)rrrQrs rsr)_TypedDictMeta.__new__..s@%Q:a00%rrpr*r,z?TypedDict('Name', {f0: t0, f1: t1, ...}); each t must be a typer__required_keys____optional_keys__r __total__) rrrrQrrr _fake_namedictrxrzrr*r_ _TAKES_MODULEitemsrryrupdater&r/r&r.rErBrFr,rrrr)rrrsnstotalrD generic_basetp_dictrEown_annotationsrntp required_keys optional_keysannotation_keyannotation_typeannotation_originannotation_argss rsr_TypedDictMeta.__new__s:^3FNN8R#%EFF @%@@@ &0 ! ll>:?T?Tt?TVXYG# ##z1'+$7$455).&K ff%6;OSC}"1!6!6!8#!8v))"':L:LMM!8 #"1!6!6!8#!8v))"22!8 # EMEM""4==#4#45F#KL$$T]]%6%67JB%OP$$T]]%6%67JB%OP    /3B3H3H3J/$.$?!$ 1&.&?O&*9!*<,6,G)$0!%%n5&+5!%%n5!%%n5!%%n54K"'2 #(1-(@G %(1-(@G %7K00$)!NQ# #s ;,L>#L c[S5e)Nz4TypedDict does not support instance and class checksrrs rsr _TypedDictMeta.__subclasscheck__/sRS SrvrpN)T) rxryrzr{rrrrrr|rprvrsrrsH T T.rvrrrpc[4$r) _TypedDictrss rsr 7s rvrc nU[LdUc@U[LaSnOSnSUSU<S3nUS3U-S-n[R"U[SS 9 UnOU(a [ S 5eU(a[R"S [SS 9 S [ U50n[ 5nUbXS '[USXrS9n [4U l U $)aqA simple typed namespace. At runtime it is equivalent to a plain dict. TypedDict creates a dictionary type such that a type checker will expect all instances to have a certain set of keys, where each key is associated with a value of a consistent type. This expectation is not checked at runtime. Usage:: class Point2D(TypedDict): x: int y: int label: str a: Point2D = {'x': 1, 'y': 2, 'label': 'good'} # OK b: Point2D = {'z': 3, 'label': 'bad'} # Fails type check assert Point2D(x=1, y=2, label='first') == dict(x=1, y=2, label='first') The type info can be accessed via the Point2D.__annotations__ dict, and the Point2D.__required_keys__ and Point2D.__optional_keys__ frozensets. TypedDict supports an additional equivalent form:: Point2D = TypedDict('Point2D', {'x': int, 'y': int, 'label': str}) By default, all keys must be present in a TypedDict. It is possible to override this by specifying totality:: class Point2D(TypedDict, total=False): x: int y: int This means that a Point2D TypedDict can have any of the keys omitted. A type checker is only expected to support a literal False or True as the value of the total argument. True is the default, and makes all items defined in the class body be required. The Required and NotRequired special forms can also be used to mark individual keys as being required or not required:: class Point2D(TypedDict): x: int # the "x" key must always be present (Required is the default) y: NotRequired[int] # the "y" key can be omitted See PEP 655 for more details on Required and NotRequired. 2Failing to pass a value for the 'fields' parameter(Passing `None` as the 'fields' parameter`z = TypedDict(z, {})`z is deprecated and will be disallowed in Python 3.15. To create a TypedDict class with 0 fields using the functional syntax, pass an empty dictionary, e.g. .r stacklevelz@TypedDict takes either a dict or keyword arguments, but not bothzThe kwargs-based syntax for TypedDict definitions is deprecated in Python 3.11, will be removed in Python 3.13, and may not be understood by third-party type checkers.r,ryrpr ) rwarningswarnDeprecationWarningrrrcrrr*) __typename__fieldsrrdeprecated_thingexampledeprecation_msgrrtds rsrr7s` w ("27"#W #M *]:.IG#$%OO  O MM/+=! LH ,- -  MM;#   h 0  %|  JB <&L rvct[[S5(aU[RLag[U[5$)zCheck if an annotation is a TypedDict class For example:: class Film(TypedDict): title: str year: int is_typeddict(Film) # => True is_typeddict(Union[list, str]) # => False rF)rrrr_TYPEDDICT_TYPESrs rsr5r5s/ 6; ' 'B&2B2B,B".//rvr(cU$)aAssert (to the type checker) that the value is of the given type. When the type checker encounters a call to assert_type(), it emits an error if the value is not of the specified type:: def greet(name: str) -> None: assert_type(name, str) # ok assert_type(name, int) # type checker error At runtime this returns the first argument unchanged and otherwise does nothing. rp)__val__typs rsr(r(s  rvrEc[U[5(a[UR5$[ US5(a2UR[ [ 4;a[URS5$[U[R5(a>[SUR55nXR:XaU$URU5$[ [S5(am[U[R5(aN[SUR55nXR:XaU$[R"URU5$[ [S5(aq[U[R5(aR[SUR55nXR:XaU$[R "["R$U5$U$)z=Strips Annotated, Required and NotRequired from a given type.r6rc38# UHn[U5v M g7fr _strip_extrasras rsr _strip_extras..!GJq-"2"2JrPrc38# UHn[U5v M g7frr$r&s rsrr(r)rPrc38# UHn[U5v M g7frr$r&s rsrr(r)rP)r_AnnotatedAliasr%r6rrErFrrrr copy_withrrrrfreduceoperatoror_)r stripped_argss rsr%r%sJ a ) ) . . 1l # # ;8O(O A/ / a-- . .!!GAJJ!GGM *;;}- - 6> * *z!V=P=P/Q/Q!!GAJJ!GGM *&&q||]C C 6; ' 'Jq&:J:J,K,K!!GAJJ!GGM *##HLL-@ @rvFc[[S5(a[R"XUSS9nO[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, ...]', 'Required[T]' or 'NotRequired[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. r&T)globalnslocalnsinclude_extras)r3r4)rrr2rr%)rr3r4r5hintkrs rsr2r2so@ 6; ' '((D((QD K04 = =## ===sA:r&cJ^\rSrSrSrU4SjrSrSrSrSr Sr S r U=r $) r,ia#Runtime representation of an annotated type. At its core 'Annotated[t, dec1, dec2, ...]' is an alias for the type 't' with extra annotations. The alias behaves like a normal typing alias, instantiating is the same as instantiating the underlying type, binding it to types is also the same. c>[U[5(aURU-nURn[TU]X5 X lgr)rr, __metadata__r6rr )rroriginmetadatars rsr _AnnotatedAlias.__init__ s>&/22!..9** G V , ( rvcX[U5S:XdeUSn[X R5$)Nrr)rr,r:)rrrnew_types rsr-_AnnotatedAlias.copy_withs.v;!# ##ayH"8->->? ?rvcS[R"UR5SSRSUR55S3$)Nztyping_extensions.Annotated[rIc38# UHn[U5v M g7fr)reprr&s rsr+_AnnotatedAlias.__repr__..s D2CQa2CrPrR)r _type_reprr6rSr:rqs rsrt_AnnotatedAlias.__repr__sE263D3DT__3U2VVXyy D$2C2C DDEQH Irvcb[R[UR4UR-44$r)r/getitemr&r6r:rqs rs __reduce___AnnotatedAlias.__reduce__s1##DOO-0A0AA& rvc[U[5(d[$URUR:wagURUR:H$)NF)rr,rr6r:rrrs rsr_AnnotatedAlias.__eq__!sAe_55%%%"2"22$$(:(:: :rvcD[URUR45$r)rr6r:rqs rsr_AnnotatedAlias.__hash__(s$*;*;<= =rv)r:) rxryrzr{rr r-rtrIrrr|rrs@rsr,r,s-  ) @  I   ; > >rvr,cL\rSrSrSrSrSr\RS5r Sr Sr g)r&i+aAdd 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()] rpc[S5e)Nz&Type Annotated cannot be instantiated.rr{s rsrAnnotated.__new__NDE Ervc[U[5(a[U5S:a [S5e[[ 4n[ US5U;aUSnOSn[R"USU5n[USS5n[X55$)NrzUAnnotated[...] should be used with at least two arguments (a type and an annotation).rz$Annotated[t, ...]: t must be a type.r) rrrrrrr/rrr,)rrallowed_special_formsr;rr<s rsr9Annotated.__class_getitem__Qsfe,,F a!/00&.u$5 !&)$(==<++F1Is;VABZ(H"64 4rvc4[SURS35e)NCannot subclass z .Annotated)rryr{s rsrAnnotated.__init_subclass__`s "3>>"2*= rvN) rxryrzr{rr'rrrr9rr|rprvrsr&r&+s4 @  F    5  5 rv)_BaseGenericAlias)rc[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) rr,r&rr_typing_GenericAliasrZr r r6rQrs rsr/r/xsa b/ * *  b6//1EGX(/; < <==  >> !rvcx[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) rFrprNr=)rr,r6r:rrr\rrr/rrerJEllipsisr )rress rsr.r.s b/ * *MM#boo5 5 b6//1EF G Gr:u--++C"~!9!99c!fH>TCH~s2w/Jrvr?c[US35e)zSpecial 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 subscriptablerrrrs rsr?r?s4& 5677rva%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.c[U[[45(a[SU55UlgU[:wa[ R "US5UlgSUlg)Nc3P# UHn[R"US5v M g7f)Default must be a typeNr)rds rsr_set_default..s((:18A)/(:(:1>V(W(W18s$&re)rrr  __default__rrr) type_paramdefaults rs _set_defaultrksS'E4=))!&(:18(:";  G !'!3!3G=U!V !% rvc0[SS9nUS:waXlgg)Nrrar%)rcry) typevarlikedef_mods rs _set_moduleros AG%%!(&rvc \rSrSrSrSr\rSrg) _DefaultMixinizMixin for TypeVarLike defaults.rpN) rxryrzr{rr'rkr r|rprvrsrqrqs)IHrvrqc&\rSrSrS\S\4SjrSrg)_TypeVarLikeMetai_TypeVarLikeMeta__instancerc,[XR5$r)r_backported_typevarlike)rrts rsr"_TypeVarLikeMeta.__instancecheck__s*&A&ABBrvrpN)rxryrzr{rboolrr|rprvrsrsrssC3C4CrvrscP\rSrSrSr\R rSSS\SS.Sjr S Sjr Sr g) r izType variable.NF)boundrrrjinfer_variancec[[S5(a[R"U/UQ7UX4US.6nOA[R"U/UQ7UX4S.6nU(aU(dU(a [S5eXhl[ X5 [ U5 U$)Nr@rzrrr{rzrrz1Variance cannot be specified with infer_variance.)rrr r`__infer_variance__rkro) rrrzrrrjr{ constraintstypevars rsrTypeVar.__new__s 6? + +nnTDKDu/84BDGnnTWKWu/8WG9  !TUU)7 &W&Grvc([S[S35e)Ntype 'z(.TypeVar' is not an acceptable base typerrxrs rsrTypeVar.__init_subclass__s& *RSTTrvrprN) rxryrzr{rrr rvrrrr|rprvrsr r s'$nn/3u$Urvr r c(\rSrSrSrSrSrSrSrg) _Immutablei z3Mixin to indicate that object should not be copied.rpcU$rrprqs rs__copy___Immutable.__copy__KrvcU$rrp)rrmemos rs __deepcopy___Immutable.__deepcopy__rrvN) rxryrzr{rr'rrr|rprvrsrr sA   rvrc*\rSrSrSrSrSrSrSrg)r ia!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. cXlgrr6rrr;s rsr ParamSpecArgs.__init__ $Orvc4URRS3$)Nz.argsr6rxrqs rsrtParamSpecArgs.__repr__#soo../u5 5rvcj[U[5(d[$URUR:H$r)rr rr6rLs rsrParamSpecArgs.__eq__&s*e]33%%??e&6&66 6rvrN rxryrzr{rr rtrr|rprvrsr r s  % 6 7rvc*\rSrSrSrSrSrSrSrg)r i+a+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 rsr ParamSpecKwargs.__init__7rrvc4URRS3$)Nz.kwargsrrqs rsrtParamSpecKwargs.__repr__:soo../w7 7rvcj[U[5(d[$URUR:H$r)rr rr6rLs rsrParamSpecKwargs.__eq__=s*e_55%%??e&6&66 6rvrNrrprvrsr r +s  % 8 7rvr rcP\rSrSrSr\R rSSSS\S.Sjr S Sjr Sr g) riFzParameter specification.NFrzrrr{rjc[[S5(a[R"XUUUS9nO[R"XUUS9nXWl[ Xv5 [ U5 U$)Nr@r}r~)rrrrrkro)rrrzrrr{rj paramspecs rsrParamSpec.__new__Ksfv//",,T7@;H,  ,  " rvc([S[S35e)Nrz*.ParamSpec' is not an acceptable base typerrs rsrParamSpec.__init_subclass__^sfXJ.XYZ Zrvrpr) rxryrzr{rrrrvrrrr|rprvrsrrFs)&"("2"2(,#5#(' & [rvc^\rSrSrSr\R r\S5r \S5r SSSS\ S.U4Sjjr S r S rS rS rS rSrU=r$)rieaParameter 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)r rqs rsrParamSpec.argss  & &rvc[U5$r)r rqs rsrParamSpec.kwargss "4( (rvNFrc@>[TU]U/5 Xl[U5Ul[U5Ul[U5UlU(a[R"US5Ul OSUl [RX5 [5nUS:waXpl gg)NzBound must be a type.r%) rr rxrx __covariant____contravariant__rrr __bound__rqrcry) rrrrzrrr{rjrnrs rsr ParamSpec.__init__s G dV $ M!%iD %)-%8D "&*>&:D #!'!3!3E;R!S!%  " "4 1iG--").rvcUR(aSnO*UR(aSnOUR(aSnOSnXR-$)N+-~)rrrrx)rrprefixs rsrtParamSpec.__repr__s>&&##''MM) )rvc,[RU5$rrorrqs rsrParamSpec.__hash__??4( (rvcXL$rrprLs rsrParamSpec.__eq__ = rvcUR$rrxrqs rsrIParamSpec.__reduce__ == rvcgrrpris rsrParamSpec.__call__ rv)rrrrryrx)rxryrzr{rrr rpropertyrrrr rtrrrIrr|rrs@rsrresp, ^NN  '  '  )  )+/%u$)7 * *$ * ) ! !  rvrcf^\rSrSr\R rSrU4SjrSr Sr Sr \ S5r SrU=r$) _ConcatenateGenericAliasiFc<>[TU]U5 XlX lgr)rr r6r)rrr;rrs rsr !_ConcatenateGenericAlias.__init__s G T "$O Mrvc^[RmT"UR5SSRU4SjUR55S3$)NrQrIc34># UH nT"U5v M g7frrp)rargrEs rsr4_ConcatenateGenericAlias.__repr__..s!K]c*S//]srR)rrEr6rSr)rrrEs @rsrt!_ConcatenateGenericAlias.__repr__sF**J!$//23 !KT]]!KKLAO PrvcD[URUR45$r)rr6rrqs rsr!_ConcatenateGenericAlias.__hash__s$--89 9rvcgrrpris rsr!_ConcatenateGenericAlias.__call__rrvc:[SUR55$)Nc3t# UH.n[U[R[45(dM*Uv M0 g7fr)rrr r)rrs rsr:_ConcatenateGenericAlias.__parameters__..s'*rjfnni=X.Y]s)8 8)rrrqs rsr~'_ConcatenateGenericAlias.__parameters__s !]] rv)rr6)rxryrzr{rrrrr rtrrrr~r|rrs@rsrrs@((  !  P  :     rvrc^US:Xa [S5e[U[5(dU4n[US[5(d [S5eSm[U4SjU55n[ X5$)Nrpz&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 g7frrrs rsr'_concatenate_getitem..s!F:av))!S11:r)rrrrr)rrrrs @rs_concatenate_getitemrsnR@AA j% ( ( ] jni 0 0./ / ;CF:FFJ #D 55rvc[X5$)zUsed 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. rrbs rsrrs$D55rvc\rSrSrSrSrg)_ConcatenateFormic[X5$rrrbs rsr_ConcatenateForm.__getitem__s '9 9rvrpNrrprvrsrrs :rvra&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. rAcb[R"XS35n[R"X45$)aSpecial 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)rrrrs rsrArA's0X!!*6R.ST##D'22rvc\rSrSrSrSrg)_TypeGuardFormiWcx[R"UURS35n[R"X45$)Nz accepts only a single typerrs rsr_TypeGuardForm.__getitem__Xs7%%j)- 4O&PRD''g6 6rvrpNrrprvrsrrWrrvra 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). cx\rSrSrSrSrSrSrSrSr Sr S r S r S r S r\R S 5rSrg) _SpecialFormi)rr_getitemcTXlURUlURUlgr)rrxrr)rrrHs rsr _SpecialForm.__init__s %%  rvc<US;a UR$[U5e)N>rxrz)rr)rrrs rs __getattr___SpecialForm.__getattr__s / /:: T""rvc [SU<35e)NrXr)rrrss rsr_SpecialForm.__mro_entries__s*4(344rvc SUR3$rrrqs rsrt_SpecialForm.__repr__s#DJJ<00rvcUR$rrrqs rsrI_SpecialForm.__reduce__s zzrvc [SU<35e)NzCannot instantiate rrrrrs rsr_SpecialForm.__call__s-dX677rvc*[RX4$rrrgrLs rs__or___SpecialForm.__or__s||DK((rvc*[RX4$rrrLs rs__ror___SpecialForm.__ror__s||EK((rvc[US35e)Nz! cannot be used with isinstance()rrrrs rsr_SpecialForm.__instancecheck__4& ABCCrvc[US35e)Nz! cannot be used with issubclass()r)rrrs rsr_SpecialForm.__subclasscheck__rrvc$URX5$r)rrbs rsr_SpecialForm.__getitem__s}}T..rv)rrrN)rxryrzr{r'r rrrtrIrrrrrrrrr|rprvrsrrsU0I' # 518))DD //rvrrc[US35e)aRepresents an arbitrary literal string. Example:: from pip._vendor.typing_extensions import LiteralString def query(sql: LiteralString) -> ...: ... query("SELECT * FROM table") # ok query(f"SELECT * FROM {input()}") # not ok See PEP 675 for details. rarrrrs rsrrs"4& 5677rvr c[US35e)zUsed to spell the type of "self" in classes. Example:: from typing import Self class ReturnsSelf: def parse(self, data: bytes) -> Self: ... return self rarr s rsr r s4& 5677rvrCc[US35e)a@The bottom type, a type that has no members. This can be used to define a function that should never be called, or a function that never returns:: from pip._vendor.typing_extensions import Never def never_call_me(arg: Never) -> None: pass def int_or_str(arg: int | str) -> None: never_call_me(arg) # type checker error match arg: case int(): print("It's an int") case str(): print("It's a str") case _: never_call_me(arg) # ok, arg is of type Never rarr s rsrCrCs04& 5677rvcv[R"XRS35n[R"X45$)aA 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. rrrs rsrErEs3"!!* [TU]U5 [Ulgr)rr  _UNPACK_DOCr)rrrHrs rsr _UnpackSpecialForm.__init__s G W %&DLrv)r)rxryrzr{r r|rrs@rsrrs  ' 'rvrc,\rSrSr\R rSrg) _UnpackAliasirpNrxryrzr{rr rr|rprvrsrr NN rvrc`[R"XRS35n[X45$rrrrrrs rsrrs+!!* Tuple[*Ts]: return self._shape shape = (Height(480), Width(640)) x: Array[Height, Width] = Array(shape) y = abs(x) # Inferred type is Array[Height, Width] z = x + x # ... is Array[Height, Width] x.get_shape() # ... is tuple[Height, Width] c#(# URv g7fr) __unpacked__rqs rs__iter__TypeVarTuple.__iter__s## #sr-cXl[RX5 [5nUS:waX0l[ UUlg)Nr%)rxrqr rcryrr6)rrrrjrns rsr TypeVarTuple.__init__s8 M  " "4 1iG--") &t D rvcUR$rrrqs rsrtTypeVarTuple.__repr__rrvc,[RU5$rrrqs rsrTypeVarTuple.__hash__rrvcXL$rrprLs rsrTypeVarTuple.__eq__rrvcUR$rrrqs rsrITypeVarTuple.__reduce__rrvc&SU;a [S5eg)Nrr2rrs rsrr3sd" HII#rv)ryrxr6N)rxryrzr{rrr rr7rr rtrrrIrr|rprvrsrrs<) XNN  $-4 - ! ) ! ! Jrvr;__objrcd[S[U5R<3[RS9 U$)aReveal the inferred type of a variable. When a static type checker encounters a call to ``reveal_type()``, it will emit the inferred type of the argument:: x: int = 1 reveal_type(x) Running a static type checker (e.g., ``mypy``) on this example will produce output similar to 'Revealed type is "builtins.int"'. At runtime, the function prints the runtime type of the argument and returns it unchanged. zRuntime type is )file)printrrxr\stderr)rDs rsr;r; s*  e!5!5 89 K rvr'__argc[S5e)aAssert to the type checker that a line of code is unreachable. Example:: def int_or_str(arg: int | str) -> None: match arg: case int(): print("It's an int") case str(): print("It's a str") case _: assert_never(arg) If a type checker finds that a call to assert_never() is reachable, it will emit an error. At runtime, this throws an exception when called. zExpected code to be unreachable)AssertionErrorrIs rsr'r' s(>??rv) eq_default order_defaultkw_only_defaultfrozen_defaultfield_specifiersrMrNrOrPrQ.rc (^^^^^^UUUUUU4SjnU$)aIDecorator that marks a function, class, or metaclass as providing dataclass-like behavior. Example: from pip._vendor.typing_extensions import dataclass_transform _T = TypeVar("_T") # Used on a decorator function @dataclass_transform() def create_model(cls: type[_T]) -> type[_T]: ... return cls @create_model class CustomerModel: id: int name: str # Used on a base class @dataclass_transform() class ModelBase: ... class CustomerModel(ModelBase): id: int name: str # Used on a metaclass @dataclass_transform() class ModelMeta(type): ... class ModelBase(metaclass=ModelMeta): ... class CustomerModel(ModelBase): id: int name: str Each of the ``CustomerModel`` classes defined in this example will now behave similarly to a dataclass created with the ``@dataclasses.dataclass`` decorator. For example, the type checker will synthesize an ``__init__`` method. The arguments to this decorator can be used to customize this behavior: - ``eq_default`` indicates whether the ``eq`` parameter is assumed to be True or False if it is omitted by the caller. - ``order_default`` indicates whether the ``order`` parameter is assumed to be True or False if it is omitted by the caller. - ``kw_only_default`` indicates whether the ``kw_only`` parameter is assumed to be True or False if it is omitted by the caller. - ``frozen_default`` indicates whether the ``frozen`` parameter is assumed to be True or False if it is omitted by the caller. - ``field_specifiers`` specifies a static list of supported classes or functions that describe fields, similar to ``dataclasses.field()``. At runtime, this decorator records its arguments in the ``__dataclass_transform__`` attribute on the decorated object. See PEP 681 for details. c$>TTTTTTS.UlU$)N)rMrNrOrPrQr)__dataclass_transform__) cls_or_fnrMrQrPrOrrNs rs decorator&dataclass_transform..decorator s'(!.#2"0$4 1I - rvrp)rMrNrOrPrQrrVs`````` rsr*r*8 sR  rvr9_F)rzcDSUlU$![[4a U$f=f)aIndicate that a method is intended to override a method in a base class. Usage: class Base: def method(self) -> None: ... pass class Child(Base): @override def method(self) -> None: super().method() When this decorator is applied to a method, the type checker will validate that it overrides a method with the same name on a base class. This helps prevent bugs that may occur when a base class is changed without an equivalent change to a child class. There is no runtime checking of these properties. The decorator sets the ``__override__`` attribute to ``True`` on the decorated object to allow runtime introspection. See PEP 698 for details. T) __override__rrrLs rsr9r9 s64 !%E    *    rr+_Trcategoryr__msgr]rc8^^^S[S[4UUU4SjjnU$)aIndicate that a class, function or overload is deprecated. Usage: @deprecated("Use B instead") class A: pass @deprecated("Use g instead") def f(): pass @overload @deprecated("int support is deprecated") def g(x: int) -> int: ... @overload def g(x: str) -> int: ... When this decorator is applied to an object, the type checker will generate a diagnostic on usage of the deprecated object. The warning specified by ``category`` will be emitted on use of deprecated objects. For functions, that happens on calls; for classes, on instantiation. If the ``category`` is ``None``, no warning is emitted. The ``stacklevel`` determines where the warning is emitted. If it is ``1`` (the default), the warning is emitted at the direct caller of the deprecated object; if it is higher, it is emitted further up the stack. The decorator sets the ``__deprecated__`` attribute on the decorated object to the deprecation message passed to the decorator. If applied to an overload, the decorator must be after the ``@overload`` decorator for the attribute to exist on the overload as returned by ``get_overloads()``. See PEP 702 for details. rIrc>^^^Tc TTlT$[T[5(akTRmTR[ RLm[ R"T5UUUUU4Sj5n[U5TlT=TlUlT$[T5(a2[ R"T5UUUU4Sj5nT=TlUlU$[ST<35e)Nc>[R"TTTS-S9 T[RLa T"U/UQ70UD6$T(d&U(dU(a[ UR S35eT"U5$)Nrr\z() takes no arguments)rrrorrrx)rrrr^r]has_init original_newrs rsr.deprecated..decorator..__new__ sbMM%(zTU~V#6>>9+CA$A&AA%46'3<<.8M(NOO+C00rvcF>[R"TTTS-S9 T"U0UD6$)Nrr\)rr)rrrIr^r]rs rswrapper.deprecated..decorator..wrapper s(MM%(zTU~V $1&11rvzY@deprecated decorator with non-None category must be applied to a class or callable, not ) __deprecated__rrrr rorfwrapsrrxr)rIrrfrbrcr^r]rs` @@rsrVdeprecated..decorator s',$ E4(($}}  >>@.11/1!-W 5 @EE$w'= %'2(2AFE$w'=005y:rv)r[)r^r]rrVs``` rsr+r+ s%X" R" B" " Hrvc 8UVVs/sHupEUPM nnnUVVs0sH!upEU[R"USUS35_M# nnn[R"XX2S9nU=UlUR l[ RS:aXxlU$s snnfs snnf)Nzfield z annotation must be a typedefaultsrr) rrr namedtupler,rr\r _field_types) rrrrmrrfieldsrEnm_tpls rs _make_nmtuplerr# s %&!&#(*#(41&,,Q&;U0VWW#( *''19JBMM!?   f $"-  '*s B(B>rxryr,c\rSrSrSrSrg)_NamedTupleMetai3 c [U;deUH,nU[LdMU[RLdM#[S5e [ SU55nUR S05n/nUHVnXs;aUR U5 MU(dM$[SUS[U5S:aSOSS S RU535e [XR5UVs/sHoUPM snUS S 9n X)l [RU;ah[[S 5(a[[R5U lO4[RRR n [U 5U lUHFn U [";a[%SU -5eU [&;dM'XR(;dM8[+XX;5 MH [RU;aU R-5 U $s snf)Nz3can only inherit from a NamedTuple type and Genericc3B# UHo[La[OUv M g7fr) _NamedTupler)rrDs rsr*_NamedTupleMeta.__new__..: sSUT;#6%D@Urr,zNon-default namedtuple field z cannot follow default fieldrsr rIryrl_generic_class_getitemz&Cannot overwrite NamedTuple attribute )rwrrQrrr_rrrSrrrrr classmethodr{r9r_prohibited_namedtuple_fieldsr_special_namedtuple_fields_fieldssetattrr) rtypenamersrrDr default_names field_namerrq class_getitemkeys rsr_NamedTupleMeta.__new__4 s%' ''{*t6>>/I#MOOSUSSEFF,b1EM# #!((4"]#&CJ<PB.1-.@1.Ds"&MQ'+yy'?&@%BCC $#++-)67AQ%7,'F % ~~&6#;< str: ... UserId('user') # Fails type check name_by_id(42) # Fails type check name_by_id(UserId(42)) # OK num = UserId(5) + 1 # type: int cU$rrprs rsrNewType.__call__ sJrvcXlSU;aURS5SnXlX l[ 5nUS:waX0lgg)Nrr=r%)rz rpartitionrx __supertype__rcry)rrrrrns rsr NewType.__init__ sG $ d{s+B/ M!# iG--").rvc<^URm"U4SjS5nU4$)Nc">\rSrSrU4SjrSrg)z&NewType.__mro_entries__..Dummyi c H>URn[SUSU<STS35e)NzGCannot subclass an instance of NewType. Perhaps you were looking for: `z = NewType(rIz)`)rxr)r subcls_name supercls_names rsr8NewType.__mro_entries__..Dummy.__init_subclass__ s8"%,,K#'= K?"]OSUWrvrpN)rxryrzr{rr|)rsrsDummy&NewType.__mro_entries__..Dummy s rvrr)rrrsrrs @rsrNewType.__mro_entries__ s!!MMM  8Orvc8URSUR3$)Nr)ryrzrqs rsrtNewType.__repr__ soo&a(9(9':; ;rvcUR$r)rzrqs rsrINewType.__reduce__" s$$ $rvrc*[RX4$rrrLs rsrNewType.__or__) s||DK00rvc*[RX4$rrrLs rsrNewType.__ror__, s||EK00rv)ryrxrzrN)rxryrzr{rrr rrtrIr\rrrr|rprvrsr7r7 s?   *   < %   w & 1 1 'rvr7r@cUSL=(d4 [U[[R[R[ 45$)z:Corresponds to is_unionable() in unionobject.c in CPython.N)rrrrrr@rs rs _is_unionabler3 s9d{ j         /   rvc^\rSrSrSrSS.S\4SjjrS\S\S S 4U4S jjrS\S \ 4S jr S\S \ 4S jr S \4Sjr Sr SrSrSr\R$S:a SrSrSrU=r$SrU=r$)r@i< a|Create named, parameterized type aliases. This provides a backport of the new `type` statement in Python 3.12: type ListOrSet[T] = list[T] | set[T] is equivalent to: T = TypeVar("T") ListOrSet = TypeAliasType("ListOrSet", list[T] | set[T], type_params=(T,)) The name ListOrSet can then be used as an alias for the type it refers to. The type_params argument should contain all the type parameters used in the value of the type alias. If the alias is not generic, this argument is omitted. Static type checkers should only support type aliases declared using TypeAliasType that follow these rules: - The first argument (the name) must be a string literal. - The TypeAliasType instance must be immediately assigned to a variable of the same name. (For example, 'X = TypeAliasType("Y", int)' is invalid, as is 'X, Y = TypeAliasType("X", int), TypeAliasType("Y", int)'). rp) type_paramsrc<[U[5(d [S5eX lX0l/nUH<n[U[ 5(aUR U5 M+URU5 M> [U5Ul [5nUS:waX`l Xl g)Nz#TypeAliasType name must be a stringr%) rrr __value__r;rrrrr~rcryrx)rrrvaluerrrirns rsr TypeAliasType.__init__X sdC(( EFF"N#. J) j,77%%j1%%j1 * #( "3D iG--") Mrv_TypeAliasType__name_TypeAliasType__valuerNch>[US5(aURU5 [TU] X5 g)Nrx)r_raise_attribute_errorr __setattr__)rrrrrs rsrTypeAliasType.__setattr__k s+tZ((++F3 G  0rvc&URU5 gr)r)rrrs rs __delattr__TypeAliasType.__delattr__p s  ' ' /rvclUS:Xa [S5eUS;a[SUS35e[SUS35e)Nrxzreadonly attribute>rryr~r;z attribute 'z3' of 'typing.TypeAliasType' objects is not writablez0'typing.TypeAliasType' object has no attribute '')r)rrrs rsr$TypeAliasType._raise_attribute_errors sXz!$%9::YY$!$(&& %FtfANrvcUR$rrrqs rsrtTypeAliasType.__repr__ rrvc [U[5(dU4nUVs/sH(n[R"USURS35PM* nn[R "U[U55$s snf)Nz Subscripting z requires a type.)rrrrrxrrs rsrTypeAliasType.__getitem__ syj%00(] ' 'D""M$--8IJ'  ''eJ.?@ @ s/A.cUR$rrrqs rsrITypeAliasType.__reduce__ rrvc[S5e)NzEtype 'typing_extensions.TypeAliasType' is not an acceptable base typerr{s rsrTypeAliasType.__init_subclass__ sW rvc[S5e)NzType alias is not callablerrqs rsrTypeAliasType.__call__ s89 9rvrcV[U5(d[$[RX4$rrrrrg)rrrights rsrTypeAliasType.__or__ s&%U++))||DK00rvcV[U5(d[$[RX4$rr)rrlefts rsrTypeAliasType.__ror__ s$$T**))||DJ//rv)ryrxr~r;r)rxryrzr{rrr rorrCrrrtrrIrrr\rrrr|rrs@rsr@r@< s 6=? ! !& 1c 1F 1t 1  0c 0e 0 s u  !c ! A !  :   w & 1 0 0 'rvr4__tpc[U[5=(a> [USS5=(a* U[L=(a U[[S[ 55L$)a Return True if the given type is a Protocol. Example:: >>> from typing_extensions import Protocol, is_protocol >>> class P(Protocol): ... def a(self) -> str: ... ... b: int >>> is_protocol(P) True >>> is_protocol(int) False r)Fr:)rrrr:rrors rsr4r4 sN tT " Bne4 BH$ BGFJAA  rvc[U5(d[U<S35e[US5(a[UR5$[[ U55$)aGReturn the set of members defined in a Protocol. Example:: >>> from typing_extensions import Protocol, get_protocol_members >>> class P(Protocol): ... def a(self) -> str: ... ... b: int >>> get_protocol_members(P) frozenset({'a', 'b'}) Raise a TypeError for arguments that are not Protocols. z is not a Protocolr.)r4rrrr.rGrs rsr1r1 sR4  th&89: : 4- . .T445 5,T233rvr)r)r)NNF)rp)rercollections.abcrfrr/r\rrrr__all__PEP_560r GenericMetarmrrrrrrDr rrrrrrrrrrrrrr-r3r6rrrrrrr8r,r) defaultdictpartialrrr rrrrrrrrr_aliasrrrr>rBrprArBrrGrYrcr:rgrjrn_ProtocolMetaBaserqrlr|rrQr=r<r$r"r!r r#rr%rrrr5 signaturerrrrrrrr(r2r%r&r,r/r.rZ ImportErrorrr\r?rkrorqrsr r rrr rrrrrrAr_Finalrr rCrErFrrrrrrr(rr;r'r*rxrfrgrJr9rXr+r[rrr_Warningrrrr _prohibitedr}r~rtrwr_new_signaturer FunctionType__text_signature__rrABCregister memoryview bytearrayrr0r7r@rr4r1rOrGrHrIrKrLrMrNrPrRrSrTrUrVrWrXrYrZr[r\r]r^r`rarbrcrdrerhrirjrkrprvrsrs<   u p   +*1<*w  JF* ?? NN3 ^^D ^^D ~~f- >>*D 9w &4 & 9 9 ??1V001 67 0 0! 4 > LLE7+47 w L MEw LLE @ z!nnG Hv334 H:-T:< 1 2G(( 6?##H((M,,O%00+1148&P 7# {{       $$ $$  &&00   6=!!$$K-- 7 7"bBK .. ??&& {{$$ ,-JK" fO v+,w)*O, %&PwH<@ 6!"?? !12"KKf&)f&P0 6! ,v~~ ,,X ,X ,vv00& w$$K((M,,O((M((M$$K((Mh(htn w  I**N&&L 1 1&2D2D E P PPM 6!  Q.Q.fnk2rBJ56'.QQ7Qfv'(("11>B*,0" 6=!!$$K   6:**N0(>X 6;  I,,O%>&..d%>N88zBQ7"""JH1,4?00 6;  IbqV# 8 8'  I&)CtC U(U8 6?##((M,,O7 7.7*70 6;[.[>bD-bLv}%%4B 6 6 6=!!$$K%>>bqV# 6 6:1:#   K 6;  IbqV#,3,3^7/t7 ) + I^(/6==(/V 6?##((M88& 66 ;;D88" 67 LLE884 6:H$$KbqV#33&33"7.d7   H"    K ' Tw ]]F) bqV#'34' #v++4#++-#v++4#/,D/ { 3F- 6>"" F!1 FKJ}KJ\ 6=!!$$K1( 6>""&&L@E@e@.w 44 # %$ SSS S  S !,, LLVZZ0&//#vzz/2RR S   S**S !a Sl 6:H FOOCO$D EB!!r!H 6<  ""J  B ;M PP//&++g"67P P "r " Ptv~&& 2F*Fw""J %+$6$6!!*+X!Y&$&P,, b"EK12(/?3?H 6!? j&"5"5 6 6,:J )5CJ   2 ;??H%% __ # #F  * OOJ OOI OOE 6'((22DwnnG9191x 6?##((M k0k0\ 6=!!$$K!66 $ 4 *444F,<,