L iJ.dZddlmZmZddlZddlmZdZdZd,dZGdd e Z e d e fiZ e e _d e _edfd Zedfd ZedfdZedfdZefdZefdZGddZdZdZGddZGddZeZGdde ZeZGddeZGdd eZGd!d"eZ Gd#d$eZ!eee e!fD]#Z"d%jGe"j&e"_%["d'e$d(ee$efd)efd*Z%d'e$d)efd+Z&y)-zDefines experimental extensions to the standard "typing" module that are supported by the mypy typechecker. Example usage: from mypy_extensions import TypedDict )AnyDictN) _type_checkc tjdjddvr td y#tt f$rYywxYw)N__name__)abc functoolstypingz4TypedDict does not support instance and class checksF)sys _getframe f_globals TypeErrorAttributeError ValueError)clsothers U/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/mypy_extensions.py _check_failsrsW ==  % %j 19W WRS S X  J '   s/3AAct|i|SN)dict)rargskwargss r _dict_newrs    c |jdd}||}n |r tdt||d} tjdj j dd|d<t|d |d S#ttf$rY wxYw) NtotalTz@TypedDict takes either a dict or keyword arguments, but not both)__annotations__ __total__rr__main__ __module__)_from_functional_call) poprrr r rgetrr_TypedDictMeta)r _typename_fieldsrrnss r_typeddict_newr+s JJw %E () )"'] ?B ==+5599*jQ< )R4 HH J '   s2A55BBc(eZdZdfd ZexZZxZS)r'c dtvr ddl}|jdt|rdnd|dk(rtnt |d<t t|#||tf|}|jdi}d } |jD cic]\} } | t| | }} } |D]-} |j| jjdi/||_t!|d s||_|Scc} } w) N TypedDictrzmypy_extensions.TypedDict is deprecated, and will be removed in a future version. Use typing.TypedDict or typing_extensions.TypedDict instead. stacklevel__new__rz?TypedDict('Name', {f0: t0, f1: t1, ...}); each t must be a typer )globalswarningswarnDeprecationWarningr+rsuperr'r3rr&itemsrupdate__dict__rhasattrr )rnamebasesr*rr$r5tp_dictannsmsgntpbase __class__s rr3z_TypedDictMeta.__new__1s ') #  MMS#!6AA  +/+*=99 4S$Lvv',O59ZZ\BEAr;r3''BB BD KK ))*;R@ A B"&w , %G  CsC,)TF)rr" __qualname__r3r__instancecheck____subclasscheck__ __classcell__)rEs@rr'r'0s!F-98)rr'r.aA simple typed name space. 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, with each key associated with a value of a consistent type. This expectation is not checked at runtime but is only enforced by typecheckers. Usage:: Point2D = TypedDict('Point2D', {'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 could be accessed via Point2D.__annotations__. TypedDict supports two additional equivalent forms:: Point2D = TypedDict('Point2D', x=int, y=int, label=str) class Point2D(TypedDict): x: int y: int label: str The latter syntax is only supported in Python 3.6+, while two other syntax forms work for 3.2+ c|S)zA normal positional argumentr#typer=s rArgrMz Krc|S)z*A positional argument with a default valuer#rKs r DefaultArgrPrNrc|S)zA keyword-only argumentr#rKs rNamedArgrRrNrc|S)z,A keyword-only argument with a default valuer#rKs rDefaultNamedArgrTrNrc|S)z*A *args-style variadic positional argumentr#rLs rVarArgrWrNrc|S)z*A **kwargs-style variadic keyword argumentr#rVs rKwArgrYrNrc eZdZy)_DEPRECATED_NoReturnN)rr"rFr#rrr[r[srr[c|Srr#)rs rtraitr]s JrcdS)Nc|Srr#)xs rzmypyc_attr..sQrr#)attrskwattrss r mypyc_attrrds rceZdZdZdZy)_FlexibleAliasClsAppliedc||_yrval)selfris r__init__z!_FlexibleAliasClsApplied.__init__s rc|jSrrhrjrs r __getitem__z$_FlexibleAliasClsApplied.__getitem__s xxrN)rr"rFrkrnr#rrrfrfs rrfceZdZdZy)_FlexibleAliasClsct|dS)N)rfrms rrnz_FlexibleAliasCls.__getitem__s'R11rN)rr"rFrnr#rrrprps2rrpceZdZdZy)_NativeIntMetac"t|tSr) isinstanceint)rinsts rrGz _NativeIntMeta.__instancecheck__s$$$rN)rr"rFrGr#rrrtrts%rrtceZdZdefdZy)i64rc@|tur t||St|Sr _sentinelrwrr`rDs rr3z i64.__new__ y q$< 1v rNrr"rFr}r3r#rrrzrz yrrz) metaclassceZdZdefdZy)i32rc@|tur t||St|Srr|r~s rr3z i32.__new__rrNrr#rrrrrrrceZdZdefdZy)i16rc@|tur t||St|Srr|r~s rr3z i16.__new__rrNrr#rrrrrrrceZdZdefdZy)u8rc@|tur t||St|Srr|r~s rr3z u8.__new__rrNrr#rrrrrrra/A native fixed-width integer type when used with mypyc. In code not compiled with mypyc, behaves like the 'int' type in these runtime contexts: * {name}(x[, base=n]) converts a number or string to 'int' * isinstance(x, {name}) is the same as isinstance(x, int) r=r=module_globalsreturnc|jd|x}dtd|d}t||||<|dvr d|d|d|d }n Jd |dd dl}|j |t d |S)N _DEPRECATED_zmodule 'z' has no attribute ''>NoReturnz'mypy_extensions.zF' is deprecated, and will be removed in a future version. Use 'typing.z' or 'typing_extensions.z ' insteadz-Add deprecation message for 'mypy_extensions.rr/r1)r&rrr5r6r7)r=rrirAr5s r_warn_deprecationrs!!L"788A "6tfA>S!!N4 |v&& 8i I NEdV1MMu MM#)aM8 Jrc,t|tS)N)r)rr4rs r __getattr__rs T') <rs !I$$9T$9N ; 4   Bt d D 4  !  22 "# %T% H NNN>c3" ,I  F **F + ,Cc3hC$=c=c=r