zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
U
Z±dTã@sªddlZddlmZddlmZddlZddlZGdd„deƒZdd„Z    dd    „Z
d
d œd d „Z ddœdd„Z dd„Z ejddGdd„dƒƒZGdd„deƒZdd„ZdS)éN)Úwraps)Ú
ModuleTypec@seZdZdZdS)ÚTrioDeprecationWarningaÿWarning emitted if you use deprecated Trio functionality.
 
    As a young project, Trio is currently quite aggressive about deprecating
    and/or removing functionality that we realize was a bad idea. If you use
    Trio, you should subscribe to `issue #1
    <https://github.com/python-trio/trio/issues/1>`__ to get information about
    upcoming deprecations and other backwards compatibility breaking changes.
 
    Despite the name, this class currently inherits from
    :class:`FutureWarning`, not :class:`DeprecationWarning`, because while
    we're in young-and-aggressive mode we want these warnings to be visible by
    default. You can hide them by installing a filter or with the ``-W``
    switch: see the :mod:`warnings` documentation for details.
 
    N)Ú__name__Ú
__module__Ú __qualname__Ú__doc__©r    r    úFd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\trio/_deprecate.pyrsrcCs
d |¡S)Nz-https://github.com/python-trio/trio/issues/{})Úformat)Úissuer    r    r
Ú_url_for_issue sr cCs,t|dƒr$t|dƒr$d |j|j¡St|ƒS)Nrrú{}.{})Úhasattrr rrÚstr©Úthingr    r    r
Ú
_stringify$sré©Ú
stacklevelcCsl|d7}d t|ƒ|¡}|dkr*|d7}n|d t|ƒ¡7}|dk    rV|d t|ƒ¡7}tjt|ƒ|ddS)Néz{} is deprecated since Trio {}z with no replacementz; use {} insteadz ({})r)r rr ÚwarningsÚwarnr)rÚversionr ÚinsteadrÚmsgr    r    r
Úwarn_deprecated*s
rrcs‡‡‡‡fdd„}|S)Ncsžtˆƒ‡‡‡‡‡fdd„ƒ}ˆdkr(|‰|jdk    rš|j}| ¡}|d7}|d ˆ¡7}ˆdk    rp|d tˆƒ¡7}ˆdk    rŒ|d ˆtˆƒ¡7}|d7}||_|S)Ncstˆˆˆˆdˆ||ŽS)N)rr )r©ÚargsÚkwargs)Úfnrr rrr    r
Úwrapper<sz,deprecated.<locals>.do_wrap.<locals>.wrapperz
 
z.. deprecated:: {}
z   Use {} instead.
z(   For details, see `issue #{} <{}>`__.
Ú
)rrÚrstripr rr )r!r"Údoc©rr rr)r!r
Údo_wrap9s&
ÿzdeprecated.<locals>.do_wrapr    )rrr rr'r    r&r
Ú
deprecated8sr(cs@t||ˆdtˆdd‡fdd„ƒƒ}||_| d¡d|_|S)N©r r)rÚ__annotations__)Úassignedcs
ˆ||ŽS)zDeprecated alias.r    r©Únew_fnr    r
r"[sz!deprecated_alias.<locals>.wrapperÚ.éÿÿÿÿ)r(rrÚ
rpartitionr)Z old_qualnamer-rr r"r    r,r
Údeprecated_aliasZs  
r1T)Úfrozenc@s6eZdZeƒZe ¡Ze ¡Ze ¡Z    ejedZ
dS)ÚDeprecatedAttribute)ÚdefaultN) rrrÚobjectÚ_not_setÚattrÚibÚvaluerr rr    r    r    r
r3fs
r3c@seZdZdd„ZdS)Ú_ModuleWithDeprecationscCsl||jkrR|j|}|j}|tjkr*|j}d |j|¡}t||j|j    |d|jSd}t
| |j|¡ƒ‚dS)Nrr)z!module '{}' has no attribute '{}') Ú__deprecated_attributes__rr3r6r9r rrrr ÚAttributeError)ÚselfÚnameÚinforrrr    r    r
Ú __getattr__qs
 
 
z#_ModuleWithDeprecations.__getattr__N)rrrr@r    r    r    r
r:psr:cCstj|}t|_i|_dS)N)ÚsysÚmodulesr:Ú    __class__r;)Ú module_nameÚmoduler    r    r
Úenable_attribute_deprecationss
rF)rAÚ    functoolsrÚtypesrrr7Ú FutureWarningrr rrr(r1Úsr3r:rFr    r    r    r
Ú<module>s  "