basedpyright 1.1.389 → 1.1.392

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (679) hide show
  1. package/README.md +3 -3
  2. package/dist/pyright-langserver.js +1 -1
  3. package/dist/pyright-langserver.js.LICENSE.txt +42 -0
  4. package/dist/pyright-langserver.js.map +1 -1
  5. package/dist/pyright.js +1 -1
  6. package/dist/pyright.js.map +1 -1
  7. package/dist/typeshed-fallback/commit.txt +1 -1
  8. package/dist/typeshed-fallback/stdlib/VERSIONS +9 -0
  9. package/dist/typeshed-fallback/stdlib/__future__.pyi +36 -36
  10. package/dist/typeshed-fallback/stdlib/__main__.pyi +3 -3
  11. package/dist/typeshed-fallback/stdlib/_ast.pyi +149 -149
  12. package/dist/typeshed-fallback/stdlib/_asyncio.pyi +320 -342
  13. package/dist/typeshed-fallback/stdlib/_bisect.pyi +189 -229
  14. package/dist/typeshed-fallback/stdlib/_blake2.pyi +137 -137
  15. package/dist/typeshed-fallback/stdlib/_bootlocale.pyi +1 -1
  16. package/dist/typeshed-fallback/stdlib/_bz2.pyi +71 -71
  17. package/dist/typeshed-fallback/stdlib/_codecs.pyi +247 -244
  18. package/dist/typeshed-fallback/stdlib/_collections_abc.pyi +124 -115
  19. package/dist/typeshed-fallback/stdlib/_compat_pickle.pyi +8 -8
  20. package/dist/typeshed-fallback/stdlib/_compression.pyi +25 -25
  21. package/dist/typeshed-fallback/stdlib/_contextvars.pyi +146 -146
  22. package/dist/typeshed-fallback/stdlib/_csv.pyi +232 -172
  23. package/dist/typeshed-fallback/stdlib/_ctypes.pyi +435 -304
  24. package/dist/typeshed-fallback/stdlib/_curses.pyi +2 -6
  25. package/dist/typeshed-fallback/stdlib/_curses_panel.pyi +67 -0
  26. package/dist/typeshed-fallback/stdlib/_dbm.pyi +8 -19
  27. package/dist/typeshed-fallback/stdlib/_decimal.pyi +80 -94
  28. package/dist/typeshed-fallback/stdlib/_dummy_thread.pyi +33 -33
  29. package/dist/typeshed-fallback/stdlib/_dummy_threading.pyi +164 -180
  30. package/dist/typeshed-fallback/stdlib/_frozen_importlib.pyi +114 -114
  31. package/dist/typeshed-fallback/stdlib/_frozen_importlib_external.pyi +178 -178
  32. package/dist/typeshed-fallback/stdlib/_gdbm.pyi +2 -65
  33. package/dist/typeshed-fallback/stdlib/_hashlib.pyi +232 -0
  34. package/dist/typeshed-fallback/stdlib/_heapq.pyi +67 -67
  35. package/dist/typeshed-fallback/stdlib/_imp.pyi +81 -83
  36. package/dist/typeshed-fallback/stdlib/_io.pyi +719 -719
  37. package/dist/typeshed-fallback/stdlib/_json.pyi +99 -92
  38. package/dist/typeshed-fallback/stdlib/_locale.pyi +155 -155
  39. package/dist/typeshed-fallback/stdlib/_lsprof.pyi +94 -94
  40. package/dist/typeshed-fallback/stdlib/_lzma.pyi +158 -158
  41. package/dist/typeshed-fallback/stdlib/_markupbase.pyi +16 -16
  42. package/dist/typeshed-fallback/stdlib/_msi.pyi +92 -94
  43. package/dist/typeshed-fallback/stdlib/_multibytecodec.pyi +44 -0
  44. package/dist/typeshed-fallback/stdlib/_operator.pyi +261 -261
  45. package/dist/typeshed-fallback/stdlib/_osx_support.pyi +34 -34
  46. package/dist/typeshed-fallback/stdlib/_posixsubprocess.pyi +0 -1
  47. package/dist/typeshed-fallback/stdlib/_py_abc.pyi +14 -14
  48. package/dist/typeshed-fallback/stdlib/_pydecimal.pyi +43 -43
  49. package/dist/typeshed-fallback/stdlib/_queue.pyi +67 -67
  50. package/dist/typeshed-fallback/stdlib/_random.pyi +30 -30
  51. package/dist/typeshed-fallback/stdlib/_sitebuiltins.pyi +16 -16
  52. package/dist/typeshed-fallback/stdlib/_socket.pyi +1367 -1317
  53. package/dist/typeshed-fallback/stdlib/_sqlite3.pyi +360 -402
  54. package/dist/typeshed-fallback/stdlib/_ssl.pyi +399 -406
  55. package/dist/typeshed-fallback/stdlib/_stat.pyi +257 -257
  56. package/dist/typeshed-fallback/stdlib/_struct.pyi +147 -147
  57. package/dist/typeshed-fallback/stdlib/_thread.pyi +266 -257
  58. package/dist/typeshed-fallback/stdlib/_threading_local.pyi +22 -18
  59. package/dist/typeshed-fallback/stdlib/_tkinter.pyi +165 -165
  60. package/dist/typeshed-fallback/stdlib/_tracemalloc.pyi +78 -78
  61. package/dist/typeshed-fallback/stdlib/_warnings.pyi +98 -102
  62. package/dist/typeshed-fallback/stdlib/_weakref.pyi +35 -35
  63. package/dist/typeshed-fallback/stdlib/_weakrefset.pyi +57 -57
  64. package/dist/typeshed-fallback/stdlib/abc.pyi +59 -59
  65. package/dist/typeshed-fallback/stdlib/argparse.pyi +769 -769
  66. package/dist/typeshed-fallback/stdlib/array.pyi +267 -281
  67. package/dist/typeshed-fallback/stdlib/ast.pyi +2049 -2049
  68. package/dist/typeshed-fallback/stdlib/asynchat.pyi +21 -21
  69. package/dist/typeshed-fallback/stdlib/asyncio/__init__.pyi +41 -41
  70. package/dist/typeshed-fallback/stdlib/asyncio/base_events.pyi +488 -488
  71. package/dist/typeshed-fallback/stdlib/asyncio/base_futures.pyi +19 -19
  72. package/dist/typeshed-fallback/stdlib/asyncio/base_subprocess.pyi +63 -63
  73. package/dist/typeshed-fallback/stdlib/asyncio/base_tasks.pyi +9 -9
  74. package/dist/typeshed-fallback/stdlib/asyncio/constants.pyi +20 -20
  75. package/dist/typeshed-fallback/stdlib/asyncio/coroutines.pyi +26 -26
  76. package/dist/typeshed-fallback/stdlib/asyncio/events.pyi +653 -653
  77. package/dist/typeshed-fallback/stdlib/asyncio/exceptions.pyi +43 -43
  78. package/dist/typeshed-fallback/stdlib/asyncio/format_helpers.pyi +31 -31
  79. package/dist/typeshed-fallback/stdlib/asyncio/futures.pyi +16 -16
  80. package/dist/typeshed-fallback/stdlib/asyncio/locks.pyi +127 -127
  81. package/dist/typeshed-fallback/stdlib/asyncio/log.pyi +3 -3
  82. package/dist/typeshed-fallback/stdlib/asyncio/mixins.pyi +9 -9
  83. package/dist/typeshed-fallback/stdlib/asyncio/proactor_events.pyi +64 -64
  84. package/dist/typeshed-fallback/stdlib/asyncio/protocols.pyi +34 -34
  85. package/dist/typeshed-fallback/stdlib/asyncio/queues.pyi +64 -64
  86. package/dist/typeshed-fallback/stdlib/asyncio/runners.pyi +32 -32
  87. package/dist/typeshed-fallback/stdlib/asyncio/selector_events.pyi +8 -8
  88. package/dist/typeshed-fallback/stdlib/asyncio/sslproto.pyi +165 -184
  89. package/dist/typeshed-fallback/stdlib/asyncio/staggered.pyi +10 -10
  90. package/dist/typeshed-fallback/stdlib/asyncio/streams.pyi +157 -157
  91. package/dist/typeshed-fallback/stdlib/asyncio/subprocess.pyi +229 -229
  92. package/dist/typeshed-fallback/stdlib/asyncio/taskgroups.pyi +25 -25
  93. package/dist/typeshed-fallback/stdlib/asyncio/tasks.pyi +459 -459
  94. package/dist/typeshed-fallback/stdlib/asyncio/threads.pyi +9 -9
  95. package/dist/typeshed-fallback/stdlib/asyncio/timeouts.pyi +19 -19
  96. package/dist/typeshed-fallback/stdlib/asyncio/transports.pyi +47 -47
  97. package/dist/typeshed-fallback/stdlib/asyncio/trsock.pyi +94 -94
  98. package/dist/typeshed-fallback/stdlib/asyncore.pyi +90 -90
  99. package/dist/typeshed-fallback/stdlib/atexit.pyi +46 -46
  100. package/dist/typeshed-fallback/stdlib/audioop.pyi +26 -78
  101. package/dist/typeshed-fallback/stdlib/base64.pyi +65 -65
  102. package/dist/typeshed-fallback/stdlib/bdb.pyi +114 -114
  103. package/dist/typeshed-fallback/stdlib/binascii.pyi +113 -123
  104. package/dist/typeshed-fallback/stdlib/binhex.pyi +45 -45
  105. package/dist/typeshed-fallback/stdlib/bisect.pyi +4 -4
  106. package/dist/typeshed-fallback/stdlib/builtins.pyi +6481 -6560
  107. package/dist/typeshed-fallback/stdlib/bz2.pyi +132 -131
  108. package/dist/typeshed-fallback/stdlib/cProfile.pyi +31 -31
  109. package/dist/typeshed-fallback/stdlib/calendar.pyi +208 -208
  110. package/dist/typeshed-fallback/stdlib/cmath.pyi +112 -112
  111. package/dist/typeshed-fallback/stdlib/cmd.pyi +46 -46
  112. package/dist/typeshed-fallback/stdlib/code.pyi +56 -56
  113. package/dist/typeshed-fallback/stdlib/codecs.pyi +301 -297
  114. package/dist/typeshed-fallback/stdlib/codeop.pyi +13 -13
  115. package/dist/typeshed-fallback/stdlib/collections/__init__.pyi +650 -650
  116. package/dist/typeshed-fallback/stdlib/collections/abc.pyi +2 -2
  117. package/dist/typeshed-fallback/stdlib/colorsys.pyi +13 -13
  118. package/dist/typeshed-fallback/stdlib/compileall.pyi +111 -111
  119. package/dist/typeshed-fallback/stdlib/concurrent/futures/__init__.pyi +51 -51
  120. package/dist/typeshed-fallback/stdlib/concurrent/futures/_base.pyi +132 -132
  121. package/dist/typeshed-fallback/stdlib/concurrent/futures/process.pyi +234 -234
  122. package/dist/typeshed-fallback/stdlib/concurrent/futures/thread.pyi +86 -86
  123. package/dist/typeshed-fallback/stdlib/configparser.pyi +412 -404
  124. package/dist/typeshed-fallback/stdlib/contextlib.pyi +219 -213
  125. package/dist/typeshed-fallback/stdlib/contextvars.pyi +3 -3
  126. package/dist/typeshed-fallback/stdlib/copy.pyi +27 -27
  127. package/dist/typeshed-fallback/stdlib/copyreg.pyi +21 -21
  128. package/dist/typeshed-fallback/stdlib/crypt.pyi +9 -2
  129. package/dist/typeshed-fallback/stdlib/csv.pyi +169 -167
  130. package/dist/typeshed-fallback/stdlib/ctypes/__init__.pyi +218 -198
  131. package/dist/typeshed-fallback/stdlib/ctypes/_endian.pyi +16 -16
  132. package/dist/typeshed-fallback/stdlib/ctypes/macholib/__init__.pyi +1 -0
  133. package/dist/typeshed-fallback/stdlib/ctypes/macholib/dyld.pyi +8 -0
  134. package/dist/typeshed-fallback/stdlib/ctypes/macholib/dylib.pyi +14 -0
  135. package/dist/typeshed-fallback/stdlib/ctypes/macholib/framework.pyi +14 -0
  136. package/dist/typeshed-fallback/stdlib/ctypes/util.pyi +8 -6
  137. package/dist/typeshed-fallback/stdlib/ctypes/wintypes.pyi +304 -298
  138. package/dist/typeshed-fallback/stdlib/curses/__init__.pyi +19 -1
  139. package/dist/typeshed-fallback/stdlib/curses/panel.pyi +1 -34
  140. package/dist/typeshed-fallback/stdlib/dataclasses.pyi +322 -322
  141. package/dist/typeshed-fallback/stdlib/datetime.pyi +576 -575
  142. package/dist/typeshed-fallback/stdlib/dbm/__init__.pyi +104 -102
  143. package/dist/typeshed-fallback/stdlib/dbm/dumb.pyi +37 -37
  144. package/dist/typeshed-fallback/stdlib/decimal.pyi +849 -840
  145. package/dist/typeshed-fallback/stdlib/difflib.pyi +146 -146
  146. package/dist/typeshed-fallback/stdlib/dis.pyi +248 -248
  147. package/dist/typeshed-fallback/stdlib/distutils/__init__.pyi +5 -5
  148. package/dist/typeshed-fallback/stdlib/distutils/_msvccompiler.pyi +13 -13
  149. package/dist/typeshed-fallback/stdlib/distutils/archive_util.pyi +35 -35
  150. package/dist/typeshed-fallback/stdlib/distutils/bcppcompiler.pyi +3 -3
  151. package/dist/typeshed-fallback/stdlib/distutils/ccompiler.pyi +176 -176
  152. package/dist/typeshed-fallback/stdlib/distutils/cmd.pyi +229 -229
  153. package/dist/typeshed-fallback/stdlib/distutils/command/__init__.pyi +48 -48
  154. package/dist/typeshed-fallback/stdlib/distutils/command/bdist.pyi +27 -27
  155. package/dist/typeshed-fallback/stdlib/distutils/command/bdist_dumb.pyi +22 -22
  156. package/dist/typeshed-fallback/stdlib/distutils/command/bdist_msi.pyi +46 -46
  157. package/dist/typeshed-fallback/stdlib/distutils/command/bdist_rpm.pyi +53 -53
  158. package/dist/typeshed-fallback/stdlib/distutils/command/bdist_wininst.pyi +16 -16
  159. package/dist/typeshed-fallback/stdlib/distutils/command/build.pyi +34 -34
  160. package/dist/typeshed-fallback/stdlib/distutils/command/build_clib.pyi +29 -29
  161. package/dist/typeshed-fallback/stdlib/distutils/command/build_ext.pyi +52 -52
  162. package/dist/typeshed-fallback/stdlib/distutils/command/build_py.pyi +45 -45
  163. package/dist/typeshed-fallback/stdlib/distutils/command/build_scripts.pyi +25 -25
  164. package/dist/typeshed-fallback/stdlib/distutils/command/check.pyi +40 -40
  165. package/dist/typeshed-fallback/stdlib/distutils/command/clean.pyi +18 -18
  166. package/dist/typeshed-fallback/stdlib/distutils/command/config.pyi +84 -84
  167. package/dist/typeshed-fallback/stdlib/distutils/command/install.pyi +71 -71
  168. package/dist/typeshed-fallback/stdlib/distutils/command/install_data.pyi +20 -20
  169. package/dist/typeshed-fallback/stdlib/distutils/command/install_egg_info.pyi +19 -19
  170. package/dist/typeshed-fallback/stdlib/distutils/command/install_headers.pyi +17 -17
  171. package/dist/typeshed-fallback/stdlib/distutils/command/install_lib.pyi +26 -26
  172. package/dist/typeshed-fallback/stdlib/distutils/command/install_scripts.pyi +19 -19
  173. package/dist/typeshed-fallback/stdlib/distutils/command/register.pyi +21 -21
  174. package/dist/typeshed-fallback/stdlib/distutils/command/sdist.pyi +45 -45
  175. package/dist/typeshed-fallback/stdlib/distutils/command/upload.pyi +18 -18
  176. package/dist/typeshed-fallback/stdlib/distutils/config.pyi +17 -17
  177. package/dist/typeshed-fallback/stdlib/distutils/core.pyi +58 -58
  178. package/dist/typeshed-fallback/stdlib/distutils/cygwinccompiler.pyi +20 -20
  179. package/dist/typeshed-fallback/stdlib/distutils/debug.pyi +3 -3
  180. package/dist/typeshed-fallback/stdlib/distutils/dep_util.pyi +14 -14
  181. package/dist/typeshed-fallback/stdlib/distutils/dir_util.pyi +23 -23
  182. package/dist/typeshed-fallback/stdlib/distutils/dist.pyi +317 -317
  183. package/dist/typeshed-fallback/stdlib/distutils/errors.pyi +19 -19
  184. package/dist/typeshed-fallback/stdlib/distutils/extension.pyi +36 -36
  185. package/dist/typeshed-fallback/stdlib/distutils/fancy_getopt.pyi +34 -34
  186. package/dist/typeshed-fallback/stdlib/distutils/file_util.pyi +38 -38
  187. package/dist/typeshed-fallback/stdlib/distutils/filelist.pyi +58 -58
  188. package/dist/typeshed-fallback/stdlib/distutils/log.pyi +26 -26
  189. package/dist/typeshed-fallback/stdlib/distutils/msvccompiler.pyi +3 -3
  190. package/dist/typeshed-fallback/stdlib/distutils/spawn.pyi +10 -6
  191. package/dist/typeshed-fallback/stdlib/distutils/sysconfig.pyi +33 -33
  192. package/dist/typeshed-fallback/stdlib/distutils/text_file.pyi +21 -21
  193. package/dist/typeshed-fallback/stdlib/distutils/unixccompiler.pyi +3 -3
  194. package/dist/typeshed-fallback/stdlib/distutils/util.pyi +53 -53
  195. package/dist/typeshed-fallback/stdlib/distutils/version.pyi +36 -38
  196. package/dist/typeshed-fallback/stdlib/doctest.pyi +262 -264
  197. package/dist/typeshed-fallback/stdlib/dummy_threading.pyi +2 -2
  198. package/dist/typeshed-fallback/stdlib/email/__init__.pyi +37 -29
  199. package/dist/typeshed-fallback/stdlib/email/_header_value_parser.pyi +398 -398
  200. package/dist/typeshed-fallback/stdlib/email/_policybase.pyi +77 -75
  201. package/dist/typeshed-fallback/stdlib/email/base64mime.pyi +13 -13
  202. package/dist/typeshed-fallback/stdlib/email/charset.pyi +36 -36
  203. package/dist/typeshed-fallback/stdlib/email/contentmanager.pyi +11 -11
  204. package/dist/typeshed-fallback/stdlib/email/encoders.pyi +8 -8
  205. package/dist/typeshed-fallback/stdlib/email/errors.pyi +42 -42
  206. package/dist/typeshed-fallback/stdlib/email/feedparser.pyi +23 -23
  207. package/dist/typeshed-fallback/stdlib/email/generator.pyi +77 -77
  208. package/dist/typeshed-fallback/stdlib/email/header.pyi +33 -33
  209. package/dist/typeshed-fallback/stdlib/email/headerregistry.pyi +183 -183
  210. package/dist/typeshed-fallback/stdlib/email/iterators.pyi +12 -12
  211. package/dist/typeshed-fallback/stdlib/email/message.pyi +172 -172
  212. package/dist/typeshed-fallback/stdlib/email/mime/application.pyi +17 -17
  213. package/dist/typeshed-fallback/stdlib/email/mime/audio.pyi +17 -17
  214. package/dist/typeshed-fallback/stdlib/email/mime/base.pyi +8 -8
  215. package/dist/typeshed-fallback/stdlib/email/mime/image.pyi +17 -17
  216. package/dist/typeshed-fallback/stdlib/email/mime/message.pyi +8 -8
  217. package/dist/typeshed-fallback/stdlib/email/mime/multipart.pyi +18 -18
  218. package/dist/typeshed-fallback/stdlib/email/mime/nonmultipart.pyi +5 -5
  219. package/dist/typeshed-fallback/stdlib/email/mime/text.pyi +9 -9
  220. package/dist/typeshed-fallback/stdlib/email/parser.pyi +38 -38
  221. package/dist/typeshed-fallback/stdlib/email/policy.pyi +77 -77
  222. package/dist/typeshed-fallback/stdlib/email/quoprimime.pyi +28 -28
  223. package/dist/typeshed-fallback/stdlib/email/utils.pyi +78 -78
  224. package/dist/typeshed-fallback/stdlib/encodings/__init__.pyi +10 -10
  225. package/dist/typeshed-fallback/stdlib/encodings/aliases.pyi +1 -0
  226. package/dist/typeshed-fallback/stdlib/encodings/ascii.pyi +30 -0
  227. package/dist/typeshed-fallback/stdlib/encodings/base64_codec.pyi +26 -0
  228. package/dist/typeshed-fallback/stdlib/encodings/big5.pyi +23 -0
  229. package/dist/typeshed-fallback/stdlib/encodings/big5hkscs.pyi +23 -0
  230. package/dist/typeshed-fallback/stdlib/encodings/bz2_codec.pyi +26 -0
  231. package/dist/typeshed-fallback/stdlib/encodings/charmap.pyi +33 -0
  232. package/dist/typeshed-fallback/stdlib/encodings/cp037.pyi +21 -0
  233. package/dist/typeshed-fallback/stdlib/encodings/cp1006.pyi +21 -0
  234. package/dist/typeshed-fallback/stdlib/encodings/cp1026.pyi +21 -0
  235. package/dist/typeshed-fallback/stdlib/encodings/cp1125.pyi +21 -0
  236. package/dist/typeshed-fallback/stdlib/encodings/cp1140.pyi +21 -0
  237. package/dist/typeshed-fallback/stdlib/encodings/cp1250.pyi +21 -0
  238. package/dist/typeshed-fallback/stdlib/encodings/cp1251.pyi +21 -0
  239. package/dist/typeshed-fallback/stdlib/encodings/cp1252.pyi +21 -0
  240. package/dist/typeshed-fallback/stdlib/encodings/cp1253.pyi +21 -0
  241. package/dist/typeshed-fallback/stdlib/encodings/cp1254.pyi +21 -0
  242. package/dist/typeshed-fallback/stdlib/encodings/cp1255.pyi +21 -0
  243. package/dist/typeshed-fallback/stdlib/encodings/cp1256.pyi +21 -0
  244. package/dist/typeshed-fallback/stdlib/encodings/cp1257.pyi +21 -0
  245. package/dist/typeshed-fallback/stdlib/encodings/cp1258.pyi +21 -0
  246. package/dist/typeshed-fallback/stdlib/encodings/cp273.pyi +21 -0
  247. package/dist/typeshed-fallback/stdlib/encodings/cp424.pyi +21 -0
  248. package/dist/typeshed-fallback/stdlib/encodings/cp437.pyi +21 -0
  249. package/dist/typeshed-fallback/stdlib/encodings/cp500.pyi +21 -0
  250. package/dist/typeshed-fallback/stdlib/encodings/cp720.pyi +21 -0
  251. package/dist/typeshed-fallback/stdlib/encodings/cp737.pyi +21 -0
  252. package/dist/typeshed-fallback/stdlib/encodings/cp775.pyi +21 -0
  253. package/dist/typeshed-fallback/stdlib/encodings/cp850.pyi +21 -0
  254. package/dist/typeshed-fallback/stdlib/encodings/cp852.pyi +21 -0
  255. package/dist/typeshed-fallback/stdlib/encodings/cp855.pyi +21 -0
  256. package/dist/typeshed-fallback/stdlib/encodings/cp856.pyi +21 -0
  257. package/dist/typeshed-fallback/stdlib/encodings/cp857.pyi +21 -0
  258. package/dist/typeshed-fallback/stdlib/encodings/cp858.pyi +21 -0
  259. package/dist/typeshed-fallback/stdlib/encodings/cp860.pyi +21 -0
  260. package/dist/typeshed-fallback/stdlib/encodings/cp861.pyi +21 -0
  261. package/dist/typeshed-fallback/stdlib/encodings/cp862.pyi +21 -0
  262. package/dist/typeshed-fallback/stdlib/encodings/cp863.pyi +21 -0
  263. package/dist/typeshed-fallback/stdlib/encodings/cp864.pyi +21 -0
  264. package/dist/typeshed-fallback/stdlib/encodings/cp865.pyi +21 -0
  265. package/dist/typeshed-fallback/stdlib/encodings/cp866.pyi +21 -0
  266. package/dist/typeshed-fallback/stdlib/encodings/cp869.pyi +21 -0
  267. package/dist/typeshed-fallback/stdlib/encodings/cp874.pyi +21 -0
  268. package/dist/typeshed-fallback/stdlib/encodings/cp875.pyi +21 -0
  269. package/dist/typeshed-fallback/stdlib/encodings/cp932.pyi +23 -0
  270. package/dist/typeshed-fallback/stdlib/encodings/cp949.pyi +23 -0
  271. package/dist/typeshed-fallback/stdlib/encodings/cp950.pyi +23 -0
  272. package/dist/typeshed-fallback/stdlib/encodings/euc_jis_2004.pyi +23 -0
  273. package/dist/typeshed-fallback/stdlib/encodings/euc_jisx0213.pyi +23 -0
  274. package/dist/typeshed-fallback/stdlib/encodings/euc_jp.pyi +23 -0
  275. package/dist/typeshed-fallback/stdlib/encodings/euc_kr.pyi +23 -0
  276. package/dist/typeshed-fallback/stdlib/encodings/gb18030.pyi +23 -0
  277. package/dist/typeshed-fallback/stdlib/encodings/gb2312.pyi +23 -0
  278. package/dist/typeshed-fallback/stdlib/encodings/gbk.pyi +23 -0
  279. package/dist/typeshed-fallback/stdlib/encodings/hex_codec.pyi +26 -0
  280. package/dist/typeshed-fallback/stdlib/encodings/hp_roman8.pyi +21 -0
  281. package/dist/typeshed-fallback/stdlib/encodings/hz.pyi +23 -0
  282. package/dist/typeshed-fallback/stdlib/encodings/idna.pyi +26 -0
  283. package/dist/typeshed-fallback/stdlib/encodings/iso2022_jp.pyi +23 -0
  284. package/dist/typeshed-fallback/stdlib/encodings/iso2022_jp_1.pyi +23 -0
  285. package/dist/typeshed-fallback/stdlib/encodings/iso2022_jp_2.pyi +23 -0
  286. package/dist/typeshed-fallback/stdlib/encodings/iso2022_jp_2004.pyi +23 -0
  287. package/dist/typeshed-fallback/stdlib/encodings/iso2022_jp_3.pyi +23 -0
  288. package/dist/typeshed-fallback/stdlib/encodings/iso2022_jp_ext.pyi +23 -0
  289. package/dist/typeshed-fallback/stdlib/encodings/iso2022_kr.pyi +23 -0
  290. package/dist/typeshed-fallback/stdlib/encodings/iso8859_1.pyi +21 -0
  291. package/dist/typeshed-fallback/stdlib/encodings/iso8859_10.pyi +21 -0
  292. package/dist/typeshed-fallback/stdlib/encodings/iso8859_11.pyi +21 -0
  293. package/dist/typeshed-fallback/stdlib/encodings/iso8859_13.pyi +21 -0
  294. package/dist/typeshed-fallback/stdlib/encodings/iso8859_14.pyi +21 -0
  295. package/dist/typeshed-fallback/stdlib/encodings/iso8859_15.pyi +21 -0
  296. package/dist/typeshed-fallback/stdlib/encodings/iso8859_16.pyi +21 -0
  297. package/dist/typeshed-fallback/stdlib/encodings/iso8859_2.pyi +21 -0
  298. package/dist/typeshed-fallback/stdlib/encodings/iso8859_3.pyi +21 -0
  299. package/dist/typeshed-fallback/stdlib/encodings/iso8859_4.pyi +21 -0
  300. package/dist/typeshed-fallback/stdlib/encodings/iso8859_5.pyi +21 -0
  301. package/dist/typeshed-fallback/stdlib/encodings/iso8859_6.pyi +21 -0
  302. package/dist/typeshed-fallback/stdlib/encodings/iso8859_7.pyi +21 -0
  303. package/dist/typeshed-fallback/stdlib/encodings/iso8859_8.pyi +21 -0
  304. package/dist/typeshed-fallback/stdlib/encodings/iso8859_9.pyi +21 -0
  305. package/dist/typeshed-fallback/stdlib/encodings/johab.pyi +23 -0
  306. package/dist/typeshed-fallback/stdlib/encodings/koi8_r.pyi +21 -0
  307. package/dist/typeshed-fallback/stdlib/encodings/koi8_t.pyi +21 -0
  308. package/dist/typeshed-fallback/stdlib/encodings/koi8_u.pyi +21 -0
  309. package/dist/typeshed-fallback/stdlib/encodings/kz1048.pyi +21 -0
  310. package/dist/typeshed-fallback/stdlib/encodings/latin_1.pyi +30 -0
  311. package/dist/typeshed-fallback/stdlib/encodings/mac_arabic.pyi +21 -0
  312. package/dist/typeshed-fallback/stdlib/encodings/mac_centeuro.pyi +21 -0
  313. package/dist/typeshed-fallback/stdlib/encodings/mac_croatian.pyi +21 -0
  314. package/dist/typeshed-fallback/stdlib/encodings/mac_cyrillic.pyi +21 -0
  315. package/dist/typeshed-fallback/stdlib/encodings/mac_farsi.pyi +21 -0
  316. package/dist/typeshed-fallback/stdlib/encodings/mac_greek.pyi +21 -0
  317. package/dist/typeshed-fallback/stdlib/encodings/mac_iceland.pyi +21 -0
  318. package/dist/typeshed-fallback/stdlib/encodings/mac_latin2.pyi +21 -0
  319. package/dist/typeshed-fallback/stdlib/encodings/mac_roman.pyi +21 -0
  320. package/dist/typeshed-fallback/stdlib/encodings/mac_romanian.pyi +21 -0
  321. package/dist/typeshed-fallback/stdlib/encodings/mac_turkish.pyi +21 -0
  322. package/dist/typeshed-fallback/stdlib/encodings/mbcs.pyi +28 -0
  323. package/dist/typeshed-fallback/stdlib/encodings/oem.pyi +28 -0
  324. package/dist/typeshed-fallback/stdlib/encodings/palmos.pyi +21 -0
  325. package/dist/typeshed-fallback/stdlib/encodings/ptcp154.pyi +21 -0
  326. package/dist/typeshed-fallback/stdlib/encodings/punycode.pyi +33 -0
  327. package/dist/typeshed-fallback/stdlib/encodings/quopri_codec.pyi +26 -0
  328. package/dist/typeshed-fallback/stdlib/encodings/raw_unicode_escape.pyi +34 -0
  329. package/dist/typeshed-fallback/stdlib/encodings/rot_13.pyi +23 -0
  330. package/dist/typeshed-fallback/stdlib/encodings/shift_jis.pyi +23 -0
  331. package/dist/typeshed-fallback/stdlib/encodings/shift_jis_2004.pyi +23 -0
  332. package/dist/typeshed-fallback/stdlib/encodings/shift_jisx0213.pyi +23 -0
  333. package/dist/typeshed-fallback/stdlib/encodings/tis_620.pyi +21 -0
  334. package/dist/typeshed-fallback/stdlib/encodings/undefined.pyi +20 -0
  335. package/dist/typeshed-fallback/stdlib/encodings/unicode_escape.pyi +34 -0
  336. package/dist/typeshed-fallback/stdlib/encodings/utf_16.pyi +20 -0
  337. package/dist/typeshed-fallback/stdlib/encodings/utf_16_be.pyi +26 -0
  338. package/dist/typeshed-fallback/stdlib/encodings/utf_16_le.pyi +26 -0
  339. package/dist/typeshed-fallback/stdlib/encodings/utf_32.pyi +20 -0
  340. package/dist/typeshed-fallback/stdlib/encodings/utf_32_be.pyi +26 -0
  341. package/dist/typeshed-fallback/stdlib/encodings/utf_32_le.pyi +26 -0
  342. package/dist/typeshed-fallback/stdlib/encodings/utf_7.pyi +26 -0
  343. package/dist/typeshed-fallback/stdlib/encodings/utf_8.pyi +26 -21
  344. package/dist/typeshed-fallback/stdlib/encodings/utf_8_sig.pyi +22 -22
  345. package/dist/typeshed-fallback/stdlib/encodings/uu_codec.pyi +28 -0
  346. package/dist/typeshed-fallback/stdlib/encodings/zlib_codec.pyi +26 -0
  347. package/dist/typeshed-fallback/stdlib/ensurepip/__init__.pyi +12 -12
  348. package/dist/typeshed-fallback/stdlib/enum.pyi +348 -348
  349. package/dist/typeshed-fallback/stdlib/errno.pyi +237 -237
  350. package/dist/typeshed-fallback/stdlib/faulthandler.pyi +34 -34
  351. package/dist/typeshed-fallback/stdlib/fcntl.pyi +3 -1
  352. package/dist/typeshed-fallback/stdlib/filecmp.pyi +74 -74
  353. package/dist/typeshed-fallback/stdlib/fileinput.pyi +219 -219
  354. package/dist/typeshed-fallback/stdlib/fnmatch.pyi +9 -9
  355. package/dist/typeshed-fallback/stdlib/formatter.pyi +88 -88
  356. package/dist/typeshed-fallback/stdlib/fractions.pyi +162 -162
  357. package/dist/typeshed-fallback/stdlib/ftplib.pyi +178 -178
  358. package/dist/typeshed-fallback/stdlib/functools.pyi +270 -270
  359. package/dist/typeshed-fallback/stdlib/gc.pyi +144 -144
  360. package/dist/typeshed-fallback/stdlib/genericpath.pyi +59 -59
  361. package/dist/typeshed-fallback/stdlib/getopt.pyi +15 -15
  362. package/dist/typeshed-fallback/stdlib/getpass.pyi +8 -8
  363. package/dist/typeshed-fallback/stdlib/gettext.pyi +171 -169
  364. package/dist/typeshed-fallback/stdlib/glob.pyi +50 -50
  365. package/dist/typeshed-fallback/stdlib/graphlib.pyi +34 -34
  366. package/dist/typeshed-fallback/stdlib/gzip.pyi +162 -162
  367. package/dist/typeshed-fallback/stdlib/hashlib.pyi +104 -163
  368. package/dist/typeshed-fallback/stdlib/heapq.pyi +19 -19
  369. package/dist/typeshed-fallback/stdlib/hmac.pyi +42 -65
  370. package/dist/typeshed-fallback/stdlib/html/__init__.pyi +6 -6
  371. package/dist/typeshed-fallback/stdlib/html/entities.pyi +6 -6
  372. package/dist/typeshed-fallback/stdlib/html/parser.pyi +34 -34
  373. package/dist/typeshed-fallback/stdlib/http/__init__.pyi +112 -112
  374. package/dist/typeshed-fallback/stdlib/http/client.pyi +246 -246
  375. package/dist/typeshed-fallback/stdlib/http/cookiejar.pyi +159 -159
  376. package/dist/typeshed-fallback/stdlib/http/cookies.pyi +66 -66
  377. package/dist/typeshed-fallback/stdlib/http/server.pyi +83 -83
  378. package/dist/typeshed-fallback/stdlib/imaplib.pyi +168 -168
  379. package/dist/typeshed-fallback/stdlib/imp.pyi +62 -62
  380. package/dist/typeshed-fallback/stdlib/importlib/__init__.pyi +15 -15
  381. package/dist/typeshed-fallback/stdlib/importlib/_abc.pyi +15 -15
  382. package/dist/typeshed-fallback/stdlib/importlib/_bootstrap.pyi +2 -2
  383. package/dist/typeshed-fallback/stdlib/importlib/_bootstrap_external.pyi +2 -2
  384. package/dist/typeshed-fallback/stdlib/importlib/abc.pyi +175 -175
  385. package/dist/typeshed-fallback/stdlib/importlib/machinery.pyi +20 -20
  386. package/dist/typeshed-fallback/stdlib/importlib/metadata/__init__.pyi +342 -371
  387. package/dist/typeshed-fallback/stdlib/importlib/metadata/_meta.pyi +65 -65
  388. package/dist/typeshed-fallback/stdlib/importlib/readers.pyi +68 -68
  389. package/dist/typeshed-fallback/stdlib/importlib/resources/__init__.pyi +70 -70
  390. package/dist/typeshed-fallback/stdlib/importlib/resources/_common.pyi +42 -42
  391. package/dist/typeshed-fallback/stdlib/importlib/resources/abc.pyi +14 -12
  392. package/dist/typeshed-fallback/stdlib/importlib/resources/readers.pyi +14 -14
  393. package/dist/typeshed-fallback/stdlib/importlib/resources/simple.pyi +58 -58
  394. package/dist/typeshed-fallback/stdlib/importlib/simple.pyi +11 -11
  395. package/dist/typeshed-fallback/stdlib/importlib/util.pyi +33 -33
  396. package/dist/typeshed-fallback/stdlib/inspect.pyi +642 -642
  397. package/dist/typeshed-fallback/stdlib/io.pyi +60 -60
  398. package/dist/typeshed-fallback/stdlib/ipaddress.pyi +509 -355
  399. package/dist/typeshed-fallback/stdlib/itertools.pyi +574 -574
  400. package/dist/typeshed-fallback/stdlib/json/__init__.pyi +61 -61
  401. package/dist/typeshed-fallback/stdlib/json/decoder.pyi +32 -32
  402. package/dist/typeshed-fallback/stdlib/json/encoder.pyi +52 -52
  403. package/dist/typeshed-fallback/stdlib/json/scanner.pyi +3 -0
  404. package/dist/typeshed-fallback/stdlib/json/tool.pyi +1 -1
  405. package/dist/typeshed-fallback/stdlib/keyword.pyi +25 -25
  406. package/dist/typeshed-fallback/stdlib/lib2to3/pytree.pyi +2 -12
  407. package/dist/typeshed-fallback/stdlib/linecache.pyi +23 -23
  408. package/dist/typeshed-fallback/stdlib/locale.pyi +156 -156
  409. package/dist/typeshed-fallback/stdlib/logging/__init__.pyi +698 -698
  410. package/dist/typeshed-fallback/stdlib/logging/config.pyi +134 -134
  411. package/dist/typeshed-fallback/stdlib/logging/handlers.pyi +277 -277
  412. package/dist/typeshed-fallback/stdlib/lzma.pyi +174 -174
  413. package/dist/typeshed-fallback/stdlib/mailbox.pyi +276 -276
  414. package/dist/typeshed-fallback/stdlib/marshal.pyi +128 -176
  415. package/dist/typeshed-fallback/stdlib/math.pyi +438 -442
  416. package/dist/typeshed-fallback/stdlib/mimetypes.pyi +56 -56
  417. package/dist/typeshed-fallback/stdlib/mmap.pyi +185 -185
  418. package/dist/typeshed-fallback/stdlib/modulefinder.pyi +68 -66
  419. package/dist/typeshed-fallback/stdlib/msilib/__init__.pyi +177 -177
  420. package/dist/typeshed-fallback/stdlib/msilib/schema.pyi +94 -94
  421. package/dist/typeshed-fallback/stdlib/msilib/sequence.pyi +13 -13
  422. package/dist/typeshed-fallback/stdlib/msilib/text.pyi +7 -7
  423. package/dist/typeshed-fallback/stdlib/multiprocessing/__init__.pyi +90 -90
  424. package/dist/typeshed-fallback/stdlib/multiprocessing/connection.pyi +89 -89
  425. package/dist/typeshed-fallback/stdlib/multiprocessing/context.pyi +216 -215
  426. package/dist/typeshed-fallback/stdlib/multiprocessing/dummy/__init__.pyi +79 -79
  427. package/dist/typeshed-fallback/stdlib/multiprocessing/dummy/connection.pyi +39 -39
  428. package/dist/typeshed-fallback/stdlib/multiprocessing/forkserver.pyi +31 -31
  429. package/dist/typeshed-fallback/stdlib/multiprocessing/heap.pyi +36 -36
  430. package/dist/typeshed-fallback/stdlib/multiprocessing/managers.pyi +266 -266
  431. package/dist/typeshed-fallback/stdlib/multiprocessing/pool.pyi +109 -109
  432. package/dist/typeshed-fallback/stdlib/multiprocessing/process.pyi +50 -50
  433. package/dist/typeshed-fallback/stdlib/multiprocessing/queues.pyi +53 -53
  434. package/dist/typeshed-fallback/stdlib/multiprocessing/reduction.pyi +87 -87
  435. package/dist/typeshed-fallback/stdlib/multiprocessing/resource_sharer.pyi +20 -20
  436. package/dist/typeshed-fallback/stdlib/multiprocessing/resource_tracker.pyi +18 -18
  437. package/dist/typeshed-fallback/stdlib/multiprocessing/shared_memory.pyi +58 -58
  438. package/dist/typeshed-fallback/stdlib/multiprocessing/sharedctypes.pyi +129 -128
  439. package/dist/typeshed-fallback/stdlib/multiprocessing/spawn.pyi +32 -32
  440. package/dist/typeshed-fallback/stdlib/multiprocessing/synchronize.pyi +59 -55
  441. package/dist/typeshed-fallback/stdlib/multiprocessing/util.pyi +98 -98
  442. package/dist/typeshed-fallback/stdlib/netrc.pyi +23 -23
  443. package/dist/typeshed-fallback/stdlib/nis.pyi +4 -31
  444. package/dist/typeshed-fallback/stdlib/ntpath.pyi +126 -126
  445. package/dist/typeshed-fallback/stdlib/nturl2path.pyi +2 -2
  446. package/dist/typeshed-fallback/stdlib/numbers.pyi +229 -229
  447. package/dist/typeshed-fallback/stdlib/opcode.pyi +65 -65
  448. package/dist/typeshed-fallback/stdlib/operator.pyi +221 -221
  449. package/dist/typeshed-fallback/stdlib/optparse.pyi +257 -257
  450. package/dist/typeshed-fallback/stdlib/os/__init__.pyi +2946 -2491
  451. package/dist/typeshed-fallback/stdlib/os/path.pyi +8 -8
  452. package/dist/typeshed-fallback/stdlib/parser.pyi +24 -55
  453. package/dist/typeshed-fallback/stdlib/pathlib.pyi +329 -329
  454. package/dist/typeshed-fallback/stdlib/pdb.pyi +206 -206
  455. package/dist/typeshed-fallback/stdlib/pickle.pyi +459 -459
  456. package/dist/typeshed-fallback/stdlib/pickletools.pyi +167 -167
  457. package/dist/typeshed-fallback/stdlib/pkgutil.pyi +53 -53
  458. package/dist/typeshed-fallback/stdlib/platform.pyi +97 -67
  459. package/dist/typeshed-fallback/stdlib/plistlib.pyi +113 -113
  460. package/dist/typeshed-fallback/stdlib/poplib.pyi +72 -72
  461. package/dist/typeshed-fallback/stdlib/posix.pyi +30 -10
  462. package/dist/typeshed-fallback/stdlib/posixpath.pyi +182 -182
  463. package/dist/typeshed-fallback/stdlib/pprint.pyi +112 -112
  464. package/dist/typeshed-fallback/stdlib/profile.pyi +31 -31
  465. package/dist/typeshed-fallback/stdlib/pstats.pyi +98 -80
  466. package/dist/typeshed-fallback/stdlib/py_compile.pyi +34 -34
  467. package/dist/typeshed-fallback/stdlib/pyclbr.pyi +74 -74
  468. package/dist/typeshed-fallback/stdlib/pydoc.pyi +333 -333
  469. package/dist/typeshed-fallback/stdlib/pydoc_data/topics.pyi +1 -1
  470. package/dist/typeshed-fallback/stdlib/pyexpat/__init__.pyi +131 -129
  471. package/dist/typeshed-fallback/stdlib/pyexpat/errors.pyi +53 -53
  472. package/dist/typeshed-fallback/stdlib/pyexpat/model.pyi +15 -15
  473. package/dist/typeshed-fallback/stdlib/queue.pyi +63 -63
  474. package/dist/typeshed-fallback/stdlib/quopri.pyi +11 -11
  475. package/dist/typeshed-fallback/stdlib/random.pyi +141 -141
  476. package/dist/typeshed-fallback/stdlib/re.pyi +476 -476
  477. package/dist/typeshed-fallback/stdlib/readline.pyi +1 -7
  478. package/dist/typeshed-fallback/stdlib/reprlib.pyi +65 -65
  479. package/dist/typeshed-fallback/stdlib/rlcompleter.pyi +9 -9
  480. package/dist/typeshed-fallback/stdlib/runpy.pyi +24 -24
  481. package/dist/typeshed-fallback/stdlib/sched.pyi +52 -49
  482. package/dist/typeshed-fallback/stdlib/secrets.pyi +15 -15
  483. package/dist/typeshed-fallback/stdlib/select.pyi +247 -247
  484. package/dist/typeshed-fallback/stdlib/selectors.pyi +67 -67
  485. package/dist/typeshed-fallback/stdlib/shelve.pyi +59 -59
  486. package/dist/typeshed-fallback/stdlib/shlex.pyi +63 -63
  487. package/dist/typeshed-fallback/stdlib/shutil.pyi +230 -230
  488. package/dist/typeshed-fallback/stdlib/signal.pyi +263 -263
  489. package/dist/typeshed-fallback/stdlib/site.pyi +36 -36
  490. package/dist/typeshed-fallback/stdlib/smtpd.pyi +91 -91
  491. package/dist/typeshed-fallback/stdlib/smtplib.pyi +204 -204
  492. package/dist/typeshed-fallback/stdlib/socket.pyi +1413 -856
  493. package/dist/typeshed-fallback/stdlib/socketserver.pyi +169 -169
  494. package/dist/typeshed-fallback/stdlib/spwd.pyi +13 -66
  495. package/dist/typeshed-fallback/stdlib/sqlite3/__init__.pyi +785 -787
  496. package/dist/typeshed-fallback/stdlib/sqlite3/dbapi2.pyi +241 -241
  497. package/dist/typeshed-fallback/stdlib/sqlite3/dump.pyi +2 -0
  498. package/dist/typeshed-fallback/stdlib/sre_compile.pyi +11 -11
  499. package/dist/typeshed-fallback/stdlib/sre_constants.pyi +124 -124
  500. package/dist/typeshed-fallback/stdlib/sre_parse.pyi +104 -104
  501. package/dist/typeshed-fallback/stdlib/ssl.pyi +558 -560
  502. package/dist/typeshed-fallback/stdlib/stat.pyi +7 -7
  503. package/dist/typeshed-fallback/stdlib/statistics.pyi +176 -176
  504. package/dist/typeshed-fallback/stdlib/string.pyi +83 -83
  505. package/dist/typeshed-fallback/stdlib/stringprep.pyi +27 -27
  506. package/dist/typeshed-fallback/stdlib/struct.pyi +5 -5
  507. package/dist/typeshed-fallback/stdlib/subprocess.pyi +2640 -2640
  508. package/dist/typeshed-fallback/stdlib/symbol.pyi +93 -93
  509. package/dist/typeshed-fallback/stdlib/symtable.pyi +90 -90
  510. package/dist/typeshed-fallback/stdlib/sys/__init__.pyi +773 -707
  511. package/dist/typeshed-fallback/stdlib/sysconfig.pyi +48 -48
  512. package/dist/typeshed-fallback/stdlib/tabnanny.pyi +16 -16
  513. package/dist/typeshed-fallback/stdlib/tarfile.pyi +593 -593
  514. package/dist/typeshed-fallback/stdlib/tempfile.pyi +497 -497
  515. package/dist/typeshed-fallback/stdlib/termios.pyi +108 -72
  516. package/dist/typeshed-fallback/stdlib/textwrap.pyi +103 -103
  517. package/dist/typeshed-fallback/stdlib/threading.pyi +279 -279
  518. package/dist/typeshed-fallback/stdlib/time.pyi +380 -380
  519. package/dist/typeshed-fallback/stdlib/timeit.pyi +32 -32
  520. package/dist/typeshed-fallback/stdlib/tkinter/__init__.pyi +3900 -3847
  521. package/dist/typeshed-fallback/stdlib/tkinter/colorchooser.pyi +20 -20
  522. package/dist/typeshed-fallback/stdlib/tkinter/commondialog.pyi +14 -14
  523. package/dist/typeshed-fallback/stdlib/tkinter/constants.pyi +80 -80
  524. package/dist/typeshed-fallback/stdlib/tkinter/dialog.pyi +16 -16
  525. package/dist/typeshed-fallback/stdlib/tkinter/dnd.pyi +20 -20
  526. package/dist/typeshed-fallback/stdlib/tkinter/filedialog.pyi +151 -151
  527. package/dist/typeshed-fallback/stdlib/tkinter/font.pyi +118 -116
  528. package/dist/typeshed-fallback/stdlib/tkinter/messagebox.pyi +44 -44
  529. package/dist/typeshed-fallback/stdlib/tkinter/scrolledtext.pyi +9 -9
  530. package/dist/typeshed-fallback/stdlib/tkinter/simpledialog.pyi +54 -54
  531. package/dist/typeshed-fallback/stdlib/tkinter/ttk.pyi +1207 -1207
  532. package/dist/typeshed-fallback/stdlib/token.pyi +160 -160
  533. package/dist/typeshed-fallback/stdlib/tokenize.pyi +186 -184
  534. package/dist/typeshed-fallback/stdlib/tomllib.pyi +10 -10
  535. package/dist/typeshed-fallback/stdlib/trace.pyi +90 -90
  536. package/dist/typeshed-fallback/stdlib/traceback.pyi +300 -300
  537. package/dist/typeshed-fallback/stdlib/tracemalloc.pyi +124 -124
  538. package/dist/typeshed-fallback/stdlib/turtle.pyi +732 -721
  539. package/dist/typeshed-fallback/stdlib/types.pyi +909 -913
  540. package/dist/typeshed-fallback/stdlib/typing.pyi +1145 -1147
  541. package/dist/typeshed-fallback/stdlib/typing_extensions.pyi +19 -47
  542. package/dist/typeshed-fallback/stdlib/unicodedata.pyi +303 -303
  543. package/dist/typeshed-fallback/stdlib/unittest/__init__.pyi +63 -68
  544. package/dist/typeshed-fallback/stdlib/unittest/_log.pyi +27 -27
  545. package/dist/typeshed-fallback/stdlib/unittest/async_case.pyi +25 -25
  546. package/dist/typeshed-fallback/stdlib/unittest/case.pyi +361 -361
  547. package/dist/typeshed-fallback/stdlib/unittest/loader.pyi +55 -55
  548. package/dist/typeshed-fallback/stdlib/unittest/main.pyi +73 -73
  549. package/dist/typeshed-fallback/stdlib/unittest/mock.pyi +468 -468
  550. package/dist/typeshed-fallback/stdlib/unittest/result.pyi +47 -47
  551. package/dist/typeshed-fallback/stdlib/unittest/runner.pyi +92 -92
  552. package/dist/typeshed-fallback/stdlib/unittest/signals.pyi +15 -15
  553. package/dist/typeshed-fallback/stdlib/unittest/suite.pyi +22 -22
  554. package/dist/typeshed-fallback/stdlib/unittest/util.pyi +23 -23
  555. package/dist/typeshed-fallback/stdlib/urllib/error.pyi +23 -23
  556. package/dist/typeshed-fallback/stdlib/urllib/parse.pyi +258 -258
  557. package/dist/typeshed-fallback/stdlib/urllib/request.pyi +408 -408
  558. package/dist/typeshed-fallback/stdlib/urllib/response.pyi +43 -43
  559. package/dist/typeshed-fallback/stdlib/urllib/robotparser.pyi +20 -20
  560. package/dist/typeshed-fallback/stdlib/uuid.pyi +100 -100
  561. package/dist/typeshed-fallback/stdlib/venv/__init__.pyi +107 -107
  562. package/dist/typeshed-fallback/stdlib/warnings.pyi +127 -127
  563. package/dist/typeshed-fallback/stdlib/wave.pyi +85 -85
  564. package/dist/typeshed-fallback/stdlib/weakref.pyi +198 -198
  565. package/dist/typeshed-fallback/stdlib/webbrowser.pyi +78 -77
  566. package/dist/typeshed-fallback/stdlib/wsgiref/handlers.pyi +91 -91
  567. package/dist/typeshed-fallback/stdlib/wsgiref/headers.pyi +26 -26
  568. package/dist/typeshed-fallback/stdlib/wsgiref/simple_server.pyi +37 -37
  569. package/dist/typeshed-fallback/stdlib/wsgiref/types.pyi +32 -32
  570. package/dist/typeshed-fallback/stdlib/wsgiref/util.pyi +26 -26
  571. package/dist/typeshed-fallback/stdlib/wsgiref/validate.pyi +50 -50
  572. package/dist/typeshed-fallback/stdlib/xml/__init__.pyi +3 -1
  573. package/dist/typeshed-fallback/stdlib/xml/dom/NodeFilter.pyi +19 -19
  574. package/dist/typeshed-fallback/stdlib/xml/dom/__init__.pyi +69 -69
  575. package/dist/typeshed-fallback/stdlib/xml/dom/domreg.pyi +8 -8
  576. package/dist/typeshed-fallback/stdlib/xml/dom/expatbuilder.pyi +100 -100
  577. package/dist/typeshed-fallback/stdlib/xml/dom/minicompat.pyi +26 -26
  578. package/dist/typeshed-fallback/stdlib/xml/dom/minidom.pyi +426 -426
  579. package/dist/typeshed-fallback/stdlib/xml/dom/pulldom.pyi +94 -94
  580. package/dist/typeshed-fallback/stdlib/xml/dom/xmlbuilder.pyi +108 -108
  581. package/dist/typeshed-fallback/stdlib/xml/etree/ElementInclude.pyi +29 -29
  582. package/dist/typeshed-fallback/stdlib/xml/etree/ElementPath.pyi +34 -34
  583. package/dist/typeshed-fallback/stdlib/xml/etree/ElementTree.pyi +347 -347
  584. package/dist/typeshed-fallback/stdlib/xml/etree/cElementTree.pyi +1 -1
  585. package/dist/typeshed-fallback/stdlib/xml/parsers/__init__.pyi +1 -1
  586. package/dist/typeshed-fallback/stdlib/xml/parsers/expat/__init__.pyi +7 -7
  587. package/dist/typeshed-fallback/stdlib/xml/parsers/expat/errors.pyi +3 -3
  588. package/dist/typeshed-fallback/stdlib/xml/parsers/expat/model.pyi +3 -3
  589. package/dist/typeshed-fallback/stdlib/xml/sax/__init__.pyi +25 -25
  590. package/dist/typeshed-fallback/stdlib/xml/sax/_exceptions.pyi +19 -19
  591. package/dist/typeshed-fallback/stdlib/xml/sax/handler.pyi +55 -55
  592. package/dist/typeshed-fallback/stdlib/xml/sax/saxutils.pyi +60 -60
  593. package/dist/typeshed-fallback/stdlib/xml/sax/xmlreader.pyi +87 -87
  594. package/dist/typeshed-fallback/stdlib/xmlrpc/client.pyi +296 -296
  595. package/dist/typeshed-fallback/stdlib/xmlrpc/server.pyi +144 -144
  596. package/dist/typeshed-fallback/stdlib/xxlimited.pyi +1 -3
  597. package/dist/typeshed-fallback/stdlib/zipapp.pyi +20 -20
  598. package/dist/typeshed-fallback/stdlib/zipfile/__init__.pyi +384 -384
  599. package/dist/typeshed-fallback/stdlib/zipfile/_path.pyi +103 -101
  600. package/dist/typeshed-fallback/stdlib/zipimport.pyi +41 -70
  601. package/dist/typeshed-fallback/stdlib/zlib.pyi +162 -157
  602. package/dist/typeshed-fallback/stdlib/zoneinfo/__init__.pyi +41 -47
  603. package/dist/typeshed-fallback/stdlib/zoneinfo/_common.pyi +13 -13
  604. package/dist/typeshed-fallback/stdlib/zoneinfo/_tzpath.pyi +13 -13
  605. package/dist/typeshed-fallback/stubs/Deprecated/METADATA.toml +1 -1
  606. package/dist/typeshed-fallback/stubs/Deprecated/deprecated/classic.pyi +6 -1
  607. package/dist/typeshed-fallback/stubs/Deprecated/deprecated/sphinx.pyi +1 -0
  608. package/dist/typeshed-fallback/stubs/bleach/METADATA.toml +1 -1
  609. package/dist/typeshed-fallback/stubs/docutils/docutils/core.pyi +216 -1
  610. package/dist/typeshed-fallback/stubs/docutils/docutils/writers/__init__.pyi +60 -2
  611. package/dist/typeshed-fallback/stubs/gevent/METADATA.toml +1 -1
  612. package/dist/typeshed-fallback/stubs/gevent/gevent/events.pyi +3 -1
  613. package/dist/typeshed-fallback/stubs/icalendar/METADATA.toml +6 -2
  614. package/dist/typeshed-fallback/stubs/icalendar/icalendar/__init__.pyi +14 -0
  615. package/dist/typeshed-fallback/stubs/icalendar/icalendar/alarms.pyi +54 -0
  616. package/dist/typeshed-fallback/stubs/icalendar/icalendar/cal.pyi +137 -11
  617. package/dist/typeshed-fallback/stubs/icalendar/icalendar/prop.pyi +8 -7
  618. package/dist/typeshed-fallback/stubs/icalendar/icalendar/timezone/__init__.pyi +3 -2
  619. package/dist/typeshed-fallback/stubs/icalendar/icalendar/timezone/equivalent_timezone_ids.pyi +15 -0
  620. package/dist/typeshed-fallback/stubs/icalendar/icalendar/timezone/equivalent_timezone_ids_result.pyi +6 -0
  621. package/dist/typeshed-fallback/stubs/icalendar/icalendar/timezone/tzid.pyi +8 -0
  622. package/dist/typeshed-fallback/stubs/icalendar/icalendar/timezone/tzp.pyi +2 -2
  623. package/dist/typeshed-fallback/stubs/icalendar/icalendar/tools.pyi +12 -1
  624. package/dist/typeshed-fallback/stubs/networkx/METADATA.toml +1 -1
  625. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/components/strongly_connected.pyi +0 -2
  626. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/tree/branchings.pyi +0 -31
  627. package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/tree/operations.pyi +1 -1
  628. package/dist/typeshed-fallback/stubs/networkx/networkx/classes/reportviews.pyi +3 -1
  629. package/dist/typeshed-fallback/stubs/networkx/networkx/drawing/layout.pyi +4 -0
  630. package/dist/typeshed-fallback/stubs/networkx/networkx/generators/trees.pyi +0 -4
  631. package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/json_graph/node_link.pyi +12 -2
  632. package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/text.pyi +1 -4
  633. package/dist/typeshed-fallback/stubs/networkx/networkx/utils/configs.pyi +20 -2
  634. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/__init__.pyi +2 -1
  635. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/cell/__init__.pyi +2 -0
  636. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/cell/_writer.pyi +4 -2
  637. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/cell/cell.pyi +2 -2
  638. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/comments/comment_sheet.pyi +2 -1
  639. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/workbook.pyi +2 -2
  640. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_read_only.pyi +5 -14
  641. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_reader.pyi +2 -3
  642. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_writer.pyi +4 -3
  643. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/merge.pyi +2 -1
  644. package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/worksheet.pyi +30 -19
  645. package/dist/typeshed-fallback/stubs/peewee/METADATA.toml +1 -1
  646. package/dist/typeshed-fallback/stubs/peewee/peewee.pyi +3 -1
  647. package/dist/typeshed-fallback/stubs/pynput/pynput/_util.pyi +2 -2
  648. package/dist/typeshed-fallback/stubs/pysftp/pysftp/__init__.pyi +2 -2
  649. package/dist/typeshed-fallback/stubs/pywin32/isapi/install.pyi +98 -0
  650. package/dist/typeshed-fallback/stubs/pywin32/win32/win32clipboard.pyi +26 -24
  651. package/dist/typeshed-fallback/stubs/setuptools/METADATA.toml +1 -1
  652. package/dist/typeshed-fallback/stubs/setuptools/distutils/spawn.pyi +1 -0
  653. package/dist/typeshed-fallback/stubs/setuptools/setuptools/__init__.pyi +6 -7
  654. package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/ccompiler.pyi +2 -2
  655. package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/cmd.pyi +2 -2
  656. package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/spawn.pyi +7 -0
  657. package/dist/typeshed-fallback/stubs/setuptools/setuptools/build_meta.pyi +4 -2
  658. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_egg.pyi +9 -8
  659. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_wheel.pyi +3 -5
  660. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/build_ext.pyi +2 -1
  661. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/build_py.pyi +6 -7
  662. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/easy_install.pyi +12 -17
  663. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/editable_wheel.pyi +1 -1
  664. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/egg_info.pyi +1 -1
  665. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/install_egg_info.pyi +1 -1
  666. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/sdist.pyi +2 -1
  667. package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/test.pyi +2 -2
  668. package/dist/typeshed-fallback/stubs/setuptools/setuptools/config/__init__.pyi +1 -14
  669. package/dist/typeshed-fallback/stubs/setuptools/setuptools/config/expand.pyi +1 -1
  670. package/dist/typeshed-fallback/stubs/setuptools/setuptools/config/setupcfg.pyi +7 -5
  671. package/dist/typeshed-fallback/stubs/setuptools/setuptools/depends.pyi +8 -4
  672. package/dist/typeshed-fallback/stubs/setuptools/setuptools/dist.pyi +1 -1
  673. package/dist/typeshed-fallback/stubs/setuptools/setuptools/msvc.pyi +7 -8
  674. package/dist/typeshed-fallback/stubs/setuptools/setuptools/package_index.pyi +7 -3
  675. package/dist/typeshed-fallback/stubs/setuptools/setuptools/sandbox.pyi +2 -4
  676. package/dist/typeshed-fallback/stubs/tqdm/METADATA.toml +2 -1
  677. package/dist/typeshed-fallback/stubs/tqdm/tqdm/contrib/discord.pyi +14 -3
  678. package/dist/typeshed-fallback/stubs/waitress/waitress/runner.pyi +1 -5
  679. package/package.json +5 -3
@@ -1,1147 +1,1145 @@
1
- # Since this module defines "overload" it is not recognized by Ruff as typing.overload
2
- # ruff: noqa: F811
3
- # TODO: The collections import is required, otherwise mypy crashes.
4
- # https://github.com/python/mypy/issues/16744
5
- import collections # noqa: F401 # pyright: ignore[reportUnusedImport]
6
- import sys
7
- import typing_extensions
8
- from _collections_abc import dict_items, dict_keys, dict_values
9
- from _typeshed import IdentityFunction, ReadableBuffer, SupportsKeysAndGetItem
10
- from abc import ABCMeta, abstractmethod
11
- from re import Match as Match, Pattern as Pattern
12
- from types import (
13
- BuiltinFunctionType,
14
- CodeType,
15
- FrameType,
16
- FunctionType,
17
- MethodDescriptorType,
18
- MethodType,
19
- MethodWrapperType,
20
- ModuleType,
21
- TracebackType,
22
- WrapperDescriptorType,
23
- )
24
- from typing_extensions import Never as _Never, ParamSpec as _ParamSpec, deprecated
25
-
26
- if sys.version_info >= (3, 9):
27
- from types import GenericAlias
28
- if sys.version_info >= (3, 10):
29
- from types import UnionType
30
-
31
- __all__ = [
32
- "AbstractSet",
33
- "Any",
34
- "AnyStr",
35
- "AsyncContextManager",
36
- "AsyncGenerator",
37
- "AsyncIterable",
38
- "AsyncIterator",
39
- "Awaitable",
40
- "ByteString",
41
- "Callable",
42
- "ChainMap",
43
- "ClassVar",
44
- "Collection",
45
- "Container",
46
- "ContextManager",
47
- "Coroutine",
48
- "Counter",
49
- "DefaultDict",
50
- "Deque",
51
- "Dict",
52
- "Final",
53
- "FrozenSet",
54
- "Generator",
55
- "Generic",
56
- "Hashable",
57
- "ItemsView",
58
- "Iterable",
59
- "Iterator",
60
- "KeysView",
61
- "List",
62
- "Literal",
63
- "Mapping",
64
- "MappingView",
65
- "MutableMapping",
66
- "MutableSequence",
67
- "MutableSet",
68
- "NamedTuple",
69
- "NewType",
70
- "Optional",
71
- "Protocol",
72
- "Reversible",
73
- "Sequence",
74
- "Set",
75
- "Sized",
76
- "SupportsAbs",
77
- "SupportsBytes",
78
- "SupportsComplex",
79
- "SupportsFloat",
80
- "SupportsIndex",
81
- "SupportsInt",
82
- "SupportsRound",
83
- "Text",
84
- "Tuple",
85
- "Type",
86
- "TypeVar",
87
- "TypedDict",
88
- "Union",
89
- "ValuesView",
90
- "TYPE_CHECKING",
91
- "cast",
92
- "final",
93
- "get_args",
94
- "get_origin",
95
- "get_type_hints",
96
- "no_type_check",
97
- "no_type_check_decorator",
98
- "overload",
99
- "runtime_checkable",
100
- "ForwardRef",
101
- "NoReturn",
102
- "OrderedDict",
103
- ]
104
-
105
- if sys.version_info >= (3, 9):
106
- __all__ += ["Annotated", "BinaryIO", "IO", "Match", "Pattern", "TextIO"]
107
-
108
- if sys.version_info >= (3, 10):
109
- __all__ += ["Concatenate", "ParamSpec", "ParamSpecArgs", "ParamSpecKwargs", "TypeAlias", "TypeGuard", "is_typeddict"]
110
-
111
- if sys.version_info >= (3, 11):
112
- __all__ += [
113
- "LiteralString",
114
- "Never",
115
- "NotRequired",
116
- "Required",
117
- "Self",
118
- "TypeVarTuple",
119
- "Unpack",
120
- "assert_never",
121
- "assert_type",
122
- "clear_overloads",
123
- "dataclass_transform",
124
- "get_overloads",
125
- "reveal_type",
126
- ]
127
-
128
- if sys.version_info >= (3, 12):
129
- __all__ += ["TypeAliasType", "override"]
130
-
131
- if sys.version_info >= (3, 13):
132
- __all__ += ["get_protocol_members", "is_protocol", "NoDefault", "TypeIs", "ReadOnly"]
133
-
134
- Any = object()
135
-
136
- def final(f: _T) -> _T: ...
137
- @final
138
- class TypeVar:
139
- @property
140
- def __name__(self) -> str: ...
141
- @property
142
- def __bound__(self) -> Any | None: ...
143
- @property
144
- def __constraints__(self) -> tuple[Any, ...]: ...
145
- @property
146
- def __covariant__(self) -> bool: ...
147
- @property
148
- def __contravariant__(self) -> bool: ...
149
- if sys.version_info >= (3, 12):
150
- @property
151
- def __infer_variance__(self) -> bool: ...
152
- if sys.version_info >= (3, 13):
153
- @property
154
- def __default__(self) -> Any: ...
155
- if sys.version_info >= (3, 13):
156
- def __init__(
157
- self,
158
- name: str,
159
- *constraints: Any,
160
- bound: Any | None = None,
161
- contravariant: bool = False,
162
- covariant: bool = False,
163
- infer_variance: bool = False,
164
- default: Any = ...,
165
- ) -> None: ...
166
- elif sys.version_info >= (3, 12):
167
- def __init__(
168
- self,
169
- name: str,
170
- *constraints: Any,
171
- bound: Any | None = None,
172
- covariant: bool = False,
173
- contravariant: bool = False,
174
- infer_variance: bool = False,
175
- ) -> None: ...
176
- else:
177
- def __init__(
178
- self, name: str, *constraints: Any, bound: Any | None = None, covariant: bool = False, contravariant: bool = False
179
- ) -> None: ...
180
- if sys.version_info >= (3, 10):
181
- def __or__(self, right: Any) -> _SpecialForm:
182
- """Return self|value."""
183
- ...
184
- def __ror__(self, left: Any) -> _SpecialForm:
185
- """Return value|self."""
186
- ...
187
- if sys.version_info >= (3, 11):
188
- def __typing_subst__(self, arg: Any) -> Any: ...
189
- if sys.version_info >= (3, 13):
190
- def __typing_prepare_subst__(self, alias: Any, args: Any) -> tuple[Any, ...]: ...
191
- def has_default(self) -> bool: ...
192
-
193
- # Used for an undocumented mypy feature. Does not exist at runtime.
194
- _promote = object()
195
-
196
- # N.B. Keep this definition in sync with typing_extensions._SpecialForm
197
- @final
198
- class _SpecialForm:
199
- def __getitem__(self, parameters: Any) -> object: ...
200
- if sys.version_info >= (3, 10):
201
- def __or__(self, other: Any) -> _SpecialForm: ...
202
- def __ror__(self, other: Any) -> _SpecialForm: ...
203
-
204
- Union: _SpecialForm
205
- Generic: _SpecialForm
206
- # Protocol is only present in 3.8 and later, but mypy needs it unconditionally
207
- Protocol: _SpecialForm
208
- Callable: _SpecialForm
209
- Type: _SpecialForm
210
- NoReturn: _SpecialForm
211
- ClassVar: _SpecialForm
212
-
213
- Optional: _SpecialForm
214
- Tuple: _SpecialForm
215
- Final: _SpecialForm
216
-
217
- Literal: _SpecialForm
218
- # TypedDict is a (non-subscriptable) special form.
219
- TypedDict: object
220
-
221
- if sys.version_info >= (3, 11):
222
- Self: _SpecialForm
223
- Never: _SpecialForm
224
- Unpack: _SpecialForm
225
- Required: _SpecialForm
226
- NotRequired: _SpecialForm
227
- LiteralString: _SpecialForm
228
-
229
- @final
230
- class TypeVarTuple:
231
- @property
232
- def __name__(self) -> str: ...
233
- if sys.version_info >= (3, 13):
234
- @property
235
- def __default__(self) -> Any:
236
- """The default value for this TypeVarTuple."""
237
- ...
238
- def has_default(self) -> bool: ...
239
- if sys.version_info >= (3, 13):
240
- def __init__(self, name: str, *, default: Any = ...) -> None: ...
241
- else:
242
- def __init__(self, name: str) -> None: ...
243
-
244
- def __iter__(self) -> Any:
245
- """Implement iter(self)."""
246
- ...
247
- def __typing_subst__(self, arg: Never) -> Never: ...
248
- def __typing_prepare_subst__(self, alias: Any, args: Any) -> tuple[Any, ...]: ...
249
-
250
- if sys.version_info >= (3, 10):
251
- @final
252
- class ParamSpecArgs:
253
- @property
254
- def __origin__(self) -> ParamSpec: ...
255
- def __init__(self, origin: ParamSpec) -> None: ...
256
- def __eq__(self, other: object) -> bool:
257
- """Return self==value."""
258
- ...
259
-
260
- @final
261
- class ParamSpecKwargs:
262
- @property
263
- def __origin__(self) -> ParamSpec: ...
264
- def __init__(self, origin: ParamSpec) -> None: ...
265
- def __eq__(self, other: object) -> bool:
266
- """Return self==value."""
267
- ...
268
-
269
- @final
270
- class ParamSpec:
271
- @property
272
- def __name__(self) -> str: ...
273
- @property
274
- def __bound__(self) -> Any | None: ...
275
- @property
276
- def __covariant__(self) -> bool: ...
277
- @property
278
- def __contravariant__(self) -> bool: ...
279
- if sys.version_info >= (3, 12):
280
- @property
281
- def __infer_variance__(self) -> bool: ...
282
- if sys.version_info >= (3, 13):
283
- @property
284
- def __default__(self) -> Any:
285
- """The default value for this ParamSpec."""
286
- ...
287
- if sys.version_info >= (3, 13):
288
- def __init__(
289
- self,
290
- name: str,
291
- *,
292
- bound: Any | None = None,
293
- contravariant: bool = False,
294
- covariant: bool = False,
295
- infer_variance: bool = False,
296
- default: Any = ...,
297
- ) -> None: ...
298
- elif sys.version_info >= (3, 12):
299
- def __init__(
300
- self,
301
- name: str,
302
- *,
303
- bound: Any | None = None,
304
- contravariant: bool = False,
305
- covariant: bool = False,
306
- infer_variance: bool = False,
307
- ) -> None: ...
308
- else:
309
- def __init__(
310
- self, name: str, *, bound: Any | None = None, contravariant: bool = False, covariant: bool = False
311
- ) -> None: ...
312
-
313
- @property
314
- def args(self) -> ParamSpecArgs:
315
- """Represents positional arguments."""
316
- ...
317
- @property
318
- def kwargs(self) -> ParamSpecKwargs:
319
- """Represents keyword arguments."""
320
- ...
321
- if sys.version_info >= (3, 11):
322
- def __typing_subst__(self, arg: Any) -> Any: ...
323
- def __typing_prepare_subst__(self, alias: Any, args: Any) -> tuple[Any, ...]: ...
324
-
325
- def __or__(self, right: Any) -> _SpecialForm:
326
- """Return self|value."""
327
- ...
328
- def __ror__(self, left: Any) -> _SpecialForm:
329
- """Return value|self."""
330
- ...
331
- if sys.version_info >= (3, 13):
332
- def has_default(self) -> bool: ...
333
-
334
- Concatenate: _SpecialForm
335
- TypeAlias: _SpecialForm
336
- TypeGuard: _SpecialForm
337
-
338
- class NewType:
339
- def __init__(self, name: str, tp: Any) -> None: ...
340
- if sys.version_info >= (3, 11):
341
- @staticmethod
342
- def __call__(x: _T, /) -> _T: ...
343
- else:
344
- def __call__(self, x: _T) -> _T: ...
345
-
346
- def __or__(self, other: Any) -> _SpecialForm: ...
347
- def __ror__(self, other: Any) -> _SpecialForm: ...
348
- __supertype__: type | NewType
349
-
350
- else:
351
- def NewType(name: str, tp: Any) -> Any: ...
352
-
353
- _F = TypeVar("_F", bound=Callable[..., Any])
354
- _P = _ParamSpec("_P")
355
- _T = TypeVar("_T")
356
-
357
- # These type variables are used by the container types.
358
- _S = TypeVar("_S")
359
- _KT = TypeVar("_KT") # Key type.
360
- _VT = TypeVar("_VT") # Value type.
361
- _T_co = TypeVar("_T_co", covariant=True) # Any type covariant containers.
362
- _KT_co = TypeVar("_KT_co", covariant=True) # Key type covariant containers.
363
- _VT_co = TypeVar("_VT_co", covariant=True) # Value type covariant containers.
364
- _TC = TypeVar("_TC", bound=type[object])
365
-
366
- def overload(func: _F) -> _F: ...
367
- def no_type_check(arg: _F) -> _F: ...
368
- def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ...
369
-
370
- # This itself is only available during type checking
371
- def type_check_only(func_or_cls: _F) -> _F: ...
372
-
373
- # Type aliases and type constructors
374
-
375
- class _Alias:
376
- # Class for defining generic aliases for library types.
377
- def __getitem__(self, typeargs: Any) -> Any: ...
378
-
379
- List = _Alias()
380
- Dict = _Alias()
381
- DefaultDict = _Alias()
382
- Set = _Alias()
383
- FrozenSet = _Alias()
384
- Counter = _Alias()
385
- Deque = _Alias()
386
- ChainMap = _Alias()
387
-
388
- OrderedDict = _Alias()
389
-
390
- if sys.version_info >= (3, 9):
391
- Annotated: _SpecialForm
392
-
393
- # Predefined type variables.
394
- AnyStr = TypeVar("AnyStr", str, bytes) # noqa: Y001
395
-
396
- class _ProtocolMeta(ABCMeta):
397
- if sys.version_info >= (3, 12):
398
- def __init__(cls, *args: Any, **kwargs: Any) -> None: ...
399
-
400
- # Abstract base classes.
401
-
402
- def runtime_checkable(cls: _TC) -> _TC: ...
403
- @runtime_checkable
404
- class SupportsInt(Protocol, metaclass=ABCMeta):
405
- @abstractmethod
406
- def __int__(self) -> int: ...
407
-
408
- @runtime_checkable
409
- class SupportsFloat(Protocol, metaclass=ABCMeta):
410
- @abstractmethod
411
- def __float__(self) -> float: ...
412
-
413
- @runtime_checkable
414
- class SupportsComplex(Protocol, metaclass=ABCMeta):
415
- @abstractmethod
416
- def __complex__(self) -> complex: ...
417
-
418
- @runtime_checkable
419
- class SupportsBytes(Protocol, metaclass=ABCMeta):
420
- @abstractmethod
421
- def __bytes__(self) -> bytes: ...
422
-
423
- @runtime_checkable
424
- class SupportsIndex(Protocol, metaclass=ABCMeta):
425
- @abstractmethod
426
- def __index__(self) -> int: ...
427
-
428
- @runtime_checkable
429
- class SupportsAbs(Protocol[_T_co]):
430
- @abstractmethod
431
- def __abs__(self) -> _T_co: ...
432
-
433
- @runtime_checkable
434
- class SupportsRound(Protocol[_T_co]):
435
- @overload
436
- @abstractmethod
437
- def __round__(self) -> int: ...
438
- @overload
439
- @abstractmethod
440
- def __round__(self, ndigits: int, /) -> _T_co: ...
441
-
442
- @runtime_checkable
443
- class Sized(Protocol, metaclass=ABCMeta):
444
- """A generic version of collections.abc.Sized."""
445
- @abstractmethod
446
- def __len__(self) -> int: ...
447
-
448
- @runtime_checkable
449
- class Hashable(Protocol, metaclass=ABCMeta):
450
- """A generic version of collections.abc.Hashable."""
451
- # TODO: This is special, in that a subclass of a hashable class may not be hashable
452
- # (for example, list vs. object). It's not obvious how to represent this. This class
453
- # is currently mostly useless for static checking.
454
- @abstractmethod
455
- def __hash__(self) -> int:
456
- """Return hash(self)."""
457
- ...
458
-
459
- @runtime_checkable
460
- class Iterable(Protocol[_T_co]):
461
- """A generic version of collections.abc.Iterable."""
462
- @abstractmethod
463
- def __iter__(self) -> Iterator[_T_co]: ...
464
-
465
- @runtime_checkable
466
- class Iterator(Iterable[_T_co], Protocol[_T_co]):
467
- """A generic version of collections.abc.Iterator."""
468
- @abstractmethod
469
- def __next__(self) -> _T_co: ...
470
- def __iter__(self) -> Iterator[_T_co]: ...
471
-
472
- @runtime_checkable
473
- class Reversible(Iterable[_T_co], Protocol[_T_co]):
474
- """A generic version of collections.abc.Reversible."""
475
- @abstractmethod
476
- def __reversed__(self) -> Iterator[_T_co]: ...
477
-
478
- _YieldT_co = TypeVar("_YieldT_co", covariant=True)
479
- _SendT_contra = TypeVar("_SendT_contra", contravariant=True, default=None)
480
- _ReturnT_co = TypeVar("_ReturnT_co", covariant=True, default=None)
481
-
482
- class Generator(Iterator[_YieldT_co], Generic[_YieldT_co, _SendT_contra, _ReturnT_co]):
483
- """A generic version of collections.abc.Generator."""
484
- def __next__(self) -> _YieldT_co: ...
485
- @abstractmethod
486
- def send(self, value: _SendT_contra, /) -> _YieldT_co: ...
487
- @overload
488
- @abstractmethod
489
- def throw(
490
- self, typ: type[BaseException], val: BaseException | object = None, tb: TracebackType | None = None, /
491
- ) -> _YieldT_co: ...
492
- @overload
493
- @abstractmethod
494
- def throw(self, typ: BaseException, val: None = None, tb: TracebackType | None = None, /) -> _YieldT_co: ...
495
- def close(self) -> None: ...
496
- def __iter__(self) -> Generator[_YieldT_co, _SendT_contra, _ReturnT_co]: ...
497
- @property
498
- def gi_code(self) -> CodeType: ...
499
- @property
500
- def gi_frame(self) -> FrameType: ...
501
- @property
502
- def gi_running(self) -> bool: ...
503
- @property
504
- def gi_yieldfrom(self) -> Generator[Any, Any, Any] | None: ...
505
-
506
- # NOTE: Prior to Python 3.13 these aliases are lacking the second _ExitT_co parameter
507
- if sys.version_info >= (3, 13):
508
- from contextlib import AbstractAsyncContextManager as AsyncContextManager, AbstractContextManager as ContextManager
509
- else:
510
- from contextlib import AbstractAsyncContextManager, AbstractContextManager
511
-
512
- @runtime_checkable
513
- class ContextManager(AbstractContextManager[_T_co, bool | None], Protocol[_T_co]):
514
- """A generic version of contextlib.AbstractContextManager."""
515
- ...
516
-
517
- @runtime_checkable
518
- class AsyncContextManager(AbstractAsyncContextManager[_T_co, bool | None], Protocol[_T_co]):
519
- """A generic version of contextlib.AbstractAsyncContextManager."""
520
- ...
521
-
522
- @runtime_checkable
523
- class Awaitable(Protocol[_T_co]):
524
- """A generic version of collections.abc.Awaitable."""
525
- @abstractmethod
526
- def __await__(self) -> Generator[Any, Any, _T_co]: ...
527
-
528
- # Non-default variations to accommodate couroutines, and `AwaitableGenerator` having a 4th type parameter.
529
- _SendT_contra_nd = TypeVar("_SendT_contra_nd", contravariant=True)
530
- _ReturnT_co_nd = TypeVar("_ReturnT_co_nd", covariant=True)
531
-
532
- class Coroutine(Awaitable[_ReturnT_co_nd], Generic[_YieldT_co, _SendT_contra_nd, _ReturnT_co_nd]):
533
- """A generic version of collections.abc.Coroutine."""
534
- __name__: str
535
- __qualname__: str
536
- @property
537
- def cr_await(self) -> Any | None: ...
538
- @property
539
- def cr_code(self) -> CodeType: ...
540
- @property
541
- def cr_frame(self) -> FrameType | None: ...
542
- @property
543
- def cr_running(self) -> bool: ...
544
- @abstractmethod
545
- def send(self, value: _SendT_contra_nd, /) -> _YieldT_co: ...
546
- @overload
547
- @abstractmethod
548
- def throw(
549
- self, typ: type[BaseException], val: BaseException | object = None, tb: TracebackType | None = None, /
550
- ) -> _YieldT_co: ...
551
- @overload
552
- @abstractmethod
553
- def throw(self, typ: BaseException, val: None = None, tb: TracebackType | None = None, /) -> _YieldT_co: ...
554
- @abstractmethod
555
- def close(self) -> None: ...
556
-
557
- # NOTE: This type does not exist in typing.py or PEP 484 but mypy needs it to exist.
558
- # The parameters correspond to Generator, but the 4th is the original type.
559
- @type_check_only
560
- class AwaitableGenerator(
561
- Awaitable[_ReturnT_co_nd],
562
- Generator[_YieldT_co, _SendT_contra_nd, _ReturnT_co_nd],
563
- Generic[_YieldT_co, _SendT_contra_nd, _ReturnT_co_nd, _S],
564
- metaclass=ABCMeta,
565
- ): ...
566
-
567
- @runtime_checkable
568
- class AsyncIterable(Protocol[_T_co]):
569
- """A generic version of collections.abc.AsyncIterable."""
570
- @abstractmethod
571
- def __aiter__(self) -> AsyncIterator[_T_co]: ...
572
-
573
- @runtime_checkable
574
- class AsyncIterator(AsyncIterable[_T_co], Protocol[_T_co]):
575
- """A generic version of collections.abc.AsyncIterator."""
576
- @abstractmethod
577
- def __anext__(self) -> Awaitable[_T_co]: ...
578
- def __aiter__(self) -> AsyncIterator[_T_co]: ...
579
-
580
- class AsyncGenerator(AsyncIterator[_YieldT_co], Generic[_YieldT_co, _SendT_contra]):
581
- """A generic version of collections.abc.AsyncGenerator."""
582
- def __anext__(self) -> Coroutine[Any, Any, _YieldT_co]: ...
583
- @abstractmethod
584
- def asend(self, value: _SendT_contra, /) -> Coroutine[Any, Any, _YieldT_co]: ...
585
- @overload
586
- @abstractmethod
587
- def athrow(
588
- self, typ: type[BaseException], val: BaseException | object = None, tb: TracebackType | None = None, /
589
- ) -> Coroutine[Any, Any, _YieldT_co]: ...
590
- @overload
591
- @abstractmethod
592
- def athrow(
593
- self, typ: BaseException, val: None = None, tb: TracebackType | None = None, /
594
- ) -> Coroutine[Any, Any, _YieldT_co]: ...
595
- def aclose(self) -> Coroutine[Any, Any, None]: ...
596
- @property
597
- def ag_await(self) -> Any: ...
598
- @property
599
- def ag_code(self) -> CodeType: ...
600
- @property
601
- def ag_frame(self) -> FrameType: ...
602
- @property
603
- def ag_running(self) -> bool: ...
604
-
605
- @runtime_checkable
606
- class Container(Protocol[_T_co]):
607
- """A generic version of collections.abc.Container."""
608
- # This is generic more on vibes than anything else
609
- @abstractmethod
610
- def __contains__(self, x: object, /) -> bool: ...
611
-
612
- @runtime_checkable
613
- class Collection(Iterable[_T_co], Container[_T_co], Protocol[_T_co]):
614
- """A generic version of collections.abc.Collection."""
615
- # Implement Sized (but don't have it as a base class).
616
- @abstractmethod
617
- def __len__(self) -> int: ...
618
-
619
- class Sequence(Reversible[_T_co], Collection[_T_co]):
620
- """A generic version of collections.abc.Sequence."""
621
- @overload
622
- @abstractmethod
623
- def __getitem__(self, index: int) -> _T_co: ...
624
- @overload
625
- @abstractmethod
626
- def __getitem__(self, index: slice) -> Sequence[_T_co]: ...
627
- # Mixin methods
628
- def index(self, value: Any, start: int = 0, stop: int = ...) -> int: ...
629
- def count(self, value: Any) -> int: ...
630
- def __contains__(self, value: object) -> bool: ...
631
- def __iter__(self) -> Iterator[_T_co]: ...
632
- def __reversed__(self) -> Iterator[_T_co]: ...
633
-
634
- class MutableSequence(Sequence[_T]):
635
- """A generic version of collections.abc.MutableSequence."""
636
- @abstractmethod
637
- def insert(self, index: int, value: _T) -> None: ...
638
- @overload
639
- @abstractmethod
640
- def __getitem__(self, index: int) -> _T: ...
641
- @overload
642
- @abstractmethod
643
- def __getitem__(self, index: slice) -> MutableSequence[_T]: ...
644
- @overload
645
- @abstractmethod
646
- def __setitem__(self, index: int, value: _T) -> None: ...
647
- @overload
648
- @abstractmethod
649
- def __setitem__(self, index: slice, value: Iterable[_T]) -> None: ...
650
- @overload
651
- @abstractmethod
652
- def __delitem__(self, index: int) -> None: ...
653
- @overload
654
- @abstractmethod
655
- def __delitem__(self, index: slice) -> None: ...
656
- # Mixin methods
657
- def append(self, value: _T) -> None: ...
658
- def clear(self) -> None: ...
659
- def extend(self, values: Iterable[_T]) -> None: ...
660
- def reverse(self) -> None: ...
661
- def pop(self, index: int = -1) -> _T: ...
662
- def remove(self, value: _T) -> None: ...
663
- def __iadd__(self, values: Iterable[_T]) -> typing_extensions.Self: ...
664
-
665
- class AbstractSet(Collection[_T_co]):
666
- """A generic version of collections.abc.Set."""
667
- @abstractmethod
668
- def __contains__(self, x: object) -> bool: ...
669
- def _hash(self) -> int: ...
670
- # Mixin methods
671
- def __le__(self, other: AbstractSet[Any]) -> bool:
672
- """Return self<=value."""
673
- ...
674
- def __lt__(self, other: AbstractSet[Any]) -> bool:
675
- """Return self<value."""
676
- ...
677
- def __gt__(self, other: AbstractSet[Any]) -> bool:
678
- """Return self>value."""
679
- ...
680
- def __ge__(self, other: AbstractSet[Any]) -> bool:
681
- """Return self>=value."""
682
- ...
683
- def __and__(self, other: AbstractSet[Any]) -> AbstractSet[_T_co]: ...
684
- def __or__(self, other: AbstractSet[_T]) -> AbstractSet[_T_co | _T]: ...
685
- def __sub__(self, other: AbstractSet[Any]) -> AbstractSet[_T_co]: ...
686
- def __xor__(self, other: AbstractSet[_T]) -> AbstractSet[_T_co | _T]: ...
687
- def __eq__(self, other: object) -> bool:
688
- """Return self==value."""
689
- ...
690
- def isdisjoint(self, other: Iterable[Any]) -> bool: ...
691
-
692
- class MutableSet(AbstractSet[_T]):
693
- """A generic version of collections.abc.MutableSet."""
694
- @abstractmethod
695
- def add(self, value: _T) -> None: ...
696
- @abstractmethod
697
- def discard(self, value: _T) -> None: ...
698
- # Mixin methods
699
- def clear(self) -> None: ...
700
- def pop(self) -> _T: ...
701
- def remove(self, value: _T) -> None: ...
702
- def __ior__(self, it: AbstractSet[_T]) -> typing_extensions.Self: ... # type: ignore[override,misc]
703
- def __iand__(self, it: AbstractSet[Any]) -> typing_extensions.Self: ...
704
- def __ixor__(self, it: AbstractSet[_T]) -> typing_extensions.Self: ... # type: ignore[override,misc]
705
- def __isub__(self, it: AbstractSet[Any]) -> typing_extensions.Self: ...
706
-
707
- class MappingView(Sized):
708
- """A generic version of collections.abc.MappingView."""
709
- def __init__(self, mapping: Mapping[Any, Any]) -> None: ... # undocumented
710
- def __len__(self) -> int: ...
711
-
712
- class ItemsView(MappingView, AbstractSet[tuple[_KT_co, _VT_co]], Generic[_KT_co, _VT_co]):
713
- """A generic version of collections.abc.ItemsView."""
714
- def __init__(self, mapping: Mapping[_KT_co, _VT_co]) -> None: ... # undocumented
715
- def __and__(self, other: Iterable[Any]) -> set[tuple[_KT_co, _VT_co]]: ...
716
- def __rand__(self, other: Iterable[_T]) -> set[_T]: ...
717
- def __contains__(self, item: object) -> bool: ...
718
- def __iter__(self) -> Iterator[tuple[_KT_co, _VT_co]]: ...
719
- def __reversed__(self) -> Iterator[tuple[_KT_co, _VT_co]]: ...
720
- def __or__(self, other: Iterable[_T]) -> set[tuple[_KT_co, _VT_co] | _T]: ...
721
- def __ror__(self, other: Iterable[_T]) -> set[tuple[_KT_co, _VT_co] | _T]: ...
722
- def __sub__(self, other: Iterable[Any]) -> set[tuple[_KT_co, _VT_co]]: ...
723
- def __rsub__(self, other: Iterable[_T]) -> set[_T]: ...
724
- def __xor__(self, other: Iterable[_T]) -> set[tuple[_KT_co, _VT_co] | _T]: ...
725
- def __rxor__(self, other: Iterable[_T]) -> set[tuple[_KT_co, _VT_co] | _T]: ...
726
-
727
- class KeysView(MappingView, AbstractSet[_KT_co]):
728
- """A generic version of collections.abc.KeysView."""
729
- def __init__(self, mapping: Mapping[_KT_co, Any]) -> None: ... # undocumented
730
- def __and__(self, other: Iterable[Any]) -> set[_KT_co]: ...
731
- def __rand__(self, other: Iterable[_T]) -> set[_T]: ...
732
- def __contains__(self, key: object) -> bool: ...
733
- def __iter__(self) -> Iterator[_KT_co]: ...
734
- def __reversed__(self) -> Iterator[_KT_co]: ...
735
- def __or__(self, other: Iterable[_T]) -> set[_KT_co | _T]: ...
736
- def __ror__(self, other: Iterable[_T]) -> set[_KT_co | _T]: ...
737
- def __sub__(self, other: Iterable[Any]) -> set[_KT_co]: ...
738
- def __rsub__(self, other: Iterable[_T]) -> set[_T]: ...
739
- def __xor__(self, other: Iterable[_T]) -> set[_KT_co | _T]: ...
740
- def __rxor__(self, other: Iterable[_T]) -> set[_KT_co | _T]: ...
741
-
742
- class ValuesView(MappingView, Collection[_VT_co]):
743
- """A generic version of collections.abc.ValuesView."""
744
- def __init__(self, mapping: Mapping[Any, _VT_co]) -> None: ... # undocumented
745
- def __contains__(self, value: object) -> bool: ...
746
- def __iter__(self) -> Iterator[_VT_co]: ...
747
- def __reversed__(self) -> Iterator[_VT_co]: ...
748
-
749
- class Mapping(Collection[_KT], Generic[_KT, _VT_co]):
750
- """A generic version of collections.abc.Mapping."""
751
- # TODO: We wish the key type could also be covariant, but that doesn't work,
752
- # see discussion in https://github.com/python/typing/pull/273.
753
- @abstractmethod
754
- def __getitem__(self, key: _KT, /) -> _VT_co: ...
755
- # Mixin methods
756
- @overload
757
- def get(self, key: _KT, /) -> _VT_co | None: ...
758
- @overload
759
- def get(self, key: _KT, /, default: _VT_co | _T) -> _VT_co | _T: ...
760
- def items(self) -> ItemsView[_KT, _VT_co]: ...
761
- def keys(self) -> KeysView[_KT]: ...
762
- def values(self) -> ValuesView[_VT_co]: ...
763
- def __contains__(self, key: object, /) -> bool: ...
764
- def __eq__(self, other: object, /) -> bool:
765
- """Return self==value."""
766
- ...
767
-
768
- class MutableMapping(Mapping[_KT, _VT]):
769
- """A generic version of collections.abc.MutableMapping."""
770
- @abstractmethod
771
- def __setitem__(self, key: _KT, value: _VT, /) -> None: ...
772
- @abstractmethod
773
- def __delitem__(self, key: _KT, /) -> None: ...
774
- def clear(self) -> None: ...
775
- @overload
776
- def pop(self, key: _KT, /) -> _VT: ...
777
- @overload
778
- def pop(self, key: _KT, /, default: _VT) -> _VT: ...
779
- @overload
780
- def pop(self, key: _KT, /, default: _T) -> _VT | _T: ...
781
- def popitem(self) -> tuple[_KT, _VT]: ...
782
- # This overload should be allowed only if the value type is compatible with None.
783
- #
784
- # Keep the following methods in line with MutableMapping.setdefault, modulo positional-only differences:
785
- # -- collections.OrderedDict.setdefault
786
- # -- collections.ChainMap.setdefault
787
- # -- weakref.WeakKeyDictionary.setdefault
788
- @overload
789
- def setdefault(self: MutableMapping[_KT, _T | None], key: _KT, default: None = None, /) -> _T | None: ...
790
- @overload
791
- def setdefault(self, key: _KT, default: _VT, /) -> _VT: ...
792
- # 'update' used to take a Union, but using overloading is better.
793
- # The second overloaded type here is a bit too general, because
794
- # Mapping[tuple[_KT, _VT], W] is a subclass of Iterable[tuple[_KT, _VT]],
795
- # but will always have the behavior of the first overloaded type
796
- # at runtime, leading to keys of a mix of types _KT and tuple[_KT, _VT].
797
- # We don't currently have any way of forcing all Mappings to use
798
- # the first overload, but by using overloading rather than a Union,
799
- # mypy will commit to using the first overload when the argument is
800
- # known to be a Mapping with unknown type parameters, which is closer
801
- # to the behavior we want. See mypy issue #1430.
802
- #
803
- # Various mapping classes have __ior__ methods that should be kept roughly in line with .update():
804
- # -- dict.__ior__
805
- # -- os._Environ.__ior__
806
- # -- collections.UserDict.__ior__
807
- # -- collections.ChainMap.__ior__
808
- # -- peewee.attrdict.__add__
809
- # -- peewee.attrdict.__iadd__
810
- # -- weakref.WeakValueDictionary.__ior__
811
- # -- weakref.WeakKeyDictionary.__ior__
812
- @overload
813
- def update(self, m: SupportsKeysAndGetItem[_KT, _VT], /, **kwargs: _VT) -> None: ...
814
- @overload
815
- def update(self, m: Iterable[tuple[_KT, _VT]], /, **kwargs: _VT) -> None: ...
816
- @overload
817
- def update(self, **kwargs: _VT) -> None: ...
818
-
819
- Text = str
820
-
821
- TYPE_CHECKING: bool
822
-
823
- # In stubs, the arguments of the IO class are marked as positional-only.
824
- # This differs from runtime, but better reflects the fact that in reality
825
- # classes deriving from IO use different names for the arguments.
826
- class IO(Generic[AnyStr]):
827
- # At runtime these are all abstract properties,
828
- # but making them abstract in the stub is hugely disruptive, for not much gain.
829
- # See #8726
830
- @property
831
- def mode(self) -> str: ...
832
- # Usually str, but may be bytes if a bytes path was passed to open(). See #10737.
833
- # If PEP 696 becomes available, we may want to use a defaulted TypeVar here.
834
- @property
835
- def name(self) -> str | Any: ...
836
- @abstractmethod
837
- def close(self) -> None: ...
838
- @property
839
- def closed(self) -> bool: ...
840
- @abstractmethod
841
- def fileno(self) -> int: ...
842
- @abstractmethod
843
- def flush(self) -> None: ...
844
- @abstractmethod
845
- def isatty(self) -> bool: ...
846
- @abstractmethod
847
- def read(self, n: int = -1, /) -> AnyStr: ...
848
- @abstractmethod
849
- def readable(self) -> bool: ...
850
- @abstractmethod
851
- def readline(self, limit: int = -1, /) -> AnyStr: ...
852
- @abstractmethod
853
- def readlines(self, hint: int = -1, /) -> list[AnyStr]: ...
854
- @abstractmethod
855
- def seek(self, offset: int, whence: int = 0, /) -> int: ...
856
- @abstractmethod
857
- def seekable(self) -> bool: ...
858
- @abstractmethod
859
- def tell(self) -> int: ...
860
- @abstractmethod
861
- def truncate(self, size: int | None = None, /) -> int: ...
862
- @abstractmethod
863
- def writable(self) -> bool: ...
864
- @abstractmethod
865
- @overload
866
- def write(self: IO[bytes], s: ReadableBuffer, /) -> int: ...
867
- @abstractmethod
868
- @overload
869
- def write(self, s: AnyStr, /) -> int: ...
870
- @abstractmethod
871
- @overload
872
- def writelines(self: IO[bytes], lines: Iterable[ReadableBuffer], /) -> None: ...
873
- @abstractmethod
874
- @overload
875
- def writelines(self, lines: Iterable[AnyStr], /) -> None: ...
876
- @abstractmethod
877
- def __next__(self) -> AnyStr: ...
878
- @abstractmethod
879
- def __iter__(self) -> Iterator[AnyStr]: ...
880
- @abstractmethod
881
- def __enter__(self) -> IO[AnyStr]: ...
882
- @abstractmethod
883
- def __exit__(
884
- self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None, /
885
- ) -> None: ...
886
-
887
- class BinaryIO(IO[bytes]):
888
- @abstractmethod
889
- def __enter__(self) -> BinaryIO: ...
890
-
891
- class TextIO(IO[str]):
892
- # See comment regarding the @properties in the `IO` class
893
- @property
894
- def buffer(self) -> BinaryIO: ...
895
- @property
896
- def encoding(self) -> str: ...
897
- @property
898
- def errors(self) -> str | None: ...
899
- @property
900
- def line_buffering(self) -> int: ... # int on PyPy, bool on CPython
901
- @property
902
- def newlines(self) -> Any: ... # None, str or tuple
903
- @abstractmethod
904
- def __enter__(self) -> TextIO: ...
905
-
906
- if sys.version_info < (3, 14):
907
- ByteString: typing_extensions.TypeAlias = bytes | bytearray | memoryview
908
-
909
- # Functions
910
-
911
- _get_type_hints_obj_allowed_types: typing_extensions.TypeAlias = ( # noqa: Y042
912
- object
913
- | Callable[..., Any]
914
- | FunctionType
915
- | BuiltinFunctionType
916
- | MethodType
917
- | ModuleType
918
- | WrapperDescriptorType
919
- | MethodWrapperType
920
- | MethodDescriptorType
921
- )
922
-
923
- if sys.version_info >= (3, 9):
924
- def get_type_hints(
925
- obj: _get_type_hints_obj_allowed_types,
926
- globalns: dict[str, Any] | None = None,
927
- localns: Mapping[str, Any] | None = None,
928
- include_extras: bool = False,
929
- ) -> dict[str, Any]: ...
930
-
931
- else:
932
- def get_type_hints(
933
- obj: _get_type_hints_obj_allowed_types, globalns: dict[str, Any] | None = None, localns: Mapping[str, Any] | None = None
934
- ) -> dict[str, Any]: ...
935
-
936
- def get_args(tp: Any) -> tuple[Any, ...]: ...
937
-
938
- if sys.version_info >= (3, 10):
939
- @overload
940
- def get_origin(tp: ParamSpecArgs | ParamSpecKwargs) -> ParamSpec: ...
941
- @overload
942
- def get_origin(tp: UnionType) -> type[UnionType]: ...
943
-
944
- if sys.version_info >= (3, 9):
945
- @overload
946
- def get_origin(tp: GenericAlias) -> type: ...
947
- @overload
948
- def get_origin(tp: Any) -> Any | None: ...
949
-
950
- else:
951
- def get_origin(tp: Any) -> Any | None: ...
952
-
953
- @overload
954
- def cast(typ: type[_T], val: Any) -> _T: ...
955
- @overload
956
- def cast(typ: str, val: Any) -> Any: ...
957
- @overload
958
- def cast(typ: object, val: Any) -> Any: ...
959
-
960
- if sys.version_info >= (3, 11):
961
- def reveal_type(obj: _T, /) -> _T: ...
962
- def assert_never(arg: Never, /) -> Never: ...
963
- def assert_type(val: _T, typ: Any, /) -> _T: ...
964
- def clear_overloads() -> None: ...
965
- def get_overloads(func: Callable[..., object]) -> Sequence[Callable[..., object]]: ...
966
- def dataclass_transform(
967
- *,
968
- eq_default: bool = True,
969
- order_default: bool = False,
970
- kw_only_default: bool = False,
971
- frozen_default: bool = False, # on 3.11, runtime accepts it as part of kwargs
972
- field_specifiers: tuple[type[Any] | Callable[..., Any], ...] = (),
973
- **kwargs: Any,
974
- ) -> IdentityFunction: ...
975
-
976
- # Type constructors
977
-
978
- class NamedTuple(tuple[Any, ...]):
979
- if sys.version_info < (3, 9):
980
- _field_types: ClassVar[dict[str, type]]
981
- _field_defaults: ClassVar[dict[str, Any]]
982
- _fields: ClassVar[tuple[str, ...]]
983
- # __orig_bases__ sometimes exists on <3.12, but not consistently
984
- # So we only add it to the stub on 3.12+.
985
- if sys.version_info >= (3, 12):
986
- __orig_bases__: ClassVar[tuple[Any, ...]]
987
-
988
- @overload
989
- def __init__(self, typename: str, fields: Iterable[tuple[str, Any]], /) -> None:
990
- """Initialize self. See help(type(self)) for accurate signature."""
991
- ...
992
- @overload
993
- @typing_extensions.deprecated(
994
- "Creating a typing.NamedTuple using keyword arguments is deprecated and support will be removed in Python 3.15"
995
- )
996
- def __init__(self, typename: str, fields: None = None, /, **kwargs: Any) -> None:
997
- """Initialize self. See help(type(self)) for accurate signature."""
998
- ...
999
- @classmethod
1000
- def _make(cls, iterable: Iterable[Any]) -> typing_extensions.Self: ...
1001
- def _asdict(self) -> dict[str, Any]: ...
1002
- def _replace(self, **kwargs: Any) -> typing_extensions.Self: ...
1003
- if sys.version_info >= (3, 13):
1004
- def __replace__(self, **kwargs: Any) -> typing_extensions.Self: ...
1005
-
1006
- # Internal mypy fallback type for all typed dicts (does not exist at runtime)
1007
- # N.B. Keep this mostly in sync with typing_extensions._TypedDict/mypy_extensions._TypedDict
1008
- @type_check_only
1009
- class _TypedDict(Mapping[str, object], metaclass=ABCMeta):
1010
- __total__: ClassVar[bool]
1011
- if sys.version_info >= (3, 9):
1012
- __required_keys__: ClassVar[frozenset[str]]
1013
- __optional_keys__: ClassVar[frozenset[str]]
1014
- # __orig_bases__ sometimes exists on <3.12, but not consistently,
1015
- # so we only add it to the stub on 3.12+
1016
- if sys.version_info >= (3, 12):
1017
- __orig_bases__: ClassVar[tuple[Any, ...]]
1018
-
1019
- def copy(self) -> typing_extensions.Self: ...
1020
- # Using Never so that only calls using mypy plugin hook that specialize the signature
1021
- # can go through.
1022
- def setdefault(self, k: _Never, default: object) -> object: ...
1023
- # Mypy plugin hook for 'pop' expects that 'default' has a type variable type.
1024
- def pop(self, k: _Never, default: _T = ...) -> object: ... # pyright: ignore[reportInvalidTypeVarUse]
1025
- def update(self: _T, m: _T, /) -> None: ...
1026
- def __delitem__(self, k: _Never) -> None: ...
1027
- def items(self) -> dict_items[str, object]: ...
1028
- def keys(self) -> dict_keys[str, object]: ...
1029
- def values(self) -> dict_values[str, object]: ...
1030
- if sys.version_info >= (3, 9):
1031
- @overload
1032
- def __or__(self, value: typing_extensions.Self, /) -> typing_extensions.Self:
1033
- """Return self|value."""
1034
- ...
1035
- @overload
1036
- def __or__(self, value: dict[str, Any], /) -> dict[str, object]:
1037
- """Return self|value."""
1038
- ...
1039
- @overload
1040
- def __ror__(self, value: typing_extensions.Self, /) -> typing_extensions.Self:
1041
- """Return value|self."""
1042
- ...
1043
- @overload
1044
- def __ror__(self, value: dict[str, Any], /) -> dict[str, object]:
1045
- """Return value|self."""
1046
- ...
1047
- # supposedly incompatible definitions of __or__ and __ior__
1048
- def __ior__(self, value: typing_extensions.Self, /) -> typing_extensions.Self: ... # type: ignore[misc]
1049
-
1050
- @final
1051
- class ForwardRef:
1052
- __forward_arg__: str
1053
- __forward_code__: CodeType
1054
- __forward_evaluated__: bool
1055
- __forward_value__: Any | None
1056
- __forward_is_argument__: bool
1057
- __forward_is_class__: bool
1058
- __forward_module__: Any | None
1059
- if sys.version_info >= (3, 9):
1060
- # The module and is_class arguments were added in later Python 3.9 versions.
1061
- def __init__(self, arg: str, is_argument: bool = True, module: Any | None = None, *, is_class: bool = False) -> None: ...
1062
- else:
1063
- def __init__(self, arg: str, is_argument: bool = True) -> None: ...
1064
-
1065
- if sys.version_info >= (3, 13):
1066
- @overload
1067
- @deprecated(
1068
- "Failing to pass a value to the 'type_params' parameter of ForwardRef._evaluate() is deprecated, "
1069
- "as it leads to incorrect behaviour when evaluating a stringified annotation "
1070
- "that references a PEP 695 type parameter. It will be disallowed in Python 3.15."
1071
- )
1072
- def _evaluate(
1073
- self, globalns: dict[str, Any] | None, localns: Mapping[str, Any] | None, *, recursive_guard: frozenset[str]
1074
- ) -> Any | None: ...
1075
- @overload
1076
- def _evaluate(
1077
- self,
1078
- globalns: dict[str, Any] | None,
1079
- localns: Mapping[str, Any] | None,
1080
- type_params: tuple[TypeVar | ParamSpec | TypeVarTuple, ...],
1081
- *,
1082
- recursive_guard: frozenset[str],
1083
- ) -> Any | None: ...
1084
- elif sys.version_info >= (3, 12):
1085
- def _evaluate(
1086
- self,
1087
- globalns: dict[str, Any] | None,
1088
- localns: Mapping[str, Any] | None,
1089
- type_params: tuple[TypeVar | ParamSpec | TypeVarTuple, ...] | None = None,
1090
- *,
1091
- recursive_guard: frozenset[str],
1092
- ) -> Any | None: ...
1093
- elif sys.version_info >= (3, 9):
1094
- def _evaluate(
1095
- self, globalns: dict[str, Any] | None, localns: Mapping[str, Any] | None, recursive_guard: frozenset[str]
1096
- ) -> Any | None: ...
1097
- else:
1098
- def _evaluate(self, globalns: dict[str, Any] | None, localns: Mapping[str, Any] | None) -> Any | None: ...
1099
-
1100
- def __eq__(self, other: object) -> bool: ...
1101
- def __hash__(self) -> int: ...
1102
- if sys.version_info >= (3, 11):
1103
- def __or__(self, other: Any) -> _SpecialForm: ...
1104
- def __ror__(self, other: Any) -> _SpecialForm: ...
1105
-
1106
- if sys.version_info >= (3, 10):
1107
- def is_typeddict(tp: object) -> bool: ...
1108
-
1109
- def _type_repr(obj: object) -> str: ...
1110
-
1111
- if sys.version_info >= (3, 12):
1112
- def override(method: _F, /) -> _F: ...
1113
- @final
1114
- class TypeAliasType:
1115
- def __init__(
1116
- self, name: str, value: Any, *, type_params: tuple[TypeVar | ParamSpec | TypeVarTuple, ...] = ()
1117
- ) -> None: ...
1118
- @property
1119
- def __value__(self) -> Any: ...
1120
- @property
1121
- def __type_params__(self) -> tuple[TypeVar | ParamSpec | TypeVarTuple, ...]: ...
1122
- @property
1123
- def __parameters__(self) -> tuple[Any, ...]: ...
1124
- @property
1125
- def __name__(self) -> str: ...
1126
- # It's writable on types, but not on instances of TypeAliasType.
1127
- @property
1128
- def __module__(self) -> str | None: ... # type: ignore[override]
1129
- def __getitem__(self, parameters: Any) -> GenericAlias:
1130
- """Return self[key]."""
1131
- ...
1132
- def __or__(self, right: Any) -> _SpecialForm:
1133
- """Return self|value."""
1134
- ...
1135
- def __ror__(self, left: Any) -> _SpecialForm:
1136
- """Return value|self."""
1137
- ...
1138
-
1139
- if sys.version_info >= (3, 13):
1140
- def is_protocol(tp: type, /) -> bool: ...
1141
- def get_protocol_members(tp: type, /) -> frozenset[str]: ...
1142
- @final
1143
- class _NoDefaultType: ...
1144
-
1145
- NoDefault: _NoDefaultType
1146
- TypeIs: _SpecialForm
1147
- ReadOnly: _SpecialForm
1
+ # Since this module defines "overload" it is not recognized by Ruff as typing.overload
2
+ # ruff: noqa: F811
3
+ # TODO: The collections import is required, otherwise mypy crashes.
4
+ # https://github.com/python/mypy/issues/16744
5
+ import collections # noqa: F401 # pyright: ignore[reportUnusedImport]
6
+ import sys
7
+ import typing_extensions
8
+ from _collections_abc import dict_items, dict_keys, dict_values
9
+ from _typeshed import IdentityFunction, ReadableBuffer, SupportsKeysAndGetItem
10
+ from abc import ABCMeta, abstractmethod
11
+ from re import Match as Match, Pattern as Pattern
12
+ from types import (
13
+ BuiltinFunctionType,
14
+ CodeType,
15
+ FrameType,
16
+ FunctionType,
17
+ MethodDescriptorType,
18
+ MethodType,
19
+ MethodWrapperType,
20
+ ModuleType,
21
+ TracebackType,
22
+ WrapperDescriptorType,
23
+ )
24
+ from typing_extensions import Never as _Never, ParamSpec as _ParamSpec, deprecated
25
+
26
+ if sys.version_info >= (3, 9):
27
+ from types import GenericAlias
28
+ if sys.version_info >= (3, 10):
29
+ from types import UnionType
30
+
31
+ __all__ = [
32
+ "AbstractSet",
33
+ "Any",
34
+ "AnyStr",
35
+ "AsyncContextManager",
36
+ "AsyncGenerator",
37
+ "AsyncIterable",
38
+ "AsyncIterator",
39
+ "Awaitable",
40
+ "ByteString",
41
+ "Callable",
42
+ "ChainMap",
43
+ "ClassVar",
44
+ "Collection",
45
+ "Container",
46
+ "ContextManager",
47
+ "Coroutine",
48
+ "Counter",
49
+ "DefaultDict",
50
+ "Deque",
51
+ "Dict",
52
+ "Final",
53
+ "FrozenSet",
54
+ "Generator",
55
+ "Generic",
56
+ "Hashable",
57
+ "ItemsView",
58
+ "Iterable",
59
+ "Iterator",
60
+ "KeysView",
61
+ "List",
62
+ "Literal",
63
+ "Mapping",
64
+ "MappingView",
65
+ "MutableMapping",
66
+ "MutableSequence",
67
+ "MutableSet",
68
+ "NamedTuple",
69
+ "NewType",
70
+ "Optional",
71
+ "Protocol",
72
+ "Reversible",
73
+ "Sequence",
74
+ "Set",
75
+ "Sized",
76
+ "SupportsAbs",
77
+ "SupportsBytes",
78
+ "SupportsComplex",
79
+ "SupportsFloat",
80
+ "SupportsIndex",
81
+ "SupportsInt",
82
+ "SupportsRound",
83
+ "Text",
84
+ "Tuple",
85
+ "Type",
86
+ "TypeVar",
87
+ "TypedDict",
88
+ "Union",
89
+ "ValuesView",
90
+ "TYPE_CHECKING",
91
+ "cast",
92
+ "final",
93
+ "get_args",
94
+ "get_origin",
95
+ "get_type_hints",
96
+ "no_type_check",
97
+ "no_type_check_decorator",
98
+ "overload",
99
+ "runtime_checkable",
100
+ "ForwardRef",
101
+ "NoReturn",
102
+ "OrderedDict",
103
+ ]
104
+
105
+ if sys.version_info >= (3, 9):
106
+ __all__ += ["Annotated", "BinaryIO", "IO", "Match", "Pattern", "TextIO"]
107
+
108
+ if sys.version_info >= (3, 10):
109
+ __all__ += ["Concatenate", "ParamSpec", "ParamSpecArgs", "ParamSpecKwargs", "TypeAlias", "TypeGuard", "is_typeddict"]
110
+
111
+ if sys.version_info >= (3, 11):
112
+ __all__ += [
113
+ "LiteralString",
114
+ "Never",
115
+ "NotRequired",
116
+ "Required",
117
+ "Self",
118
+ "TypeVarTuple",
119
+ "Unpack",
120
+ "assert_never",
121
+ "assert_type",
122
+ "clear_overloads",
123
+ "dataclass_transform",
124
+ "get_overloads",
125
+ "reveal_type",
126
+ ]
127
+
128
+ if sys.version_info >= (3, 12):
129
+ __all__ += ["TypeAliasType", "override"]
130
+
131
+ if sys.version_info >= (3, 13):
132
+ __all__ += ["get_protocol_members", "is_protocol", "NoDefault", "TypeIs", "ReadOnly"]
133
+
134
+ Any = object()
135
+
136
+ class _Final: ...
137
+
138
+ def final(f: _T) -> _T: ...
139
+ @final
140
+ class TypeVar:
141
+ @property
142
+ def __name__(self) -> str: ...
143
+ @property
144
+ def __bound__(self) -> Any | None: ...
145
+ @property
146
+ def __constraints__(self) -> tuple[Any, ...]: ...
147
+ @property
148
+ def __covariant__(self) -> bool: ...
149
+ @property
150
+ def __contravariant__(self) -> bool: ...
151
+ if sys.version_info >= (3, 12):
152
+ @property
153
+ def __infer_variance__(self) -> bool: ...
154
+ if sys.version_info >= (3, 13):
155
+ @property
156
+ def __default__(self) -> Any: ...
157
+ if sys.version_info >= (3, 13):
158
+ def __init__(
159
+ self,
160
+ name: str,
161
+ *constraints: Any,
162
+ bound: Any | None = None,
163
+ contravariant: bool = False,
164
+ covariant: bool = False,
165
+ infer_variance: bool = False,
166
+ default: Any = ...,
167
+ ) -> None: ...
168
+ elif sys.version_info >= (3, 12):
169
+ def __init__(
170
+ self,
171
+ name: str,
172
+ *constraints: Any,
173
+ bound: Any | None = None,
174
+ covariant: bool = False,
175
+ contravariant: bool = False,
176
+ infer_variance: bool = False,
177
+ ) -> None: ...
178
+ else:
179
+ def __init__(
180
+ self, name: str, *constraints: Any, bound: Any | None = None, covariant: bool = False, contravariant: bool = False
181
+ ) -> None: ...
182
+ if sys.version_info >= (3, 10):
183
+ def __or__(self, right: Any) -> _SpecialForm:
184
+ """Return self|value."""
185
+ ...
186
+ def __ror__(self, left: Any) -> _SpecialForm:
187
+ """Return value|self."""
188
+ ...
189
+ if sys.version_info >= (3, 11):
190
+ def __typing_subst__(self, arg: Any) -> Any: ...
191
+ if sys.version_info >= (3, 13):
192
+ def __typing_prepare_subst__(self, alias: Any, args: Any) -> tuple[Any, ...]: ...
193
+ def has_default(self) -> bool: ...
194
+
195
+ # Used for an undocumented mypy feature. Does not exist at runtime.
196
+ _promote = object()
197
+
198
+ # N.B. Keep this definition in sync with typing_extensions._SpecialForm
199
+ @final
200
+ class _SpecialForm(_Final):
201
+ def __getitem__(self, parameters: Any) -> object: ...
202
+ if sys.version_info >= (3, 10):
203
+ def __or__(self, other: Any) -> _SpecialForm: ...
204
+ def __ror__(self, other: Any) -> _SpecialForm: ...
205
+
206
+ Union: _SpecialForm
207
+ Generic: _SpecialForm
208
+ # Protocol is only present in 3.8 and later, but mypy needs it unconditionally
209
+ Protocol: _SpecialForm
210
+ Callable: _SpecialForm
211
+ Type: _SpecialForm
212
+ NoReturn: _SpecialForm
213
+ ClassVar: _SpecialForm
214
+
215
+ Optional: _SpecialForm
216
+ Tuple: _SpecialForm
217
+ Final: _SpecialForm
218
+
219
+ Literal: _SpecialForm
220
+ TypedDict: _SpecialForm
221
+
222
+ if sys.version_info >= (3, 11):
223
+ Self: _SpecialForm
224
+ Never: _SpecialForm
225
+ Unpack: _SpecialForm
226
+ Required: _SpecialForm
227
+ NotRequired: _SpecialForm
228
+ LiteralString: _SpecialForm
229
+
230
+ @final
231
+ class TypeVarTuple:
232
+ @property
233
+ def __name__(self) -> str: ...
234
+ if sys.version_info >= (3, 13):
235
+ @property
236
+ def __default__(self) -> Any:
237
+ """The default value for this TypeVarTuple."""
238
+ ...
239
+ def has_default(self) -> bool: ...
240
+ if sys.version_info >= (3, 13):
241
+ def __init__(self, name: str, *, default: Any = ...) -> None: ...
242
+ else:
243
+ def __init__(self, name: str) -> None: ...
244
+
245
+ def __iter__(self) -> Any:
246
+ """Implement iter(self)."""
247
+ ...
248
+ def __typing_subst__(self, arg: Never) -> Never: ...
249
+ def __typing_prepare_subst__(self, alias: Any, args: Any) -> tuple[Any, ...]: ...
250
+
251
+ if sys.version_info >= (3, 10):
252
+ @final
253
+ class ParamSpecArgs:
254
+ @property
255
+ def __origin__(self) -> ParamSpec: ...
256
+ def __init__(self, origin: ParamSpec) -> None: ...
257
+ def __eq__(self, other: object) -> bool:
258
+ """Return self==value."""
259
+ ...
260
+
261
+ @final
262
+ class ParamSpecKwargs:
263
+ @property
264
+ def __origin__(self) -> ParamSpec: ...
265
+ def __init__(self, origin: ParamSpec) -> None: ...
266
+ def __eq__(self, other: object) -> bool:
267
+ """Return self==value."""
268
+ ...
269
+
270
+ @final
271
+ class ParamSpec:
272
+ @property
273
+ def __name__(self) -> str: ...
274
+ @property
275
+ def __bound__(self) -> Any | None: ...
276
+ @property
277
+ def __covariant__(self) -> bool: ...
278
+ @property
279
+ def __contravariant__(self) -> bool: ...
280
+ if sys.version_info >= (3, 12):
281
+ @property
282
+ def __infer_variance__(self) -> bool: ...
283
+ if sys.version_info >= (3, 13):
284
+ @property
285
+ def __default__(self) -> Any:
286
+ """The default value for this ParamSpec."""
287
+ ...
288
+ if sys.version_info >= (3, 13):
289
+ def __init__(
290
+ self,
291
+ name: str,
292
+ *,
293
+ bound: Any | None = None,
294
+ contravariant: bool = False,
295
+ covariant: bool = False,
296
+ infer_variance: bool = False,
297
+ default: Any = ...,
298
+ ) -> None: ...
299
+ elif sys.version_info >= (3, 12):
300
+ def __init__(
301
+ self,
302
+ name: str,
303
+ *,
304
+ bound: Any | None = None,
305
+ contravariant: bool = False,
306
+ covariant: bool = False,
307
+ infer_variance: bool = False,
308
+ ) -> None: ...
309
+ else:
310
+ def __init__(
311
+ self, name: str, *, bound: Any | None = None, contravariant: bool = False, covariant: bool = False
312
+ ) -> None: ...
313
+
314
+ @property
315
+ def args(self) -> ParamSpecArgs:
316
+ """Represents positional arguments."""
317
+ ...
318
+ @property
319
+ def kwargs(self) -> ParamSpecKwargs:
320
+ """Represents keyword arguments."""
321
+ ...
322
+ if sys.version_info >= (3, 11):
323
+ def __typing_subst__(self, arg: Any) -> Any: ...
324
+ def __typing_prepare_subst__(self, alias: Any, args: Any) -> tuple[Any, ...]: ...
325
+
326
+ def __or__(self, right: Any) -> _SpecialForm:
327
+ """Return self|value."""
328
+ ...
329
+ def __ror__(self, left: Any) -> _SpecialForm:
330
+ """Return value|self."""
331
+ ...
332
+ if sys.version_info >= (3, 13):
333
+ def has_default(self) -> bool: ...
334
+
335
+ Concatenate: _SpecialForm
336
+ TypeAlias: _SpecialForm
337
+ TypeGuard: _SpecialForm
338
+
339
+ class NewType:
340
+ def __init__(self, name: str, tp: Any) -> None: ...
341
+ if sys.version_info >= (3, 11):
342
+ @staticmethod
343
+ def __call__(x: _T, /) -> _T: ...
344
+ else:
345
+ def __call__(self, x: _T) -> _T: ...
346
+
347
+ def __or__(self, other: Any) -> _SpecialForm: ...
348
+ def __ror__(self, other: Any) -> _SpecialForm: ...
349
+ __supertype__: type | NewType
350
+
351
+ else:
352
+ def NewType(name: str, tp: Any) -> Any: ...
353
+
354
+ _F = TypeVar("_F", bound=Callable[..., Any])
355
+ _P = _ParamSpec("_P")
356
+ _T = TypeVar("_T")
357
+
358
+ # These type variables are used by the container types.
359
+ _S = TypeVar("_S")
360
+ _KT = TypeVar("_KT") # Key type.
361
+ _VT = TypeVar("_VT") # Value type.
362
+ _T_co = TypeVar("_T_co", covariant=True) # Any type covariant containers.
363
+ _KT_co = TypeVar("_KT_co", covariant=True) # Key type covariant containers.
364
+ _VT_co = TypeVar("_VT_co", covariant=True) # Value type covariant containers.
365
+ _TC = TypeVar("_TC", bound=type[object])
366
+
367
+ def overload(func: _F) -> _F: ...
368
+ def no_type_check(arg: _F) -> _F: ...
369
+ def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ...
370
+
371
+ # This itself is only available during type checking
372
+ def type_check_only(func_or_cls: _F) -> _F: ...
373
+
374
+ # Type aliases and type constructors
375
+
376
+ class _Alias:
377
+ # Class for defining generic aliases for library types.
378
+ def __getitem__(self, typeargs: Any) -> Any: ...
379
+
380
+ List = _Alias()
381
+ Dict = _Alias()
382
+ DefaultDict = _Alias()
383
+ Set = _Alias()
384
+ FrozenSet = _Alias()
385
+ Counter = _Alias()
386
+ Deque = _Alias()
387
+ ChainMap = _Alias()
388
+
389
+ OrderedDict = _Alias()
390
+
391
+ if sys.version_info >= (3, 9):
392
+ Annotated: _SpecialForm
393
+
394
+ # Predefined type variables.
395
+ AnyStr = TypeVar("AnyStr", str, bytes) # noqa: Y001
396
+
397
+ class _ProtocolMeta(ABCMeta):
398
+ if sys.version_info >= (3, 12):
399
+ def __init__(cls, *args: Any, **kwargs: Any) -> None: ...
400
+
401
+ # Abstract base classes.
402
+
403
+ def runtime_checkable(cls: _TC) -> _TC: ...
404
+ @runtime_checkable
405
+ class SupportsInt(Protocol, metaclass=ABCMeta):
406
+ @abstractmethod
407
+ def __int__(self) -> int: ...
408
+
409
+ @runtime_checkable
410
+ class SupportsFloat(Protocol, metaclass=ABCMeta):
411
+ @abstractmethod
412
+ def __float__(self) -> float: ...
413
+
414
+ @runtime_checkable
415
+ class SupportsComplex(Protocol, metaclass=ABCMeta):
416
+ @abstractmethod
417
+ def __complex__(self) -> complex: ...
418
+
419
+ @runtime_checkable
420
+ class SupportsBytes(Protocol, metaclass=ABCMeta):
421
+ @abstractmethod
422
+ def __bytes__(self) -> bytes: ...
423
+
424
+ @runtime_checkable
425
+ class SupportsIndex(Protocol, metaclass=ABCMeta):
426
+ @abstractmethod
427
+ def __index__(self) -> int: ...
428
+
429
+ @runtime_checkable
430
+ class SupportsAbs(Protocol[_T_co]):
431
+ @abstractmethod
432
+ def __abs__(self) -> _T_co: ...
433
+
434
+ @runtime_checkable
435
+ class SupportsRound(Protocol[_T_co]):
436
+ @overload
437
+ @abstractmethod
438
+ def __round__(self) -> int: ...
439
+ @overload
440
+ @abstractmethod
441
+ def __round__(self, ndigits: int, /) -> _T_co: ...
442
+
443
+ @runtime_checkable
444
+ class Sized(Protocol, metaclass=ABCMeta):
445
+ """A generic version of collections.abc.Sized."""
446
+ @abstractmethod
447
+ def __len__(self) -> int: ...
448
+
449
+ @runtime_checkable
450
+ class Hashable(Protocol, metaclass=ABCMeta):
451
+ """A generic version of collections.abc.Hashable."""
452
+ # TODO: This is special, in that a subclass of a hashable class may not be hashable
453
+ # (for example, list vs. object). It's not obvious how to represent this. This class
454
+ # is currently mostly useless for static checking.
455
+ @abstractmethod
456
+ def __hash__(self) -> int:
457
+ """Return hash(self)."""
458
+ ...
459
+
460
+ @runtime_checkable
461
+ class Iterable(Protocol[_T_co]):
462
+ """A generic version of collections.abc.Iterable."""
463
+ @abstractmethod
464
+ def __iter__(self) -> Iterator[_T_co]: ...
465
+
466
+ @runtime_checkable
467
+ class Iterator(Iterable[_T_co], Protocol[_T_co]):
468
+ """A generic version of collections.abc.Iterator."""
469
+ @abstractmethod
470
+ def __next__(self) -> _T_co: ...
471
+ def __iter__(self) -> Iterator[_T_co]: ...
472
+
473
+ @runtime_checkable
474
+ class Reversible(Iterable[_T_co], Protocol[_T_co]):
475
+ """A generic version of collections.abc.Reversible."""
476
+ @abstractmethod
477
+ def __reversed__(self) -> Iterator[_T_co]: ...
478
+
479
+ _YieldT_co = TypeVar("_YieldT_co", covariant=True)
480
+ _SendT_contra = TypeVar("_SendT_contra", contravariant=True, default=None)
481
+ _ReturnT_co = TypeVar("_ReturnT_co", covariant=True, default=None)
482
+
483
+ class Generator(Iterator[_YieldT_co], Generic[_YieldT_co, _SendT_contra, _ReturnT_co]):
484
+ """A generic version of collections.abc.Generator."""
485
+ def __next__(self) -> _YieldT_co: ...
486
+ @abstractmethod
487
+ def send(self, value: _SendT_contra, /) -> _YieldT_co: ...
488
+ @overload
489
+ @abstractmethod
490
+ def throw(
491
+ self, typ: type[BaseException], val: BaseException | object = None, tb: TracebackType | None = None, /
492
+ ) -> _YieldT_co: ...
493
+ @overload
494
+ @abstractmethod
495
+ def throw(self, typ: BaseException, val: None = None, tb: TracebackType | None = None, /) -> _YieldT_co: ...
496
+ if sys.version_info >= (3, 13):
497
+ def close(self) -> _ReturnT_co | None: ...
498
+ else:
499
+ def close(self) -> None: ...
500
+
501
+ def __iter__(self) -> Generator[_YieldT_co, _SendT_contra, _ReturnT_co]: ...
502
+ @property
503
+ def gi_code(self) -> CodeType: ...
504
+ @property
505
+ def gi_frame(self) -> FrameType: ...
506
+ @property
507
+ def gi_running(self) -> bool: ...
508
+ @property
509
+ def gi_yieldfrom(self) -> Generator[Any, Any, Any] | None: ...
510
+
511
+ # NOTE: Prior to Python 3.13 these aliases are lacking the second _ExitT_co parameter
512
+ if sys.version_info >= (3, 13):
513
+ from contextlib import AbstractAsyncContextManager as AsyncContextManager, AbstractContextManager as ContextManager
514
+ else:
515
+ from contextlib import AbstractAsyncContextManager, AbstractContextManager
516
+
517
+ @runtime_checkable
518
+ class ContextManager(AbstractContextManager[_T_co, bool | None], Protocol[_T_co]): ...
519
+
520
+ @runtime_checkable
521
+ class AsyncContextManager(AbstractAsyncContextManager[_T_co, bool | None], Protocol[_T_co]): ...
522
+
523
+ @runtime_checkable
524
+ class Awaitable(Protocol[_T_co]):
525
+ """A generic version of collections.abc.Awaitable."""
526
+ @abstractmethod
527
+ def __await__(self) -> Generator[Any, Any, _T_co]: ...
528
+
529
+ # Non-default variations to accommodate couroutines, and `AwaitableGenerator` having a 4th type parameter.
530
+ _SendT_contra_nd = TypeVar("_SendT_contra_nd", contravariant=True)
531
+ _ReturnT_co_nd = TypeVar("_ReturnT_co_nd", covariant=True)
532
+
533
+ class Coroutine(Awaitable[_ReturnT_co_nd], Generic[_YieldT_co, _SendT_contra_nd, _ReturnT_co_nd]):
534
+ """A generic version of collections.abc.Coroutine."""
535
+ __name__: str
536
+ __qualname__: str
537
+ @property
538
+ def cr_await(self) -> Any | None: ...
539
+ @property
540
+ def cr_code(self) -> CodeType: ...
541
+ @property
542
+ def cr_frame(self) -> FrameType | None: ...
543
+ @property
544
+ def cr_running(self) -> bool: ...
545
+ @abstractmethod
546
+ def send(self, value: _SendT_contra_nd, /) -> _YieldT_co: ...
547
+ @overload
548
+ @abstractmethod
549
+ def throw(
550
+ self, typ: type[BaseException], val: BaseException | object = None, tb: TracebackType | None = None, /
551
+ ) -> _YieldT_co: ...
552
+ @overload
553
+ @abstractmethod
554
+ def throw(self, typ: BaseException, val: None = None, tb: TracebackType | None = None, /) -> _YieldT_co: ...
555
+ @abstractmethod
556
+ def close(self) -> None: ...
557
+
558
+ # NOTE: This type does not exist in typing.py or PEP 484 but mypy needs it to exist.
559
+ # The parameters correspond to Generator, but the 4th is the original type.
560
+ @type_check_only
561
+ class AwaitableGenerator(
562
+ Awaitable[_ReturnT_co_nd],
563
+ Generator[_YieldT_co, _SendT_contra_nd, _ReturnT_co_nd],
564
+ Generic[_YieldT_co, _SendT_contra_nd, _ReturnT_co_nd, _S],
565
+ metaclass=ABCMeta,
566
+ ): ...
567
+
568
+ @runtime_checkable
569
+ class AsyncIterable(Protocol[_T_co]):
570
+ """A generic version of collections.abc.AsyncIterable."""
571
+ @abstractmethod
572
+ def __aiter__(self) -> AsyncIterator[_T_co]: ...
573
+
574
+ @runtime_checkable
575
+ class AsyncIterator(AsyncIterable[_T_co], Protocol[_T_co]):
576
+ """A generic version of collections.abc.AsyncIterator."""
577
+ @abstractmethod
578
+ def __anext__(self) -> Awaitable[_T_co]: ...
579
+ def __aiter__(self) -> AsyncIterator[_T_co]: ...
580
+
581
+ class AsyncGenerator(AsyncIterator[_YieldT_co], Generic[_YieldT_co, _SendT_contra]):
582
+ """A generic version of collections.abc.AsyncGenerator."""
583
+ def __anext__(self) -> Coroutine[Any, Any, _YieldT_co]: ...
584
+ @abstractmethod
585
+ def asend(self, value: _SendT_contra, /) -> Coroutine[Any, Any, _YieldT_co]: ...
586
+ @overload
587
+ @abstractmethod
588
+ def athrow(
589
+ self, typ: type[BaseException], val: BaseException | object = None, tb: TracebackType | None = None, /
590
+ ) -> Coroutine[Any, Any, _YieldT_co]: ...
591
+ @overload
592
+ @abstractmethod
593
+ def athrow(
594
+ self, typ: BaseException, val: None = None, tb: TracebackType | None = None, /
595
+ ) -> Coroutine[Any, Any, _YieldT_co]: ...
596
+ def aclose(self) -> Coroutine[Any, Any, None]: ...
597
+ @property
598
+ def ag_await(self) -> Any: ...
599
+ @property
600
+ def ag_code(self) -> CodeType: ...
601
+ @property
602
+ def ag_frame(self) -> FrameType: ...
603
+ @property
604
+ def ag_running(self) -> bool: ...
605
+
606
+ @runtime_checkable
607
+ class Container(Protocol[_T_co]):
608
+ """A generic version of collections.abc.Container."""
609
+ # This is generic more on vibes than anything else
610
+ @abstractmethod
611
+ def __contains__(self, x: object, /) -> bool: ...
612
+
613
+ @runtime_checkable
614
+ class Collection(Iterable[_T_co], Container[_T_co], Protocol[_T_co]):
615
+ """A generic version of collections.abc.Collection."""
616
+ # Implement Sized (but don't have it as a base class).
617
+ @abstractmethod
618
+ def __len__(self) -> int: ...
619
+
620
+ class Sequence(Reversible[_T_co], Collection[_T_co]):
621
+ """A generic version of collections.abc.Sequence."""
622
+ @overload
623
+ @abstractmethod
624
+ def __getitem__(self, index: int) -> _T_co: ...
625
+ @overload
626
+ @abstractmethod
627
+ def __getitem__(self, index: slice) -> Sequence[_T_co]: ...
628
+ # Mixin methods
629
+ def index(self, value: Any, start: int = 0, stop: int = ...) -> int: ...
630
+ def count(self, value: Any) -> int: ...
631
+ def __contains__(self, value: object) -> bool: ...
632
+ def __iter__(self) -> Iterator[_T_co]: ...
633
+ def __reversed__(self) -> Iterator[_T_co]: ...
634
+
635
+ class MutableSequence(Sequence[_T]):
636
+ """A generic version of collections.abc.MutableSequence."""
637
+ @abstractmethod
638
+ def insert(self, index: int, value: _T) -> None: ...
639
+ @overload
640
+ @abstractmethod
641
+ def __getitem__(self, index: int) -> _T: ...
642
+ @overload
643
+ @abstractmethod
644
+ def __getitem__(self, index: slice) -> MutableSequence[_T]: ...
645
+ @overload
646
+ @abstractmethod
647
+ def __setitem__(self, index: int, value: _T) -> None: ...
648
+ @overload
649
+ @abstractmethod
650
+ def __setitem__(self, index: slice, value: Iterable[_T]) -> None: ...
651
+ @overload
652
+ @abstractmethod
653
+ def __delitem__(self, index: int) -> None: ...
654
+ @overload
655
+ @abstractmethod
656
+ def __delitem__(self, index: slice) -> None: ...
657
+ # Mixin methods
658
+ def append(self, value: _T) -> None: ...
659
+ def clear(self) -> None: ...
660
+ def extend(self, values: Iterable[_T]) -> None: ...
661
+ def reverse(self) -> None: ...
662
+ def pop(self, index: int = -1) -> _T: ...
663
+ def remove(self, value: _T) -> None: ...
664
+ def __iadd__(self, values: Iterable[_T]) -> typing_extensions.Self: ...
665
+
666
+ class AbstractSet(Collection[_T_co]):
667
+ """A generic version of collections.abc.Set."""
668
+ @abstractmethod
669
+ def __contains__(self, x: object) -> bool: ...
670
+ def _hash(self) -> int: ...
671
+ # Mixin methods
672
+ def __le__(self, other: AbstractSet[Any]) -> bool:
673
+ """Return self<=value."""
674
+ ...
675
+ def __lt__(self, other: AbstractSet[Any]) -> bool:
676
+ """Return self<value."""
677
+ ...
678
+ def __gt__(self, other: AbstractSet[Any]) -> bool:
679
+ """Return self>value."""
680
+ ...
681
+ def __ge__(self, other: AbstractSet[Any]) -> bool:
682
+ """Return self>=value."""
683
+ ...
684
+ def __and__(self, other: AbstractSet[Any]) -> AbstractSet[_T_co]: ...
685
+ def __or__(self, other: AbstractSet[_T]) -> AbstractSet[_T_co | _T]: ...
686
+ def __sub__(self, other: AbstractSet[Any]) -> AbstractSet[_T_co]: ...
687
+ def __xor__(self, other: AbstractSet[_T]) -> AbstractSet[_T_co | _T]: ...
688
+ def __eq__(self, other: object) -> bool:
689
+ """Return self==value."""
690
+ ...
691
+ def isdisjoint(self, other: Iterable[Any]) -> bool: ...
692
+
693
+ class MutableSet(AbstractSet[_T]):
694
+ """A generic version of collections.abc.MutableSet."""
695
+ @abstractmethod
696
+ def add(self, value: _T) -> None: ...
697
+ @abstractmethod
698
+ def discard(self, value: _T) -> None: ...
699
+ # Mixin methods
700
+ def clear(self) -> None: ...
701
+ def pop(self) -> _T: ...
702
+ def remove(self, value: _T) -> None: ...
703
+ def __ior__(self, it: AbstractSet[_T]) -> typing_extensions.Self: ... # type: ignore[override,misc]
704
+ def __iand__(self, it: AbstractSet[Any]) -> typing_extensions.Self: ...
705
+ def __ixor__(self, it: AbstractSet[_T]) -> typing_extensions.Self: ... # type: ignore[override,misc]
706
+ def __isub__(self, it: AbstractSet[Any]) -> typing_extensions.Self: ...
707
+
708
+ class MappingView(Sized):
709
+ """A generic version of collections.abc.MappingView."""
710
+ def __init__(self, mapping: Mapping[Any, Any]) -> None: ... # undocumented
711
+ def __len__(self) -> int: ...
712
+
713
+ class ItemsView(MappingView, AbstractSet[tuple[_KT_co, _VT_co]], Generic[_KT_co, _VT_co]):
714
+ """A generic version of collections.abc.ItemsView."""
715
+ def __init__(self, mapping: Mapping[_KT_co, _VT_co]) -> None: ... # undocumented
716
+ def __and__(self, other: Iterable[Any]) -> set[tuple[_KT_co, _VT_co]]: ...
717
+ def __rand__(self, other: Iterable[_T]) -> set[_T]: ...
718
+ def __contains__(self, item: object) -> bool: ...
719
+ def __iter__(self) -> Iterator[tuple[_KT_co, _VT_co]]: ...
720
+ def __or__(self, other: Iterable[_T]) -> set[tuple[_KT_co, _VT_co] | _T]: ...
721
+ def __ror__(self, other: Iterable[_T]) -> set[tuple[_KT_co, _VT_co] | _T]: ...
722
+ def __sub__(self, other: Iterable[Any]) -> set[tuple[_KT_co, _VT_co]]: ...
723
+ def __rsub__(self, other: Iterable[_T]) -> set[_T]: ...
724
+ def __xor__(self, other: Iterable[_T]) -> set[tuple[_KT_co, _VT_co] | _T]: ...
725
+ def __rxor__(self, other: Iterable[_T]) -> set[tuple[_KT_co, _VT_co] | _T]: ...
726
+
727
+ class KeysView(MappingView, AbstractSet[_KT_co]):
728
+ """A generic version of collections.abc.KeysView."""
729
+ def __init__(self, mapping: Mapping[_KT_co, Any]) -> None: ... # undocumented
730
+ def __and__(self, other: Iterable[Any]) -> set[_KT_co]: ...
731
+ def __rand__(self, other: Iterable[_T]) -> set[_T]: ...
732
+ def __contains__(self, key: object) -> bool: ...
733
+ def __iter__(self) -> Iterator[_KT_co]: ...
734
+ def __or__(self, other: Iterable[_T]) -> set[_KT_co | _T]: ...
735
+ def __ror__(self, other: Iterable[_T]) -> set[_KT_co | _T]: ...
736
+ def __sub__(self, other: Iterable[Any]) -> set[_KT_co]: ...
737
+ def __rsub__(self, other: Iterable[_T]) -> set[_T]: ...
738
+ def __xor__(self, other: Iterable[_T]) -> set[_KT_co | _T]: ...
739
+ def __rxor__(self, other: Iterable[_T]) -> set[_KT_co | _T]: ...
740
+
741
+ class ValuesView(MappingView, Collection[_VT_co]):
742
+ """A generic version of collections.abc.ValuesView."""
743
+ def __init__(self, mapping: Mapping[Any, _VT_co]) -> None: ... # undocumented
744
+ def __contains__(self, value: object) -> bool: ...
745
+ def __iter__(self) -> Iterator[_VT_co]: ...
746
+
747
+ class Mapping(Collection[_KT], Generic[_KT, _VT_co]):
748
+ """A generic version of collections.abc.Mapping."""
749
+ # TODO: We wish the key type could also be covariant, but that doesn't work,
750
+ # see discussion in https://github.com/python/typing/pull/273.
751
+ @abstractmethod
752
+ def __getitem__(self, key: _KT, /) -> _VT_co: ...
753
+ # Mixin methods
754
+ @overload
755
+ def get(self, key: _KT, /) -> _VT_co | None: ...
756
+ @overload
757
+ def get(self, key: _KT, /, default: _VT_co | _T) -> _VT_co | _T: ...
758
+ def items(self) -> ItemsView[_KT, _VT_co]: ...
759
+ def keys(self) -> KeysView[_KT]: ...
760
+ def values(self) -> ValuesView[_VT_co]: ...
761
+ def __contains__(self, key: object, /) -> bool: ...
762
+ def __eq__(self, other: object, /) -> bool:
763
+ """Return self==value."""
764
+ ...
765
+
766
+ class MutableMapping(Mapping[_KT, _VT]):
767
+ """A generic version of collections.abc.MutableMapping."""
768
+ @abstractmethod
769
+ def __setitem__(self, key: _KT, value: _VT, /) -> None: ...
770
+ @abstractmethod
771
+ def __delitem__(self, key: _KT, /) -> None: ...
772
+ def clear(self) -> None: ...
773
+ @overload
774
+ def pop(self, key: _KT, /) -> _VT: ...
775
+ @overload
776
+ def pop(self, key: _KT, /, default: _VT) -> _VT: ...
777
+ @overload
778
+ def pop(self, key: _KT, /, default: _T) -> _VT | _T: ...
779
+ def popitem(self) -> tuple[_KT, _VT]: ...
780
+ # This overload should be allowed only if the value type is compatible with None.
781
+ #
782
+ # Keep the following methods in line with MutableMapping.setdefault, modulo positional-only differences:
783
+ # -- collections.OrderedDict.setdefault
784
+ # -- collections.ChainMap.setdefault
785
+ # -- weakref.WeakKeyDictionary.setdefault
786
+ @overload
787
+ def setdefault(self: MutableMapping[_KT, _T | None], key: _KT, default: None = None, /) -> _T | None: ...
788
+ @overload
789
+ def setdefault(self, key: _KT, default: _VT, /) -> _VT: ...
790
+ # 'update' used to take a Union, but using overloading is better.
791
+ # The second overloaded type here is a bit too general, because
792
+ # Mapping[tuple[_KT, _VT], W] is a subclass of Iterable[tuple[_KT, _VT]],
793
+ # but will always have the behavior of the first overloaded type
794
+ # at runtime, leading to keys of a mix of types _KT and tuple[_KT, _VT].
795
+ # We don't currently have any way of forcing all Mappings to use
796
+ # the first overload, but by using overloading rather than a Union,
797
+ # mypy will commit to using the first overload when the argument is
798
+ # known to be a Mapping with unknown type parameters, which is closer
799
+ # to the behavior we want. See mypy issue #1430.
800
+ #
801
+ # Various mapping classes have __ior__ methods that should be kept roughly in line with .update():
802
+ # -- dict.__ior__
803
+ # -- os._Environ.__ior__
804
+ # -- collections.UserDict.__ior__
805
+ # -- collections.ChainMap.__ior__
806
+ # -- peewee.attrdict.__add__
807
+ # -- peewee.attrdict.__iadd__
808
+ # -- weakref.WeakValueDictionary.__ior__
809
+ # -- weakref.WeakKeyDictionary.__ior__
810
+ @overload
811
+ def update(self, m: SupportsKeysAndGetItem[_KT, _VT], /, **kwargs: _VT) -> None: ...
812
+ @overload
813
+ def update(self, m: Iterable[tuple[_KT, _VT]], /, **kwargs: _VT) -> None: ...
814
+ @overload
815
+ def update(self, **kwargs: _VT) -> None: ...
816
+
817
+ Text = str
818
+
819
+ TYPE_CHECKING: bool
820
+
821
+ # In stubs, the arguments of the IO class are marked as positional-only.
822
+ # This differs from runtime, but better reflects the fact that in reality
823
+ # classes deriving from IO use different names for the arguments.
824
+ class IO(Generic[AnyStr]):
825
+ # At runtime these are all abstract properties,
826
+ # but making them abstract in the stub is hugely disruptive, for not much gain.
827
+ # See #8726
828
+ @property
829
+ def mode(self) -> str: ...
830
+ # Usually str, but may be bytes if a bytes path was passed to open(). See #10737.
831
+ # If PEP 696 becomes available, we may want to use a defaulted TypeVar here.
832
+ @property
833
+ def name(self) -> str | Any: ...
834
+ @abstractmethod
835
+ def close(self) -> None: ...
836
+ @property
837
+ def closed(self) -> bool: ...
838
+ @abstractmethod
839
+ def fileno(self) -> int: ...
840
+ @abstractmethod
841
+ def flush(self) -> None: ...
842
+ @abstractmethod
843
+ def isatty(self) -> bool: ...
844
+ @abstractmethod
845
+ def read(self, n: int = -1, /) -> AnyStr: ...
846
+ @abstractmethod
847
+ def readable(self) -> bool: ...
848
+ @abstractmethod
849
+ def readline(self, limit: int = -1, /) -> AnyStr: ...
850
+ @abstractmethod
851
+ def readlines(self, hint: int = -1, /) -> list[AnyStr]: ...
852
+ @abstractmethod
853
+ def seek(self, offset: int, whence: int = 0, /) -> int: ...
854
+ @abstractmethod
855
+ def seekable(self) -> bool: ...
856
+ @abstractmethod
857
+ def tell(self) -> int: ...
858
+ @abstractmethod
859
+ def truncate(self, size: int | None = None, /) -> int: ...
860
+ @abstractmethod
861
+ def writable(self) -> bool: ...
862
+ @abstractmethod
863
+ @overload
864
+ def write(self: IO[bytes], s: ReadableBuffer, /) -> int: ...
865
+ @abstractmethod
866
+ @overload
867
+ def write(self, s: AnyStr, /) -> int: ...
868
+ @abstractmethod
869
+ @overload
870
+ def writelines(self: IO[bytes], lines: Iterable[ReadableBuffer], /) -> None: ...
871
+ @abstractmethod
872
+ @overload
873
+ def writelines(self, lines: Iterable[AnyStr], /) -> None: ...
874
+ @abstractmethod
875
+ def __next__(self) -> AnyStr: ...
876
+ @abstractmethod
877
+ def __iter__(self) -> Iterator[AnyStr]: ...
878
+ @abstractmethod
879
+ def __enter__(self) -> IO[AnyStr]: ...
880
+ @abstractmethod
881
+ def __exit__(
882
+ self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None, /
883
+ ) -> None: ...
884
+
885
+ class BinaryIO(IO[bytes]):
886
+ @abstractmethod
887
+ def __enter__(self) -> BinaryIO: ...
888
+
889
+ class TextIO(IO[str]):
890
+ # See comment regarding the @properties in the `IO` class
891
+ @property
892
+ def buffer(self) -> BinaryIO: ...
893
+ @property
894
+ def encoding(self) -> str: ...
895
+ @property
896
+ def errors(self) -> str | None: ...
897
+ @property
898
+ def line_buffering(self) -> int: ... # int on PyPy, bool on CPython
899
+ @property
900
+ def newlines(self) -> Any: ... # None, str or tuple
901
+ @abstractmethod
902
+ def __enter__(self) -> TextIO: ...
903
+
904
+ if sys.version_info < (3, 14):
905
+ ByteString: typing_extensions.TypeAlias = bytes | bytearray | memoryview
906
+
907
+ # Functions
908
+
909
+ _get_type_hints_obj_allowed_types: typing_extensions.TypeAlias = ( # noqa: Y042
910
+ object
911
+ | Callable[..., Any]
912
+ | FunctionType
913
+ | BuiltinFunctionType
914
+ | MethodType
915
+ | ModuleType
916
+ | WrapperDescriptorType
917
+ | MethodWrapperType
918
+ | MethodDescriptorType
919
+ )
920
+
921
+ if sys.version_info >= (3, 9):
922
+ def get_type_hints(
923
+ obj: _get_type_hints_obj_allowed_types,
924
+ globalns: dict[str, Any] | None = None,
925
+ localns: Mapping[str, Any] | None = None,
926
+ include_extras: bool = False,
927
+ ) -> dict[str, Any]: ...
928
+
929
+ else:
930
+ def get_type_hints(
931
+ obj: _get_type_hints_obj_allowed_types, globalns: dict[str, Any] | None = None, localns: Mapping[str, Any] | None = None
932
+ ) -> dict[str, Any]: ...
933
+
934
+ def get_args(tp: Any) -> tuple[Any, ...]: ...
935
+
936
+ if sys.version_info >= (3, 10):
937
+ @overload
938
+ def get_origin(tp: ParamSpecArgs | ParamSpecKwargs) -> ParamSpec: ...
939
+ @overload
940
+ def get_origin(tp: UnionType) -> type[UnionType]: ...
941
+
942
+ if sys.version_info >= (3, 9):
943
+ @overload
944
+ def get_origin(tp: GenericAlias) -> type: ...
945
+ @overload
946
+ def get_origin(tp: Any) -> Any | None: ...
947
+
948
+ else:
949
+ def get_origin(tp: Any) -> Any | None: ...
950
+
951
+ @overload
952
+ def cast(typ: type[_T], val: Any) -> _T: ...
953
+ @overload
954
+ def cast(typ: str, val: Any) -> Any: ...
955
+ @overload
956
+ def cast(typ: object, val: Any) -> Any: ...
957
+
958
+ if sys.version_info >= (3, 11):
959
+ def reveal_type(obj: _T, /) -> _T: ...
960
+ def assert_never(arg: Never, /) -> Never: ...
961
+ def assert_type(val: _T, typ: Any, /) -> _T: ...
962
+ def clear_overloads() -> None: ...
963
+ def get_overloads(func: Callable[..., object]) -> Sequence[Callable[..., object]]: ...
964
+ def dataclass_transform(
965
+ *,
966
+ eq_default: bool = True,
967
+ order_default: bool = False,
968
+ kw_only_default: bool = False,
969
+ frozen_default: bool = False, # on 3.11, runtime accepts it as part of kwargs
970
+ field_specifiers: tuple[type[Any] | Callable[..., Any], ...] = (),
971
+ **kwargs: Any,
972
+ ) -> IdentityFunction: ...
973
+
974
+ # Type constructors
975
+
976
+ class NamedTuple(tuple[Any, ...]):
977
+ if sys.version_info < (3, 9):
978
+ _field_types: ClassVar[dict[str, type]]
979
+ _field_defaults: ClassVar[dict[str, Any]]
980
+ _fields: ClassVar[tuple[str, ...]]
981
+ # __orig_bases__ sometimes exists on <3.12, but not consistently
982
+ # So we only add it to the stub on 3.12+.
983
+ if sys.version_info >= (3, 12):
984
+ __orig_bases__: ClassVar[tuple[Any, ...]]
985
+
986
+ @overload
987
+ def __init__(self, typename: str, fields: Iterable[tuple[str, Any]], /) -> None:
988
+ """Initialize self. See help(type(self)) for accurate signature."""
989
+ ...
990
+ @overload
991
+ @typing_extensions.deprecated(
992
+ "Creating a typing.NamedTuple using keyword arguments is deprecated and support will be removed in Python 3.15"
993
+ )
994
+ def __init__(self, typename: str, fields: None = None, /, **kwargs: Any) -> None:
995
+ """Initialize self. See help(type(self)) for accurate signature."""
996
+ ...
997
+ @classmethod
998
+ def _make(cls, iterable: Iterable[Any]) -> typing_extensions.Self: ...
999
+ def _asdict(self) -> dict[str, Any]: ...
1000
+ def _replace(self, **kwargs: Any) -> typing_extensions.Self: ...
1001
+ if sys.version_info >= (3, 13):
1002
+ def __replace__(self, **kwargs: Any) -> typing_extensions.Self: ...
1003
+
1004
+ # Internal mypy fallback type for all typed dicts (does not exist at runtime)
1005
+ # N.B. Keep this mostly in sync with typing_extensions._TypedDict/mypy_extensions._TypedDict
1006
+ @type_check_only
1007
+ class _TypedDict(Mapping[str, object], metaclass=ABCMeta):
1008
+ __total__: ClassVar[bool]
1009
+ if sys.version_info >= (3, 9):
1010
+ __required_keys__: ClassVar[frozenset[str]]
1011
+ __optional_keys__: ClassVar[frozenset[str]]
1012
+ # __orig_bases__ sometimes exists on <3.12, but not consistently,
1013
+ # so we only add it to the stub on 3.12+
1014
+ if sys.version_info >= (3, 12):
1015
+ __orig_bases__: ClassVar[tuple[Any, ...]]
1016
+
1017
+ def copy(self) -> typing_extensions.Self: ...
1018
+ # Using Never so that only calls using mypy plugin hook that specialize the signature
1019
+ # can go through.
1020
+ def setdefault(self, k: _Never, default: object) -> object: ...
1021
+ # Mypy plugin hook for 'pop' expects that 'default' has a type variable type.
1022
+ def pop(self, k: _Never, default: _T = ...) -> object: ... # pyright: ignore[reportInvalidTypeVarUse]
1023
+ def update(self: _T, m: _T, /) -> None: ...
1024
+ def __delitem__(self, k: _Never) -> None: ...
1025
+ def items(self) -> dict_items[str, object]: ...
1026
+ def keys(self) -> dict_keys[str, object]: ...
1027
+ def values(self) -> dict_values[str, object]: ...
1028
+ if sys.version_info >= (3, 9):
1029
+ @overload
1030
+ def __or__(self, value: typing_extensions.Self, /) -> typing_extensions.Self:
1031
+ """Return self|value."""
1032
+ ...
1033
+ @overload
1034
+ def __or__(self, value: dict[str, Any], /) -> dict[str, object]:
1035
+ """Return self|value."""
1036
+ ...
1037
+ @overload
1038
+ def __ror__(self, value: typing_extensions.Self, /) -> typing_extensions.Self:
1039
+ """Return value|self."""
1040
+ ...
1041
+ @overload
1042
+ def __ror__(self, value: dict[str, Any], /) -> dict[str, object]:
1043
+ """Return value|self."""
1044
+ ...
1045
+ # supposedly incompatible definitions of __or__ and __ior__
1046
+ def __ior__(self, value: typing_extensions.Self, /) -> typing_extensions.Self: ... # type: ignore[misc]
1047
+
1048
+ @final
1049
+ class ForwardRef(_Final):
1050
+ __forward_arg__: str
1051
+ __forward_code__: CodeType
1052
+ __forward_evaluated__: bool
1053
+ __forward_value__: Any | None
1054
+ __forward_is_argument__: bool
1055
+ __forward_is_class__: bool
1056
+ __forward_module__: Any | None
1057
+ if sys.version_info >= (3, 9):
1058
+ # The module and is_class arguments were added in later Python 3.9 versions.
1059
+ def __init__(self, arg: str, is_argument: bool = True, module: Any | None = None, *, is_class: bool = False) -> None: ...
1060
+ else:
1061
+ def __init__(self, arg: str, is_argument: bool = True) -> None: ...
1062
+
1063
+ if sys.version_info >= (3, 13):
1064
+ @overload
1065
+ @deprecated(
1066
+ "Failing to pass a value to the 'type_params' parameter of ForwardRef._evaluate() is deprecated, "
1067
+ "as it leads to incorrect behaviour when evaluating a stringified annotation "
1068
+ "that references a PEP 695 type parameter. It will be disallowed in Python 3.15."
1069
+ )
1070
+ def _evaluate(
1071
+ self, globalns: dict[str, Any] | None, localns: Mapping[str, Any] | None, *, recursive_guard: frozenset[str]
1072
+ ) -> Any | None: ...
1073
+ @overload
1074
+ def _evaluate(
1075
+ self,
1076
+ globalns: dict[str, Any] | None,
1077
+ localns: Mapping[str, Any] | None,
1078
+ type_params: tuple[TypeVar | ParamSpec | TypeVarTuple, ...],
1079
+ *,
1080
+ recursive_guard: frozenset[str],
1081
+ ) -> Any | None: ...
1082
+ elif sys.version_info >= (3, 12):
1083
+ def _evaluate(
1084
+ self,
1085
+ globalns: dict[str, Any] | None,
1086
+ localns: Mapping[str, Any] | None,
1087
+ type_params: tuple[TypeVar | ParamSpec | TypeVarTuple, ...] | None = None,
1088
+ *,
1089
+ recursive_guard: frozenset[str],
1090
+ ) -> Any | None: ...
1091
+ elif sys.version_info >= (3, 9):
1092
+ def _evaluate(
1093
+ self, globalns: dict[str, Any] | None, localns: Mapping[str, Any] | None, recursive_guard: frozenset[str]
1094
+ ) -> Any | None: ...
1095
+ else:
1096
+ def _evaluate(self, globalns: dict[str, Any] | None, localns: Mapping[str, Any] | None) -> Any | None: ...
1097
+
1098
+ def __eq__(self, other: object) -> bool: ...
1099
+ def __hash__(self) -> int: ...
1100
+ if sys.version_info >= (3, 11):
1101
+ def __or__(self, other: Any) -> _SpecialForm: ...
1102
+ def __ror__(self, other: Any) -> _SpecialForm: ...
1103
+
1104
+ if sys.version_info >= (3, 10):
1105
+ def is_typeddict(tp: object) -> bool: ...
1106
+
1107
+ def _type_repr(obj: object) -> str: ...
1108
+
1109
+ if sys.version_info >= (3, 12):
1110
+ def override(method: _F, /) -> _F: ...
1111
+ @final
1112
+ class TypeAliasType:
1113
+ def __init__(
1114
+ self, name: str, value: Any, *, type_params: tuple[TypeVar | ParamSpec | TypeVarTuple, ...] = ()
1115
+ ) -> None: ...
1116
+ @property
1117
+ def __value__(self) -> Any: ...
1118
+ @property
1119
+ def __type_params__(self) -> tuple[TypeVar | ParamSpec | TypeVarTuple, ...]: ...
1120
+ @property
1121
+ def __parameters__(self) -> tuple[Any, ...]: ...
1122
+ @property
1123
+ def __name__(self) -> str: ...
1124
+ # It's writable on types, but not on instances of TypeAliasType.
1125
+ @property
1126
+ def __module__(self) -> str | None: ... # type: ignore[override]
1127
+ def __getitem__(self, parameters: Any) -> GenericAlias:
1128
+ """Return self[key]."""
1129
+ ...
1130
+ def __or__(self, right: Any) -> _SpecialForm:
1131
+ """Return self|value."""
1132
+ ...
1133
+ def __ror__(self, left: Any) -> _SpecialForm:
1134
+ """Return value|self."""
1135
+ ...
1136
+
1137
+ if sys.version_info >= (3, 13):
1138
+ def is_protocol(tp: type, /) -> bool: ...
1139
+ def get_protocol_members(tp: type, /) -> frozenset[str]: ...
1140
+ @final
1141
+ class _NoDefaultType: ...
1142
+
1143
+ NoDefault: _NoDefaultType
1144
+ TypeIs: _SpecialForm
1145
+ ReadOnly: _SpecialForm