hyb
2025-12-23 10f3a1daddfbc7fa3dd2069197d83e8b6ef19176
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Ë
KñúhPã
ó>—UdZddlmZmZddlmZmZmZmZddl    Z
gZ e e ed<dee e ffd„Zde e fd„Zde fd    „Zd
Zeed <e«Zeed <e«Zeed <e«Zeed<    erddlmZddlZddlmZddlmZmZm Z ddl!m"Z"m#Z#ee"gejHjJfZ&eed<de"dejHjJfd„Z'dee de de(fd„Z)dede de e*e e dzfddfd„Z+Gd„de#«Z,de de-fd „Z.y#e/$rZ0de de-fd!„Z.YdZ0[0ydZ0[0wwxYw)"aA mypy_ plugin for managing a number of platform-specific annotations.
Its functionality can be split into three distinct parts:
 
* Assigning the (platform-dependent) precisions of certain `~numpy.number`
  subclasses, including the likes of `~numpy.int_`, `~numpy.intp` and
  `~numpy.longlong`. See the documentation on
  :ref:`scalar types <arrays.scalars.built-in>` for a comprehensive overview
  of the affected classes. Without the plugin the precision of all relevant
  classes will be inferred as `~typing.Any`.
* Removing all extended-precision `~numpy.number` subclasses that are
  unavailable for the platform in question. Most notably this includes the
  likes of `~numpy.float128` and `~numpy.complex256`. Without the plugin *all*
  extended-precision types will, as far as mypy is concerned, be available
  to all platforms.
* Assigning the (platform-dependent) precision of `~numpy.ctypeslib.c_intp`.
  Without the plugin the type will default to `ctypes.c_int64`.
 
  .. versionadded:: 1.22
 
.. deprecated:: 2.3
 
Examples
--------
To enable the plugin, one must add it to their mypy `configuration file`_:
 
.. code-block:: ini
 
    [mypy]
    plugins = numpy.typing.mypy_plugin
 
.. _mypy: https://mypy-lang.org/
.. _configuration file: https://mypy.readthedocs.io/en/stable/config_file.html
 
é)ÚCallableÚIterable)Ú TYPE_CHECKINGÚFinalÚ    TypeAliasÚcastNÚ__all__Úreturnc ó —dtjfdtjfdtjfdtjfdtj
fdtj fdtjfdtjfd    tjfd
tjfd tjfg }i}|D]?\}}d tj|«jz}t›d |›d|t›d|›<ŒA|S)NÚ    _NBitByteÚ
_NBitShortÚ    _NBitIntCÚ    _NBitIntPÚ_NBitIntÚ    _NBitLongÚ _NBitLongLongÚ    _NBitHalfÚ _NBitSingleÚ _NBitDoubleÚ_NBitLongDoubleéz ._nbit_base._ÚBitú._nbit.)ÚnpÚbyteÚshortÚintcÚintpÚint_ÚlongÚlonglongÚhalfÚsingleÚdoubleÚ
longdoubleÚdtypeÚitemsizeÚ_MODULE)ÚnamesÚretÚnameÚtypÚns     úKH:\Change_password\venv_build\Lib\site-packages\numpy/typing/mypy_plugin.pyÚ_get_precision_dictr/,sê€à    ”b—g‘gÐØ    ”r—x‘xРؠ   ”b—g‘gÐØ    ”b—g‘gÐØ    ”R—W‘WÐØ    ”b—g‘gÐØ    œ"Ÿ+™+Ð&à    ”b—g‘gÐØ    œŸ    ™    Ð"Ø    œŸ    ™    Ð"Ø    œBŸM™MÐ*ð €Eð€CØòI‰    ˆˆcØ ”—‘˜“ ×&Ñ&Ñ &ˆÜ,3¨9°MÀ!ÀÀCÐ)HˆŒwˆiw˜t˜fÐ %Ò&ðIð €JócóV—gd¢}|Dcgc]}tt|«sŒ|‘Œc}Scc}w)N)Úfloat96Úfloat128Ú
complex192Ú
complex256)Úhasattrr)Úextended_namesÚis  r.Ú_get_extended_precision_listr9Bs'€ò€Nð &Ö 8!¬´°Q­ŠAÒ 8Ð8ùÒ 8s‰&Ÿ&cóh—ddddœjtjd«jd«S)NÚc_intÚc_longÚ
c_longlong)r8ÚlÚqr-)Úgetrr&Úchar©r0r.Ú_get_c_intp_namerCKs3€ðØ Ø ñ ÷
cŒ"(‰(3‹-×
˜hÓ'ð    (r0z numpy._typingr(Ú_PRECISION_DICTÚ_EXTENDED_PRECISION_LISTÚ_C_INTP)Ú TypeAnalyser)ÚPRI_MED)Ú
ImportFromÚMypyFileÚ    Statement)ÚAnalyzeTypeContextÚPluginÚ    _HookFuncÚctxcó¤—|\}}}|jjd«d}tt›d|›}t    d|«j |«S)z;Replace a type-alias with a concrete ``NBitBase`` subclass.ú.éÿÿÿÿrrG)r+ÚsplitrDr(rÚ
named_type)rOr,Ú_Úapir+Úname_news      r.Ú_hookrXssQ€à‰ ˆˆQØx‰x~‰~˜cÓ" 2Ñ&ˆÜ"¤g Y¨g°d°VÐ#<Ñ=ˆÜN CÓ(×3Ñ3°HÓ=Ð=r0ÚiterableÚidcól—t|«D]\}}t|dd«|k(sŒ|cStd|›«‚)z>Identify the first ``ImportFrom`` instance the specified `id`.rZNzBFailed to identify a `ImportFrom` instance with the following id: )Ú    enumerateÚgetattrÚ
ValueError)rYrZr8Úvalues    r.Ú_indexr`zsN€ä! (Ó+ò    ‰HˆAˆuܐu˜d DÓ)¨RÓ/Ø’ð    ôð3Ø35°&ð:ó;ð    ;r0ÚfileÚmoduleÚimportscóž—t|d|¬«}d|_|jtd|j«fD]}t ||«}|||<Œy)z<Override the first `module`-based import with new `imports`.r)r)Tzlist[Statement]N)rIÚ is_top_levelÚdefsrrcr`)rarbrcÚ
import_objÚlstr8s      r.Ú_override_importsri‚sU€ô  ¨°Ô9ˆ
Ø"&ˆ
Ôð—I‘IœtÐ$5°t·|±|ÓDÐEò     ˆCܐs˜FÓ#ˆA؈CŠFñ     r0cóH—eZdZdZdededzfd„Zdedee    e
ee
ffd„Z y)Ú _NumpyPluginz>A mypy plugin for handling versus numpy-specific typing tasks.Úfullnamer
Ncó —|tvrtSy)z«Set the precision of platform-specific `numpy.number`
            subclasses.
 
            For example: `numpy.int_`, `numpy.longlong` and `numpy.longdouble`.
            N)rDrX)Úselfrls  r.Úget_type_analyze_hookz"_NumpyPlugin.get_type_analyze_hook”s€ð œ?Ñ*ܐ Ør0rac    óʗ|j}|dk(r*t|t›dtDcgc]}||f‘Œc}¬«n|dk(rt|dtdfg¬«t
|dfgScc}w)a Handle all import-based overrides.
 
            * Import platform-specific extended-precision `numpy.number`
              subclasses (*e.g.* `numpy.float96` and `numpy.float128`).
            * Import the appropriate `ctypes` equivalent to `numpy.intp`.
 
            Únumpyz._extended_precision)rcznumpy.ctypeslibÚctypesÚ_c_intprR)rlrir(rErFrH)rnrarlÚvs    r.Úget_additional_depsz _NumpyPlugin.get_additional_depsžsy€ð—}‘}ˆHؘ7Ò"Ü!ØÜiÐ3Ð4Ü-EÖF¨˜a šVÒFöð
Ð.Ò.Ü!ØØÜ% yÐ1Ð2õô
˜h¨Ð+Ð,Ð ,ùòGs¨ A  ) Ú__name__Ú
__module__Ú __qualname__Ú__doc__ÚstrrNrorJÚlistÚtupleÚintrurBr0r.rkrk‘sB„ÙLð    °#ð    ¸)ÀdÑ:Jó    ð    -Ø ð    -à %˜˜S #˜ Ñ&Ñ 'ô    -r0rkÚversioncó\—ddl}d}d|›d|›d}|j|td¬«tS)Nrznumpy.typing.mypy_pluginú`zS` is deprecated, and will be removed in a future release. Please remove `plugins = z/` in your mypy config.(deprecated in NumPy 2.3)é)Ú
stacklevel)ÚwarningsÚwarnÚDeprecationWarningrk)r~rƒÚpluginÚwarn_msgs    r.r†r†·sG€Ûà+ˆðˆxð1Ø17°ð9(ð )ð    ð
     ‰ hÔ 2¸qˆ ÔAäÐr0có—t‚)N)Úe)r~s r.r†r†ls€Üˆr0)1ryÚcollections.abcrrÚtypingrrrrrqrr    r{rzÚ__annotations__Údictr/r9rCr(rDrErFÚ mypy.typeanalrGÚ
mypy.typesÚmypyÚ
mypy.buildrHÚ
mypy.nodesrIrJrKÚ mypy.pluginrLrMÚtypesÚTyperNrXr}r`r|rirkÚtyper†ÚModuleNotFoundErrorr‰rBr0r.ú<module>r˜sðò!÷F/ß8Ó8ãà€ˆˆc‰Óð˜T # s (™^óð,9 d¨3¡ió9ð(˜#ó(ð!€ˆÓ ñ-Ó.€Ó.ñ#?Ó"@И%Ó@ñ"Ó#€ˆÓ#ðbÙÝ.ãÝ"ß:Ñ:ß6ð$Ð%7Ð$8¸$¿*¹*¿/¹/Ð$IÑJ€IˆyÓJð>Ð%ð>¨$¯*©*¯/©/ó>ð;˜ )Ñ,ð;°#ð;¸#ó;ð  Øð  àð  ðe˜C  t¡˜OÑ,Ñ-ð  ð
ó      ô$-vô$-ðL ˜ð  ô øð[òð˜ð ÷ðûðúsÁ,$DÄDÄ
DÄD