grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026U iÛfb ãG@sàdZddlmZmZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z mZmZddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKgGZdàdMdN„ZdOdP„ZdQdR„ZdSdT„ZdUdV„ZdWdX„ZgZdYdZ„Zd[d\„ZGd]d^„d^ƒZGd_d`„d`ƒZGdadb„dbeedLdc�Zedddde�ZedGdfde�Zeddgde�Zeddhde�Z eddide�Z!ed djde�Z"ed dkde�Z#Gdld „d edLdc�Z$Gdmd„deedLdc�Z%d7dd5d9d:d4d6dddnœ Z&dodp„Z'Gdqdr„dredLdc�Z(Gdsdt„dte(dLdc�Z)Gdud „d ƒZ*Gdvdw„dwƒZ+Gdxdy„dyƒZ,dzd{d|d}d~gZ-dd€d�d‚dƒd„d…d†d‡dˆg Z.e-e.d‰gZ/dŠd‹„Z0dŒd�„Z1dŽd�„Z2d�d‘„Z3dd#ddd%dd!dd'd*g d’d“gd”œZ4Gd•d–„d–eƒZ5Gd—d „d e*e5d˜�Z6d™dI„Z7dšd?„Z8d›dœ„Z9e j:e j;e jdád�dC„Z?dždB„Z@dŸdA„ZAd dE„ZBd¡dF„ZCd¢d£„ZDd¤dH„ZEd¥d@„ZFe%d¦ƒZGe%d§ƒZHe%d¨ƒZIe%d©dLdª�ZJe%d«dLdª�ZKe%d¬dLdª�ZLe%d­dLd®�ZMe%d¯dLeNd°�ZOe%d>ePeQƒZRdâd±d²„ZSeSejjTd³ƒZTeSejjUeJƒZUeSejjVeJeMeKfƒZVeSejjWeJƒZWeSejjXeJƒZXeSejjYeJƒZYeSejjZeJƒZZeSejj[eJƒZ[eSejj\d³ƒZ\eSejj]eJƒZ]eSejj^eJƒZ^e)ejj_d³dLd´�Z_dµe__eSejj`eJƒZaeSejjbeGƒZbeSejjceHeLfƒZceSejjdeHeIfƒZdeSejjeeJƒZeeSejjfeGƒZfeSejjgd³ƒZge)ehd³d¶dLd·�Zid¸ei_eSejeGd¶d¹�ZkeSejleGƒZmeSeneGd¶d¹�Z`eSeoeJd¶d¹�ZpeSejjqeJƒZqeSejjreHƒZreSejjseHeLfƒZseSejjteLƒZteSejueJƒZveSejweJƒZxeSeyeHeIfd¶d¹�ZzeSej{eHeIfƒZ|eSej}eHeIfƒZ}eSej~eGƒZ~eSejeHeIfƒZeSejj€eJeMeKfƒZ€eSejj�eJeMfƒZ�eSeNeOd¶d¹�Z‚dºe‚_e7Gd»d0„d0e6ƒƒZƒe7Gd¼d.„d.e6ƒƒZ„e7Gd½d-„d-e6ƒƒZ…e7Gd¾d,„d,e6ƒƒZ†e7Gd¿d/„d/e6ƒƒZ‡e7GdÀd+„d+e6eJƒƒZˆe7GdÁd1„d1e6eJƒƒZ‰dÂdÄZŠdÄZ‹dÅZŒGdÆdÇ„dÇeNƒZ�GdÈd;„d;e�d˜�ZŽdÉdÊ„Z�dãdLdËœdÌdÍ„Z�dÎdÏ„Z‘GdÐdÑ„dÑeNƒZ’GdÒd<„d·sz&_collect_type_vars..)rPrÚappendrRÚ_specialÚextendÚ__parameters__Útuple)r`rhrZrir[Ú_collect_type_vars¬s rqcCs’t|tƒs|St|jƒ}t|jƒD]J\}}t|tƒr\t|ƒD]\}}||kr<||||<qdnd›d|›d|›d|›�ƒ‚dS) zŠCheck 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 classzToo ZmanyZfewz parameters for z ; actual z , expected N)rorTÚlen)ÚclsÚ parametersZalenZelenrZrZr[Ú_check_genericÎs  r}cCsÊg}|D]f}t|tƒr.|jtkr.| |j¡qt|tƒrdt|ƒdkrd|dtkrd| |dd…¡q| |¡qt |ƒ}t|ƒt|ƒkrÂg}|D] }||kr�| |¡|  |¡q�|}|rÂt |ƒ‚t|ƒS)zyAn internal helper for Union creation and substitution: flatten Unions among parameters, then remove duplicates. réN) rPrRrSrrnrsrprzrlÚsetÚremoveÚAssertionError)r|ÚparamsÚpZ all_paramsZ new_paramsrhrZrZr[Ú_remove_dups_flattenÛs""    r„cs4t ¡ˆƒ‰t ˆj¡t ˆ¡‡‡fdd„ƒ}|S)zInternal wrapper caching __getitem__ of generic types with a fallback to original function for non-hashable arguments. cs,z ˆ||ŽWStk r YnXˆ||ŽS©N©rT©ÚargsÚkwds©ÚcachedÚfuncrZr[Úinnerÿs  z_tp_cache..inner)Ú functoolsÚ lru_cacheÚ _cleanupsrlÚ cache_clearÚwraps)rŒr�rZrŠr[Ú _tp_cacheøs   r“csbt|tƒr| ˆˆ¡St|tƒr^t‡‡fdd„|jDƒƒ}||jkrH|S| |¡}|j|_|S|S)z…Evaluate all forward references in the given type t. For use of globalns and localns see the docstring for get_type_hints(). c3s|]}t|ˆˆƒVqdSr…)Ú _eval_type©rgrx©ÚglobalnsÚlocalnsrZr[Ú sz_eval_type..)rPr Ú _evaluaterRrprsrvrm)rhr—r˜Zev_argsÚresrZr–r[r” s     r”c@seZdZdZdZdd„ZdS)Ú_FinalzMixin to prohibit subclassing)Ú __weakref__cOsd|krtdƒ‚dS)NÚ_rootz&Cannot subclass special typing classesr†©Úselfrˆr‰rZrZr[Ú__init_subclass__sz_Final.__init_subclass__N)rbr^r_Ú__doc__Ú __slots__r¡rZrZrZr[rœsrœc@s eZdZdZdd„Zdd„ZdS)Ú _Immutablez3Mixin to indicate that object should not be copied.cCs|Sr…rZ©r rZrZr[Ú__copy__%sz_Immutable.__copy__cCs|Sr…rZ)r ZmemorZrZr[Ú __deepcopy__(sz_Immutable.__deepcopy__N)rbr^r_r¢r¦r§rZrZrZr[r¤"sr¤cspeZdZdZdZ‡fdd„Zdd„Zdd„Zd d „Zd d „Z d d„Z dd„Z dd„Z dd„Z edd„ƒZ‡ZS)rUzhInternal indicator of special typing constructs. See _doc instance attribute for specific docs. ©Ú_nameZ_doccsBt|ƒdkr6t|dtƒr6t|dtƒr6td|›�ƒ‚tƒ |¡S)z£Constructor. This only exists to give a better error message in case someone tries to subclass a special typing object (not a good idea). érr~zCannot subclass )rzrPrQrprTÚsuperÚ__new__)r{rˆr‰©Ú __class__rZr[r¬3s  ÿ þz_SpecialForm.__new__cCs||_||_dSr…r¨)r ÚnameÚdocrZrZr[Ú__init__@sz_SpecialForm.__init__cCst|tƒstS|j|jkSr…)rPrUÚNotImplementedr©©r ÚotherrZrZr[Ú__eq__Ds z_SpecialForm.__eq__cCs t|jfƒSr…)Úhashr©r¥rZrZr[Ú__hash__Isz_SpecialForm.__hash__cCs d|jS)Nútyping.©r©r¥rZrZr[Ú__repr__Lsz_SpecialForm.__repr__cCs|jSr…r¹r¥rZrZr[Ú __reduce__Osz_SpecialForm.__reduce__cOstd|›�ƒ‚dS)NzCannot instantiate r†rŸrZrZr[Ú__call__Rsz_SpecialForm.__call__cCst|›d�ƒ‚dS)Nz! cannot be used with isinstance()r†©r rdrZrZr[Ú__instancecheck__Usz_SpecialForm.__instancecheck__cCst|›d�ƒ‚dS)Nz! cannot be used with issubclass()r†©r r{rZrZr[Ú__subclasscheck__Xsz_SpecialForm.__subclasscheck__csÜ|jdkr(t||j›d�ƒ}t||fƒS|jdkr’|dkrBtdƒ‚t|tƒsR|f}d‰t‡fdd„|Dƒƒ}t|ƒ}t|ƒd krˆ|d St||ƒS|jd kr¶t|d ƒ}t|t dƒfS|jd krÊt||ƒSt|›d�ƒ‚dS)N)r r z accepts only single type.rrZz Cannot take a Union of no types.z)Union[arg, ...]: each arg must be a type.c3s|]}t|ˆƒVqdSr…©r\©rgrƒ©rXrZr[r™fsz+_SpecialForm.__getitem__..r~rrz#Optional[t] requires a single type.r z is not subscriptable) r©r\rRrTrPrpr„rzrrO)r r|ÚitemrWrZrÃr[Ú __getitem__[s(          z_SpecialForm.__getitem__)rbr^r_r¢r£r¬r±rµr·rºr»r¼r¾rÀr“rÅÚ __classcell__rZrZr­r[rU,s rU)rža`Special 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 or class checks. )r°aSpecial 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. a3Special type construct to mark class variables. An annotation wrapped in ClassVar indicates that a given attribute is intended to be used as a class variable and should not be set on instances of that class. Usage:: class Starship: stats: ClassVar[Dict[str, int]] = {} # class variable damage: int = 10 # instance variable ClassVar accepts only types and cannot be further subscribed. Note that ClassVar is not a class itself, and should not be used with isinstance() or issubclass(). aÄSpecial typing construct to indicate final names to type checkers. A final 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. a'Union type; Union[X, Y] means either X or Y. To define a union, use e.g. Union[int, str]. Details: - The arguments must be types and there must be at least one. - None as an argument is a special case and is replaced by type(None). - Unions of unions are flattened, e.g.:: Union[Union[int, str], float] == Union[int, str, float] - Unions of a single argument vanish, e.g.:: Union[int] == int # The constructor actually returns int - Redundant arguments are skipped, e.g.:: Union[int, str, int] == Union[int, str] - When comparing unions, the argument order is ignored, e.g.:: Union[int, str] == Union[str, int] - You cannot subclass or instantiate a union. - You can use Optional[X] as a shorthand for Union[X, None]. zEOptional type. Optional[X] is equivalent to Union[X, None]. aöSpecial typing form to define literal types (a.k.a. value types). This form can be used to indicate to type checkers that the corresponding variable or function parameter has a value equivalent to the provided literal (or one of several literals): def validate_simple(data: Any) -> Literal[True]: # always returns True ... MODE = Literal['r', 'rb', 'w', 'wb'] def open_helper(file: str, mode: MODE) -> str: ... open_helper('/some/path', 'r') # Passes type check open_helper('/other/path', 'typo') # Error in type checker Literal[...] cannot be subclassed. At runtime, an arbitrary value is allowed as type argument to Literal[...], but type checkers may impose restrictions. c@s>eZdZdZdZddd„Zdd„Zdd „Zd d „Zd d „Z dS)r z-Internal wrapper to hold a forward reference.)Ú__forward_arg__Ú__forward_code__Ú__forward_evaluated__Ú__forward_value__Ú__forward_is_argument__TcCsnt|tƒstd|›�ƒ‚zt|ddƒ}Wn"tk rJtd|›�ƒ‚YnX||_||_d|_d|_||_ dS)Nz*Forward reference must be a string -- got zÚevalz/Forward reference must be an expression -- got F) rPrQrTÚcompileÚ SyntaxErrorrÇrÈrÉrÊrË)r rWrYÚcoderZrZr[r±ðs zForwardRef.__init__cCsj|jr||k rd|dkr(|dkr(i}}n|dkr6|}n |dkrB|}tt|j||ƒd|jd�|_d|_|jS)Nz*Forward references must evaluate to types.©rYT)rÉr\rÌrÈrËrÊ)r r—r˜rZrZr[ršýs  ýzForwardRef._evaluatecCs>t|tƒstS|jr2|jr2|j|jko0|j|jkS|j|jkSr…)rPr r²rÉrÇrÊr³rZrZr[rµ s    ÿzForwardRef.__eq__cCs t|jƒSr…)r¶rÇr¥rZrZr[r·szForwardRef.__hash__cCsd|j›d�S)Nz ForwardRef(ú))rÇr¥rZrZr[rºszForwardRef.__repr__N)T) rbr^r_r¢r£r±ršrµr·rºrZrZrZr[r és c@s6eZdZdZdZddddœdd„Zdd „Zd d „ZdS) raâType variable. Usage:: T = TypeVar('T') # Can be anything A = TypeVar('A', str, bytes) # Must be str or bytes Type variables exist primarily for the benefit of static type checkers. They serve as the parameters for generic types as well as for generic function definitions. See class Generic for more information on generic types. Generic functions work as follows: def repeat(x: T, n: int) -> List[T]: '''Return a list containing n references to x.''' return [x]*n def longest(x: A, y: A) -> A: '''Return the longest of two strings.''' return x if len(x) >= len(y) else y The latter example's signature is essentially the overloading of (str, str) -> str and (bytes, bytes) -> bytes. Also note that if the arguments are instances of some subclass of str, the return type is still plain str. At runtime, isinstance(x, T) and issubclass(C, T) will raise TypeError. Type variables defined with covariant=True or contravariant=True can be used to declare covariant or contravariant generic types. See PEP 484 for more details. By default generic types are invariant in all type variables. Type variables can be introspected. e.g.: T.__name__ == 'T' T.__constraints__ == () T.__covariant__ == False T.__contravariant__ = False A.__constraints__ == (str, bytes) Note that only type variables defined in global scope can be pickled. )rbÚ __bound__Ú__constraints__Ú __covariant__Ú__contravariant__NF)ÚboundÚ covariantÚ contravariantc sÒ||_|r|rtdƒ‚t|ƒ|_t|ƒ|_|r>|dk r>tdƒ‚|rVt|ƒdkrVtdƒ‚d‰t‡fdd„|Dƒƒ|_|r„t |dƒ|_ nd|_ zt   d¡j  d d ¡}Wnttfk r¾d}YnX|d krÎ||_dS) Nz"Bivariant types are not supported.z-Constraints cannot be combined with bound=...r~z"A single constraint is not allowedz:TypeVar(name, constraint, ...): constraints must be types.c3s|]}t|ˆƒVqdSr…rÁrfrÃrZr[r™Vsz#TypeVar.__init__..zBound must be a type.rbÚ__main__Útyping)rbÚ ValueErrorÚboolrÔrÕrTrzrprÓr\rÒÚsysÚ _getframeÚ f_globalsÚgetÚAttributeErrorr^)r r¯rÖr×rØZ constraintsZdef_modrZrÃr[r±Js(    zTypeVar.__init__cCs&|jr d}n|jrd}nd}||jS)Nú+ú-ú~)rÔrÕrb)r ÚprefixrZrZr[rºbs zTypeVar.__repr__cCs|jSr…)rbr¥rZrZr[r»kszTypeVar.__reduce__)rbr^r_r¢r£r±rºr»rZrZrZr[rs+ÿ  ) rrrpÚdictrÚ frozensetÚdequeÚ defaultdictrOr;cCs| d¡o| d¡S)NÚ__)Ú startswithÚendswith)ÚattrrZrZr[Ú _is_dunder†srîcsŽeZdZdZddddœdd„Zedd „ƒZd d „Zd d „Zdd„Z dd„Z dd„Z dd„Z dd„Z ‡fdd„Zdd„Zdd„Zdd„Z‡ZS) rRa°The central part of internal API. This represents a generic version of type 'origin' with type arguments 'params'. There are two kind of these aliases: user defined and special. The special ones are wrappers around builtin collections and ABCs in collections.abc. These must have 'name' always set. If 'inst' is False, then the alias can't be instantiated, this is used by e.g. typing.List and typing.Dict. TFN)ÚinstÚspecialr¯cCsz||_||_|r*|dkr*|j}t ||¡}||_t|tƒs@|f}||_tdd„|Dƒƒ|_ t |ƒ|_ d|_ |sv|j |_ dS)Ncss*|]"}|tkrdn|tkrdn|VqdS).rZN)Ú_TypingEllipsisÚ _TypingEmptyr•rZrZr[r™�sþ  z)_GenericAlias.__init__..)Ú_instrmrbÚ_normalize_aliasràr©rPrprSrsrqror£r^)r Úoriginr‚rïrðr¯Z orig_namerZrZr[r±“s    þ  z_GenericAlias.__init__cs^|jttfkrtd|›�ƒ‚t|tƒs,|f}d‰t‡fdd„|Dƒƒ}t||ƒt||j|ƒS)Nz%Cannot subscript already-subscripted ú*Parameters to generic types must be types.c3s|]}t|ˆƒVqdSr…rÁrÂrÃrZr[r™­sz,_GenericAlias.__getitem__..) rSr rrTrPrpr}ruro©r r‚rZrÃr[rÅ¥s  z_GenericAlias.__getitem__cCst|j||j|jd�S)N)r¯rï)rRrSr©rór÷rZrZr[rv±sz_GenericAlias.copy_withcCs¸|jdks&t|jƒdkrx|jdtkrx|jr8d|j}n t|jƒ}|jshdd dd„|jDƒ¡›d �}nd }|›|›�S|jr‚d Sd d d d„|jdd…Dƒ¡›dt|jdƒ›d �S)Nrérr¸ú[ú, cSsg|] }t|ƒ‘qSrZ©rer•rZrZr[rk½sz*_GenericAlias.__repr__..ú]Úztyping.Callableztyping.Callable[[cSsg|] }t|ƒ‘qSrZrûr•rZrZr[rkÃséÿÿÿÿz], )r©rzrsÚEllipsisrerSrmÚjoin)r r¯rˆrZrZr[rºµs  ÿ ÿ    z_GenericAlias.__repr__cCsRt|tƒstS|j|jkrdS|jtkrF|jtkrFt|jƒt|jƒkS|j|jkS)NF)rPrRr²rSrrçrsr³rZrZr[rµÇs  z_GenericAlias.__eq__cCs,|jtkrttt|jƒfƒSt|j|jfƒSr…)rSrr¶rçrsr¥rZrZr[r·Ðs z_GenericAlias.__hash__cOsT|js$td|j›d|j ¡›d�ƒ‚|j||Ž}z ||_Wntk rNYnX|S)NúType z cannot be instantiated; use z () instead)rórTr©ÚlowerrSÚ__orig_class__rá)r rˆÚkwargsÚresultrZrZr[r¼Õs  z_GenericAlias.__call__cCs°|jrZg}|j|kr | |j¡| |¡}tdd„||dd…DƒƒsR| t¡t|ƒS|jtkr¨t|krpdS| |¡}||dd…D]}t|t ƒrŠ||k rŠdSqŠ|jfS)Ncss"|]}t|tƒpt|tƒVqdSr…)rPrRÚ issubclassr ©rgÚbrZrZr[r™æsÿz0_GenericAlias.__mro_entries__..r~rZ) r©rSrlÚindexÚanyr rprrPrR)r Úbasesr›ryrrZrZr[Ú__mro_entries__às$   ÿ   z_GenericAlias.__mro_entries__cCs*d|jkrt|ƒst|j|ƒSt|ƒ‚dS)NrS)Ú__dict__rîÚgetattrrSrá)r rírZrZr[Ú __getattr__ós z_GenericAlias.__getattr__cs2t|ƒs|dkr tƒ ||¡nt|j||ƒdS)N)r©rórm)rîr«Ú __setattr__ÚsetattrrS)r ríÚvalr­rZr[rúsz_GenericAlias.__setattr__cCs| t|ƒ¡Sr…)rÀrOr½rZrZr[r¾sz_GenericAlias.__instancecheck__cCs<|jr0t|tƒst||jƒS|jr0t|j|jƒStdƒ‚dS)NzBSubscripted generics cannot be used with class and instance checks)rmrPrRrrSrTr¿rZrZr[rÀs   z_GenericAlias.__subclasscheck__cCs |jr |jS|jr tƒ|j}n|j}|tkrht|jƒdkrJ|jdtksht|jdd…ƒ|jdf}n*t |jƒ}t|ƒdkr’t |dt ƒs’|\}t j ||ffS)Nrørrþr~) rmr©ÚglobalsrSrrzrsrÿrrrprPÚoperatorÚgetitem)r rõrˆrZrZr[r» s ÿ ÿ z_GenericAlias.__reduce__)rbr^r_r¢r±r“rÅrvrºrµr·r¼r rrr¾rÀr»rÆrZrZr­r[rRŠs     rRcs,eZdZdZdd„Ze‡fdd„ƒZ‡ZS)Ú_VariadicGenericAliaszŒSame as _GenericAlias above but for variadic aliases. Currently, this is used only by special internal aliases: Tuple and Callable. cCs€|jdks|js| |¡St|tƒr0t|ƒdkr8tdƒ‚|\}}|tkrRt|f}n$t|tƒsjtd|›�ƒ‚t|ƒ|f}| |¡S)Nrrøz6Callable must be used as Callable[[arg, ...], result].z1Callable[args, result]: args must be a list. Got ) r©rmÚ__getitem_inner__rPrprzrTrÿrr)r r‚rˆrrZrZr[rÅ"s    z!_VariadicGenericAlias.__getitem__cs |jtkr�|jr�|dkr$| tf¡St|tƒs4|f}t|ƒdkrl|ddkrld‰t|dˆƒ}| |tf¡Sd‰t‡fdd „|Dƒƒ}| |¡S|jt j j krþ|jrþ|\}}d ‰t|ˆƒ}|t krÐ| t|f¡Sd ‰t‡fd d „|Dƒƒ}||f}| |¡St ƒ |¡S) NrZrør~.z Tuple[t, ...]: t must be a type.rz*Tuple[t0, t1, ...]: each t must be a type.c3s|]}t|ˆƒVqdSr…rÁrÂrÃrZr[r™>sz:_VariadicGenericAlias.__getitem_inner__..z.Callable[args, result]: result must be a type.z6Callable[[arg, ...], result]: each arg must be a type.c3s|]}t|ˆƒVqdSr…rÁ)rgrWrÃrZr[r™Gs)rSrprmrvròrPrzr\rñÚ collectionsÚabcrrÿr«rÅ)r r‚rƒrˆrr­rÃr[r2s.      z'_VariadicGenericAlias.__getitem_inner__)rbr^r_r¢rÅr“rrÆrZrZr­r[rsrcs@eZdZdZdZdZ‡fdd„Zedd„ƒZ‡fdd „Z ‡Z S) r aCAbstract base class for generic types. A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:: class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc. This class can then be used as follows:: def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default rZFcs^|ttfkrtd|j›d�ƒ‚tƒjtjkrF|jtjk rFtƒ |¡}ntƒj|f|ž|Ž}|S)Nrz< cannot be instantiated; it can be used only as a base class)r rrTrbr«r¬Úobjectr±)r{rˆr‰rdr­rZr[r¬ds  zGeneric.__new__cs´t|tƒs|f}|s.|tk r.td|j›d�ƒ‚d‰t‡fdd„|Dƒƒ}|ttfkr tdd„|Dƒƒsxtd|j›d�ƒ‚t t |ƒƒt |ƒkrªtd|j›d �ƒ‚n t ||ƒt ||ƒS) NzParameter list to z[...] cannot be emptyröc3s|]}t|ˆƒVqdSr…rÁrÂrÃrZr[r™vsz,Generic.__class_getitem__..css|]}t|tƒVqdSr…)rPrrÂrZrZr[r™yszParameters to z [...] must all be type variablesz[...] must all be unique) rPrprrTr_r rÚallrbrzrr}rR)r{r‚rZrÃr[Ú__class_getitem__ns&   ÿ  ÿ ÿ zGeneric.__class_getitem__c s tƒj||Žg}d|jkr(t|jk}nt|jko:|jdk}|rHtdƒ‚d|jkrüt|jƒ}d}|jD].}t |t ƒrf|j tkrf|dk rŽtdƒ‚|j }qf|dk rüt |ƒ}t |ƒ‰|ˆksød ‡fdd„|Dƒ¡}d dd„|Dƒ¡} td |›d | ›d �ƒ‚|}t|ƒ|_ dS) NÚ__orig_bases__rz!Cannot inherit from plain Genericz0Cannot inherit from Generic[...] multiple types.rúc3s|]}|ˆkrt|ƒVqdSr…©rQrf©ZgvarsetrZr[r™ sz,Generic.__init_subclass__..css|]}t|ƒVqdSr…r)rgÚgrZrZr[r™¡szSome type variables (z) are not listed in Generic[rü)r«r¡r r rÚ __bases__rbrTrqrPrRrSrorrrp) r{rˆrrjÚerrorZgvarsÚbaseZtvarsetZs_varsZs_argsr­rr[r¡„s8      ÿÿzGeneric.__init_subclass__) rbr^r_r¢r£Ú _is_protocolr¬r“rr¡rÆrZrZr­r[r Ms  c@seZdZdZdS)ròz´Internal placeholder for () or []. Used by TupleMeta and CallableMeta to allow empty list/tuple in specific places, without allowing them to sneak in where prohibited. N©rbr^r_r¢rZrZrZr[rò¨sròc@seZdZdZdS)rñz(Internal placeholder for ... (ellipsis).Nr%rZrZrZr[rñ¯srñrorrr$Ú_is_runtime_protocolÚ__abstractmethods__Ú__annotations__r r¢r±r^r¬r£Ú__subclasshook__r�Ú_MutableMapping__markercCsrtƒ}|jdd…D]X}|jdkr$qt|diƒ}t|j ¡ƒt| ¡ƒD] }| d¡sJ|tkrJ|  |¡qJq|S)zÓCollect protocol members from a protocol class objects. This includes names actually defined in the class dictionary, as well as names that appear in annotations. Special names (above) are skipped. Nrþ)rr r(Z_abc_) rÚ__mro__rbrrrr ÚkeysrëÚEXCLUDED_ATTRIBUTESÚadd)r{Úattrsr#Ú annotationsrírZrZr[Ú_get_protocol_attrs¾s  r1cst‡fdd„tˆƒDƒƒS)Nc3s|]}ttˆ|dƒƒVqdSr…)rVr©rgrí©r{rZr[r™Ñsz,_is_callable_members_only..)rr1r3rZr3r[Ú_is_callable_members_onlyÏsr4cOst|ƒjrtdƒ‚dS)Nz Protocols cannot be instantiated)rOr$rT)r rˆrrZrZr[Ú_no_initÔs r5c Cs6zt d¡jddkWSttfk r0YdSXdS)zÛAllow instnance and class checks for special stdlib modules. The abc and functools modules indiscriminately call isinstance() and issubclass() on the whole MRO of a user class, which may contain protocols. rªrb)rrŽTN)rÝrÞrßrárÛrZrZrZr[Ú_allow_reckless_class_cheksÙsr6ÚAbstractContextManagerÚAbstractAsyncContextManager)zcollections.abcÚ contextlibcseZdZ‡fdd„Z‡ZS)Ú _ProtocolMetacsVtˆddƒrtˆƒr$tˆjˆƒr$dSˆjrJt‡‡fdd„tˆƒDƒƒrJdStƒ ˆ¡S)Nr$FTc3s8|]0}tˆ|ƒo.ttˆ|dƒƒ p.tˆ|ƒdk VqdSr…)ÚhasattrrVrr2©r{ÚinstancerZr[r™ùsü z2_ProtocolMeta.__instancecheck__..) rr4rr®r$rr1r«r¾r<r­r<r[r¾ñs ÿ þüz_ProtocolMeta.__instancecheck__)rbr^r_r¾rÆrZrZr­r[r:îsr:cs,eZdZdZdZdZdZ‡fdd„Z‡ZS)raZBase 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.runtime_checkable act as simple-minded runtime 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: ... rZTFcs°tƒj||Žˆj dd¡s2tdd„ˆjDƒƒˆ_‡fdd„}dˆjkrN|ˆ_ˆjsXdSˆjD]F}|tt fks^|j t krˆ|j t |j ks^t |t ƒr˜|js^td|ƒ‚q^tˆ_dS) Nr$Fcss|]}|tkVqdSr…)rrrZrZr[r™)sz-Protocol.__init_subclass__..csàˆj dd¡stStˆddƒs0tƒr(tStdƒ‚tˆƒsJtƒrBtStdƒ‚t|tƒs\tdƒ‚t ˆƒD]v}|j D]b}||jkrš|j|dkr–tSqdt|diƒ}t|t j j ƒrn||krnt|tƒrn|jrnqdqntSqddS) Nr$Fr&zLInstance and class checks can only be used with @runtime_checkable protocolsz._proto_hookr)z7Protocols can only inherit from other protocols, got %r)r«r¡r ràr r!r$r)rr r^Ú_PROTO_WHITELISTrbrrTr5r±)r{rˆrr>r#r­r3r[r¡$s, &   ÿþýýÿzProtocol.__init_subclass__) rbr^r_r¢r£r$r&r¡rÆrZrZr­r[rs )Ú metaclasscCs&t|tƒr|jstd|ƒ‚d|_|S)a9Mark a protocol class as a runtime protocol. Such protocol 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 one trick ponies in collections.abc such as Iterable. For example:: @runtime_checkable class Closable(Protocol): def close(self): ... assert isinstance(open('/some/file'), Closable) Warning: this will check only the presence of the required methods, not their type signatures! zB@runtime_checkable can be only applied to protocol classes, got %rT)rr r$rTr&r3rZrZr[rKds ÿcCs|S)zÿCast a value to a type. This returns the value unchanged. To the type checker this signals that the return value has the designated type, but at runtime we intentionally don't check anything (we want this to be as fast as possible). rZ)ÚtyprrZrZr[rA}sc Csœz |j}Wntk r"iYSX|j}|j}|d|…}|jpDd}|j}|rXt|ƒni}|t|ƒ}t||d…|ƒD]\}} ||ksŽt ‚| ||<qz|S)z:Internal helper to extract the default arguments, by name.NrZ) Ú__code__ráÚ co_argcountÚ co_varnamesÚ __defaults__Ú__kwdefaults__rærzÚzipr�) rŒrÏZ pos_countZ arg_namesÚdefaultsZ kwdefaultsr›Z pos_offsetr¯ÚvaluerZrZr[Ú _get_defaultsˆs       rJc Cs¸t|ddƒriSt|tƒr¨i}t|jƒD]z}|dkrDtj|jj}n|}|j  di¡}|  ¡D]B\}}|dkrvtdƒ}t|t ƒrŒt |dd�}t |||ƒ}|||<q^q(|S|dkrôt|tjƒrÄ|j}n"|} t| dƒrÚ| j} qÈt| diƒ}|dkrò|}n|dk�r|}t|ddƒ}|dk�r6t|tƒ�r(iStd |¡ƒ‚t|ƒ} t|ƒ}|  ¡D]d\}}|dk�rhtdƒ}t|t ƒ�r|t |ƒ}t |||ƒ}|| k�r¨| |dk�r¨t|}|||<�qN|S) a¹Return type hints for an object. This is often the same as obj.__annotations__, but it handles forward references encoded as string literals, and if necessary adds Optional[t] if a default value equal to None is set. 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. Ú__no_type_check__Nr(FrÐÚ __wrapped__Ú __globals__z1{!r} is not a module, class, method, or function.)rrPrOÚreversedr+rÝÚmodulesr^r ràÚitemsrQr r”r`Ú ModuleTyper;rLÚ_allowed_typesrTÚformatrJrær) rdr—r˜Zhintsr#Z base_globalsÚannr¯rIZnsobjrHrZrZr[rE¡s^             ÿ    cCs t|tƒr|jS|tkrtSdS)aßGet the unsubscripted version of a type. This supports generic types, Callable, Tuple, Union, Literal, Final and ClassVar. 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 N)rPrRrSr )rwrZrZr[rD÷s  cCsRt|tƒrN|jsN|j}t|ƒtjjkrJ|dtk rJt |dd…ƒ|df}|SdS)a¦Get 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) rNrþrZ) rPrRrmrsrDrrrrÿrr)rwr›rZrZr[rC s cCs˜t|tƒrt|j ¡}|j ¡D]"\}}||j|fkr| |¡q| ¡D](}t|tj ƒr`d|_ t|tƒrJt |ƒqJz d|_ Wnt k r’YnX|S)aIDecorator to indicate that annotations are not type hints. The argument must be a class or function; if it is a class, it applies recursively to all methods and classes defined in that class (but not to methods defined in its superclasses or subclasses). This mutates the function(s) or class(es) in place. T) rPrOr ÚcopyrPr!ÚpopÚvaluesr`rarKrGrT)rWZ arg_attrsrírrdrZrZr[rGs        cst ˆ¡‡fdd„ƒ}|S)z©Decorator to give another decorator the @no_type_check effect. This wraps the decorator with something that wraps the decorated function in @no_type_check. csˆ||Ž}t|ƒ}|Sr…)rG)rˆr‰rŒ©Ú decoratorrZr[Úwrapped_decorator@s z2no_type_check_decorator..wrapped_decorator)rŽr’)rYrZrZrXr[rH9scOs tdƒ‚dS)z*Helper for @overload to raise when called.z´You should not call an overloaded function. A series of @overload-decorated functions outside a stub module should always be followed by an implementation that is not @overload-ed.N)ÚNotImplementedErrorr‡rZrZr[Ú_overload_dummyIsÿr\cCstS)a Decorator for overloaded functions/methods. In a stub file, place two or more stub definitions for the same function in a row, each decorated with @overload. For example: @overload def utf8(value: None) -> 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 )r\)rŒrZrZr[rJRscCs|S)aVA decorator to indicate final methods and final classes. Use this decorator 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. rZ)ÚfrZrZr[rBosÚTÚKTÚVTÚT_co)r×ÚV_coÚVT_coÚT_contra)rØÚCT_co)r×rÖcCst||d|d�S)NT)rðrï)rR)rõr‚rïrZrZr[Ú_alias›srfrZ)rða�Callable type; Callable[[int], str] is a function of (int) -> str. The subscription syntax must always be used with exactly two values: the argument list and the return type. The argument list must be a list of types or ellipsis; the return type must be a single type. There is no syntax to indicate optional or keyword arguments, such function types are rarely used as callback types. F)rïrða@Tuple type; Tuple[X, Y] is the cross-product type of X and Y. Example: Tuple[T1, T2] is a tuple of two elements corresponding to type variables T1 and T2. Tuple[int, float, str] is a tuple of an int, a float and a string. To specify a variable-length tuple of homogeneous type, use Tuple[T, ...]. )rïa¾A special construct usable to annotate class objects. For example, suppose we have the following classes:: class User: ... # Abstract base for User classes class BasicUser(User): ... class ProUser(User): ... class TeamUser(User): ... And a function that takes a class argument that's a subclass of User and returns an instance of the corresponding class:: U = TypeVar('U', bound=User) def new_user(user_class: Type[U]) -> U: user = user_class() # (Here we could write the user object to a database) return user joe = new_user(BasicUser) At this point the type checker knows that joe has type BasicUser. c@s&eZdZdZdZeedœdd„ƒZdS)r2z(An ABC with one abstract method __int__.rZ©ÚreturncCsdSr…rZr¥rZrZr[Ú__int__öszSupportsInt.__int__N)rbr^r_r¢r£rÚintrirZrZrZr[r2ñsc@s&eZdZdZdZeedœdd„ƒZdS)r0z*An ABC with one abstract method __float__.rZrgcCsdSr…rZr¥rZrZr[Ú __float__szSupportsFloat.__float__N)rbr^r_r¢r£rÚfloatrkrZrZrZr[r0ûsc@s&eZdZdZdZeedœdd„ƒZdS)r/z,An ABC with one abstract method __complex__.rZrgcCsdSr…rZr¥rZrZr[Ú __complex__ szSupportsComplex.__complex__N)rbr^r_r¢r£rÚcomplexrmrZrZrZr[r/sc@s&eZdZdZdZeedœdd„ƒZdS)r.z*An ABC with one abstract method __bytes__.rZrgcCsdSr…rZr¥rZrZr[Ú __bytes__szSupportsBytes.__bytes__N)rbr^r_r¢r£rÚbytesrorZrZrZr[r.sc@s&eZdZdZdZeedœdd„ƒZdS)r1z*An ABC with one abstract method __index__.rZrgcCsdSr…rZr¥rZrZr[Ú __index__szSupportsIndex.__index__N)rbr^r_r¢r£rrjrqrZrZrZr[r1sc@s&eZdZdZdZeedœdd„ƒZdS)r-zMAn ABC with one abstract method __abs__ that is covariant in its return type.rZrgcCsdSr…rZr¥rZrZr[Ú__abs__(szSupportsAbs.__abs__N)rbr^r_r¢r£rrarrrZrZrZr[r-#sc@s*eZdZdZdZedeedœdd„ƒZdS) r3zOAn ABC with one abstract method __round__ that is covariant in its return type.rZr)ÚndigitsrhcCsdSr…rZ)r rsrZrZr[Ú __round__2szSupportsRound.__round__N)r) rbr^r_r¢r£rrjrartrZrZrZr[r3-sc std‰‡fdd„|Dƒ}t |dd„|Dƒ¡}t|ƒ|_|_zt d¡j dd¡|_ Wnt t fk rnYnX|S)NzDNamedTuple('Name', [(f0, t0), (f1, t1), ...]); each t must be a typecsg|]\}}|t|ˆƒf‘qSrZrÁ©rgÚnrhrÃrZr[rk9sz!_make_nmtuple..cSsg|] \}}|‘qSrZrZrurZrZr[rk:srørbrÙ) rÚ namedtuplerær(Ú _field_typesrÝrÞrßràr^rárÛ)r¯r`Únm_tplrZrÃr[Ú _make_nmtuple7srz) r¬r±r£Ú__getnewargs__Ú_fieldsÚ_field_defaultsrxÚ_makeÚ_replaceÚ_asdictZ_source)r^rbr(cseZdZ‡fdd„Z‡ZS)ÚNamedTupleMetac sò| dd¡rtƒ ||||¡S| di¡}t|| ¡ƒ}g}i}|D]H}||krl||} | | ¡| ||<qD|rDtdj|d |  ¡¡d�ƒ‚qDt |ƒ|j_ t |ƒ|j_ ||_|D]<} | tkrÊtd| ƒ‚q°| tkr°| |jkr°t|| || ƒq°|S)NržFr(zXNon-default namedtuple field {field_name} cannot follow default field(s) {default_names}rú)Ú field_nameZ default_namesz&Cannot overwrite NamedTuple attribute )ràr«r¬rzrPrlrTrSrr,rær(rprEr}Ú _prohibitedrármr|r) r{Útypenamer Únsr`ryrHZ defaults_dictr‚Z default_valueÚkeyr­rZr[r¬Os2     ý   zNamedTupleMeta.__new__)rbr^r_r¬rÆrZrZr­r[r�Msr�c@s"eZdZdZdZdd„Zde_dS)r=aµTyped version of namedtuple. Usage in Python versions >= 3.6:: class Employee(NamedTuple): name: str id: int This is equivalent to:: Employee = collections.namedtuple('Employee', ['name', 'id']) The resulting class has an extra __annotations__ attribute, giving a dict that maps field names to types. (The field names are also in the _fields attribute, which is part of the namedtuple API.) Alternative equivalent keyword syntax is also accepted:: Employee = NamedTuple('Employee', name=str, id=int) In Python versions <= 3.5 use:: Employee = NamedTuple('Employee', [('name', str), ('id', int)]) TcOsú|s tdƒ‚|^}}|r"|^}}n4d|krN| d¡}ddl}|jdtdd�ntdƒ‚|r–z |\}WqÒtk r’tdt|ƒd›d �ƒd‚YqÒXnr¬r(z?TypedDict('Name', {f0: t0, f1: t1, ...}); each t must be a typecsi|]\}}|t|ˆƒ“qSrZrÁ)rgrvrwrÃrZr[Ú Õsz*_TypedDictMeta.__new__..r�) r‘r�r«r�r¬ræràrPÚupdater r(r;r�)r{r¯r r…rŽZtp_dictZannsr#r­rÃr[r¬Çs   z_TypedDictMeta.__new__)T)rbr^r_r¬r’r¾rÀrÆrZrZr­r[r�Æsr�c@seZdZdZdS)r>aúA simple typed namespace. At runtime it is equivalent to a plain dict. TypedDict creates a dictionary type that expects all of its 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 but is only enforced by type checkers. 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 Point2D.__annotations__. TypedDict supports two additional equivalent forms:: Point2D = TypedDict('Point2D', x=int, y=int, label=str) 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. Usage:: 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 class syntax is only supported in Python 3.6+, while two other syntax forms work for Python 2.7 and 3.2+ Nr%rZrZrZr[r>àscCsdd„}||_||_|S)a%NewType creates simple unique types with almost zero runtime overhead. NewType(name, tp) is considered a subtype of tp by static type checkers. At runtime, NewType(name, tp) returns a dummy function that simply returns its argument. Usage:: UserId = NewType('UserId', int) def name_by_id(user_id: UserId) -> 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 cSs|Sr…rZ)ÚxrZrZr[Únew_typeszNewType..new_type)rbZ __supertype__)r¯rwr–rZrZr[rF sc@sªeZdZdZdZeeedœdd„ƒƒZeeedœdd„ƒƒZ eddœd d „ƒZ eee dœd d „ƒƒZ ee dœd d„ƒZeddœdd„ƒZee dœdd„ƒZed7e edœdd„ƒZee dœdd„ƒZed8e edœdd„ƒZed9e eedœdd„ƒZed:e e e d œd!d"„ƒZee dœd#d$„ƒZee dœd%d&„ƒZed;e e d'œd(d)„ƒZee dœd*d+„ƒZeee d,œd-d.„ƒZeeedd/œd0d1„ƒZed2dœd3d4„ƒZeddœd5d6„ƒZdS)<ÚIOaûGeneric base class for TextIO and BinaryIO. This is an abstract, generic version of the return of open(). NOTE: This does not distinguish between the different possible classes (text vs. binary, read vs. write vs. read/write, append-only, unbuffered). The TextIO and BinaryIO subclasses below capture the distinctions between text vs. binary, which is pervasive in the interface; however we currently do not offer a way to track the other distinctions in the type system. rZrgcCsdSr…rZr¥rZrZr[Úmode=szIO.modecCsdSr…rZr¥rZrZr[r¯BszIO.nameNcCsdSr…rZr¥rZrZr[ÚcloseGszIO.closecCsdSr…rZr¥rZrZr[ÚclosedKsz IO.closedcCsdSr…rZr¥rZrZr[ÚfilenoPsz IO.filenocCsdSr…rZr¥rZrZr[ÚflushTszIO.flushcCsdSr…rZr¥rZrZr[ÚisattyXsz IO.isattyrþ)rvrhcCsdSr…rZ)r rvrZrZr[Úread\szIO.readcCsdSr…rZr¥rZrZr[Úreadable`sz IO.readable)ÚlimitrhcCsdSr…rZ)r r rZrZr[Úreadlinedsz IO.readline)ÚhintrhcCsdSr…rZ)r r¢rZrZr[Ú readlineshsz IO.readlinesr)ÚoffsetÚwhencerhcCsdSr…rZ)r r¤r¥rZrZr[ÚseeklszIO.seekcCsdSr…rZr¥rZrZr[Úseekablepsz IO.seekablecCsdSr…rZr¥rZrZr[ÚtelltszIO.tell)ÚsizerhcCsdSr…rZ)r r©rZrZr[Útruncatexsz IO.truncatecCsdSr…rZr¥rZrZr[Úwritable|sz IO.writable©ÚsrhcCsdSr…rZ©r r­rZrZr[Úwrite€szIO.write)ÚlinesrhcCsdSr…rZ)r r°rZrZr[Ú writelines„sz IO.writelinesz IO[AnyStr]cCsdSr…rZr¥rZrZr[Ú __enter__ˆsz IO.__enter__cCsdSr…rZ)r rOrIÚ tracebackrZrZr[Ú__exit__Œsz IO.__exit__)rþ)rþ)rþ)r)N) rbr^r_r¢r£ÚpropertyrrQr˜r¯r™rÜršrjr›rœr�r@ržrŸr¡r9r£r¦r§r¨rªr«r¯r±r²r´rZrZrZr[r—.sZ r—c@sBeZdZdZdZeeeefe dœdd„ƒZ eddœdd„ƒZ d S) ÚBinaryIOz5Typed version of the return of open() in binary mode.rZr¬cCsdSr…rZr®rZrZr[r¯–szBinaryIO.writergcCsdSr…rZr¥rZrZr[r²šszBinaryIO.__enter__N) rbr^r_r¢r£rrrpÚ bytearrayrjr¯r²rZrZrZr[r¶‘s r¶c@s˜eZdZdZdZeeedœdd„ƒƒZeee dœdd„ƒƒZ eee e dœdd „ƒƒZ eee dœd d „ƒƒZeeedœd d „ƒƒZeddœdd„ƒZdS)ÚTextIOz3Typed version of the return of open() in text mode.rZrgcCsdSr…rZr¥rZrZr[Úbuffer¤sz TextIO.buffercCsdSr…rZr¥rZrZr[Úencoding©szTextIO.encodingcCsdSr…rZr¥rZrZr[Úerrors®sz TextIO.errorscCsdSr…rZr¥rZrZr[Úline_buffering³szTextIO.line_bufferingcCsdSr…rZr¥rZrZr[Únewlines¸szTextIO.newlinescCsdSr…rZr¥rZrZr[r²½szTextIO.__enter__N)rbr^r_r¢r£rµrr¶r¹rQrºrr»rÜr¼rr½r²rZrZrZr[r¸Ÿs&r¸c@s&eZdZdZdddgZeZeZeZdS)Úioz)Wrapper namespace for IO generic classes.r—r¸r¶N)rbr^r_r¢Ú__all__r—r¸r¶rZrZrZr[r¾Âs  r¾z.ioc@s eZdZdZddgZeZeZdS)Úrez&Wrapper namespace for re type aliases.ÚPatternÚMatchN)rbr^r_r¢r¿rÁrÂrZrZrZr[rÀÑsrÀz.re)T)NN)T)N)Ÿr¢rrrrZcollections.abcr9rŽrrÀZ stdlib_rerÝr`rrrr¿r\rerqrur}r„r�r“r”rœr¤rUrrIr r rrr r rrôrîrRrr ròrñZ_TYPING_INTERNALSZ_SPECIAL_NAMESr-r1r4r5r6r?r:rrKrArJraÚBuiltinFunctionTypeÚ MethodTyperQrRrErDrCrGrHr\rJrBr^r_r`rarbrcrdrOrerprQr@rfrr%r(r'r&rrr,r#rr)rr;rr!rrr"r rrprrrr9rèr6rrçr<rrrr$r7rr8r+rær7rér8r:r5r4r?r*rr2r0r/r.r1r-r3rzrƒrmr�r=r�r‘r’r�r>rFrLrMr—r¶r¸r¾rbrOrÁrÂrZrZrZr[Ús(°X !   Iÿ ÿ ÿÿÿÿÿ2aø /[ÿþþû b þ V       ÿ ÿ     ÿ       @+c#