@gnost-cli/darwin-arm64 0.0.1 → 0.5.1-rc.2

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 (1407) hide show
  1. package/README.md +1 -1
  2. package/bundle/_internal/6ec57f84c680d3a3778b__mypyc.cpython-312-darwin.so +4 -0
  3. package/bundle/_internal/Python +0 -0
  4. package/bundle/_internal/Python.framework/Python +0 -0
  5. package/bundle/_internal/Python.framework/Resources/Info.plist +30 -0
  6. package/bundle/_internal/Python.framework/Versions/3.12/Python +0 -0
  7. package/bundle/_internal/Python.framework/Versions/3.12/Resources/Info.plist +30 -0
  8. package/bundle/_internal/Python.framework/Versions/Current/Python +0 -0
  9. package/bundle/_internal/Python.framework/Versions/Current/Resources/Info.plist +30 -0
  10. package/bundle/_internal/ast_serialize/ast_serialize.abi3.so +0 -0
  11. package/bundle/_internal/bandit/__init__.py +20 -0
  12. package/bundle/_internal/bandit/__main__.py +17 -0
  13. package/bundle/_internal/bandit/blacklists/__init__.py +0 -0
  14. package/bundle/_internal/bandit/blacklists/calls.py +670 -0
  15. package/bundle/_internal/bandit/blacklists/imports.py +425 -0
  16. package/bundle/_internal/bandit/blacklists/utils.py +17 -0
  17. package/bundle/_internal/bandit/cli/__init__.py +0 -0
  18. package/bundle/_internal/bandit/cli/baseline.py +252 -0
  19. package/bundle/_internal/bandit/cli/config_generator.py +207 -0
  20. package/bundle/_internal/bandit/cli/main.py +701 -0
  21. package/bundle/_internal/bandit/core/__init__.py +15 -0
  22. package/bundle/_internal/bandit/core/blacklisting.py +72 -0
  23. package/bundle/_internal/bandit/core/config.py +271 -0
  24. package/bundle/_internal/bandit/core/constants.py +40 -0
  25. package/bundle/_internal/bandit/core/context.py +316 -0
  26. package/bundle/_internal/bandit/core/docs_utils.py +54 -0
  27. package/bundle/_internal/bandit/core/extension_loader.py +114 -0
  28. package/bundle/_internal/bandit/core/issue.py +245 -0
  29. package/bundle/_internal/bandit/core/manager.py +499 -0
  30. package/bundle/_internal/bandit/core/meta_ast.py +44 -0
  31. package/bundle/_internal/bandit/core/metrics.py +106 -0
  32. package/bundle/_internal/bandit/core/node_visitor.py +297 -0
  33. package/bundle/_internal/bandit/core/test_properties.py +83 -0
  34. package/bundle/_internal/bandit/core/test_set.py +114 -0
  35. package/bundle/_internal/bandit/core/tester.py +168 -0
  36. package/bundle/_internal/bandit/core/utils.py +398 -0
  37. package/bundle/_internal/bandit/formatters/__init__.py +0 -0
  38. package/bundle/_internal/bandit/formatters/csv.py +82 -0
  39. package/bundle/_internal/bandit/formatters/custom.py +161 -0
  40. package/bundle/_internal/bandit/formatters/html.py +394 -0
  41. package/bundle/_internal/bandit/formatters/json.py +155 -0
  42. package/bundle/_internal/bandit/formatters/sarif.py +374 -0
  43. package/bundle/_internal/bandit/formatters/screen.py +244 -0
  44. package/bundle/_internal/bandit/formatters/text.py +200 -0
  45. package/bundle/_internal/bandit/formatters/utils.py +14 -0
  46. package/bundle/_internal/bandit/formatters/xml.py +97 -0
  47. package/bundle/_internal/bandit/formatters/yaml.py +126 -0
  48. package/bundle/_internal/bandit/plugins/__init__.py +0 -0
  49. package/bundle/_internal/bandit/plugins/app_debug.py +63 -0
  50. package/bundle/_internal/bandit/plugins/asserts.py +83 -0
  51. package/bundle/_internal/bandit/plugins/crypto_request_no_cert_validation.py +75 -0
  52. package/bundle/_internal/bandit/plugins/django_sql_injection.py +155 -0
  53. package/bundle/_internal/bandit/plugins/django_xss.py +287 -0
  54. package/bundle/_internal/bandit/plugins/exec.py +55 -0
  55. package/bundle/_internal/bandit/plugins/general_bad_file_permissions.py +99 -0
  56. package/bundle/_internal/bandit/plugins/general_bind_all_interfaces.py +52 -0
  57. package/bundle/_internal/bandit/plugins/general_hardcoded_password.py +282 -0
  58. package/bundle/_internal/bandit/plugins/general_hardcoded_tmp.py +79 -0
  59. package/bundle/_internal/bandit/plugins/hashlib_insecure_functions.py +121 -0
  60. package/bundle/_internal/bandit/plugins/huggingface_unsafe_download.py +166 -0
  61. package/bundle/_internal/bandit/plugins/injection_paramiko.py +63 -0
  62. package/bundle/_internal/bandit/plugins/injection_shell.py +706 -0
  63. package/bundle/_internal/bandit/plugins/injection_sql.py +143 -0
  64. package/bundle/_internal/bandit/plugins/injection_wildcard.py +144 -0
  65. package/bundle/_internal/bandit/plugins/insecure_ssl_tls.py +285 -0
  66. package/bundle/_internal/bandit/plugins/jinja2_templates.py +134 -0
  67. package/bundle/_internal/bandit/plugins/logging_config_insecure_listen.py +58 -0
  68. package/bundle/_internal/bandit/plugins/mako_templates.py +69 -0
  69. package/bundle/_internal/bandit/plugins/markupsafe_markup_xss.py +118 -0
  70. package/bundle/_internal/bandit/plugins/pytorch_load.py +77 -0
  71. package/bundle/_internal/bandit/plugins/request_without_timeout.py +84 -0
  72. package/bundle/_internal/bandit/plugins/snmp_security_check.py +110 -0
  73. package/bundle/_internal/bandit/plugins/ssh_no_host_key_verification.py +76 -0
  74. package/bundle/_internal/bandit/plugins/tarfile_unsafe_members.py +121 -0
  75. package/bundle/_internal/bandit/plugins/trojansource.py +82 -0
  76. package/bundle/_internal/bandit/plugins/try_except_continue.py +108 -0
  77. package/bundle/_internal/bandit/plugins/try_except_pass.py +106 -0
  78. package/bundle/_internal/bandit/plugins/weak_cryptographic_key.py +165 -0
  79. package/bundle/_internal/bandit/plugins/yaml_load.py +76 -0
  80. package/bundle/_internal/bandit-1.9.4.dist-info/INSTALLER +1 -0
  81. package/bundle/_internal/bandit-1.9.4.dist-info/METADATA +212 -0
  82. package/bundle/_internal/bandit-1.9.4.dist-info/RECORD +150 -0
  83. package/bundle/_internal/bandit-1.9.4.dist-info/WHEEL +5 -0
  84. package/bundle/_internal/bandit-1.9.4.dist-info/entry_points.txt +63 -0
  85. package/bundle/_internal/bandit-1.9.4.dist-info/licenses/LICENSE +175 -0
  86. package/bundle/_internal/bandit-1.9.4.dist-info/pbr.json +1 -0
  87. package/bundle/_internal/bandit-1.9.4.dist-info/top_level.txt +1 -0
  88. package/bundle/_internal/base_library.zip +0 -0
  89. package/bundle/_internal/bin/ruff +0 -0
  90. package/bundle/_internal/gnost/__init__.py +1 -0
  91. package/bundle/_internal/gnost/analysis/__init__.py +0 -0
  92. package/bundle/_internal/gnost/analysis/analyzers/__init__.py +11 -0
  93. package/bundle/_internal/gnost/analysis/analyzers/maintainability_analyzer.py +901 -0
  94. package/bundle/_internal/gnost/analysis/analyzers/observability_analyzer.py +592 -0
  95. package/bundle/_internal/gnost/analysis/analyzers/readability_analyzer.py +968 -0
  96. package/bundle/_internal/gnost/analysis/analyzers/robustness_analyzer.py +944 -0
  97. package/bundle/_internal/gnost/analysis/config/mypy.ini +4 -0
  98. package/bundle/_internal/gnost/analysis/core/__init__.py +0 -0
  99. package/bundle/_internal/gnost/analysis/core/aggregator.py +584 -0
  100. package/bundle/_internal/gnost/analysis/core/engine.py +430 -0
  101. package/bundle/_internal/gnost/analysis/core/file_utils.py +209 -0
  102. package/bundle/_internal/gnost/analysis/core/interfaces.py +304 -0
  103. package/bundle/_internal/gnost/analysis/core/models.py +479 -0
  104. package/bundle/_internal/gnost/analysis/core/tool_runner.py +153 -0
  105. package/bundle/_internal/gnost/analysis/core/transformers.py +779 -0
  106. package/bundle/_internal/gnost/analysis/utils/__init__.py +0 -0
  107. package/bundle/_internal/gnost/analysis/utils/analyze.py +132 -0
  108. package/bundle/_internal/gnost/analysis/utils/df_handling.py +215 -0
  109. package/bundle/_internal/gnost/analysis/utils/duplicate_code.py +42 -0
  110. package/bundle/_internal/gnost/analysis/utils/extract.py +172 -0
  111. package/bundle/_internal/gnost/analysis/utils/mi.py +130 -0
  112. package/bundle/_internal/gnost/analysis/utils/tool_command.py +63 -0
  113. package/bundle/_internal/gnost/cli/__init__.py +3 -0
  114. package/bundle/_internal/gnost/cli/app.py +696 -0
  115. package/bundle/_internal/gnost/cli/commands/__init__.py +3 -0
  116. package/bundle/_internal/gnost/cli/commands/analysis.py +190 -0
  117. package/bundle/_internal/gnost/cli/commands/onboard.py +507 -0
  118. package/bundle/_internal/gnost/cli/commands/show.py +70 -0
  119. package/bundle/_internal/gnost/config/__init__.py +0 -0
  120. package/bundle/_internal/gnost/config/languages.py +10 -0
  121. package/bundle/_internal/gnost/config/settings.py +240 -0
  122. package/bundle/_internal/gnost/core/__init__.py +0 -0
  123. package/bundle/_internal/gnost/core/callgraph.py +399 -0
  124. package/bundle/_internal/gnost/core/caution.py +315 -0
  125. package/bundle/_internal/gnost/core/cycles.py +148 -0
  126. package/bundle/_internal/gnost/core/flow.py +204 -0
  127. package/bundle/_internal/gnost/core/graph.py +108 -0
  128. package/bundle/_internal/gnost/core/insight_builder.py +164 -0
  129. package/bundle/_internal/gnost/core/ranker.py +119 -0
  130. package/bundle/_internal/gnost/core/resolver.py +304 -0
  131. package/bundle/_internal/gnost/languages/base.py +108 -0
  132. package/bundle/_internal/gnost/languages/java.py +104 -0
  133. package/bundle/_internal/gnost/languages/javascript.py +153 -0
  134. package/bundle/_internal/gnost/languages/manifests.py +45 -0
  135. package/bundle/_internal/gnost/languages/python.py +318 -0
  136. package/bundle/_internal/gnost/languages/typescript.py +6 -0
  137. package/bundle/_internal/gnost/models/__init__.py +0 -0
  138. package/bundle/_internal/gnost/models/insights.py +68 -0
  139. package/bundle/_internal/gnost/reporters/__init__.py +3 -0
  140. package/bundle/_internal/gnost/reporters/analysis_html.py +1292 -0
  141. package/bundle/_internal/gnost/reporters/diagram_viewer.py +153 -0
  142. package/bundle/_internal/gnost/reporters/files.py +18 -0
  143. package/bundle/_internal/gnost/reporters/folders.py +18 -0
  144. package/bundle/_internal/gnost/reporters/insights_json.py +189 -0
  145. package/bundle/_internal/gnost/reporters/loc_summary.py +19 -0
  146. package/bundle/_internal/gnost/reporters/markdown.py +372 -0
  147. package/bundle/_internal/gnost/reporters/mermaid.py +543 -0
  148. package/bundle/_internal/gnost/reporters/mermaid_graph.py +309 -0
  149. package/bundle/_internal/gnost/reporters/readme.py +81 -0
  150. package/bundle/_internal/gnost/reporters/stats.py +13 -0
  151. package/bundle/_internal/gnost/reporters/summary.py +223 -0
  152. package/bundle/_internal/gnost/reporters/templates/analyzer_guides.json +247 -0
  153. package/bundle/_internal/gnost/reporters/templates/analyzer_guides_layout.html +9 -0
  154. package/bundle/_internal/gnost/reporters/templates/graph_viewer.html +427 -0
  155. package/bundle/_internal/gnost/reporters/vendor/THIRD_PARTY_NOTICES.md +205 -0
  156. package/bundle/_internal/gnost/reporters/vendor/cose-base.js +3214 -0
  157. package/bundle/_internal/gnost/reporters/vendor/cytoscape-fcose.js +1549 -0
  158. package/bundle/_internal/gnost/reporters/vendor/cytoscape.min.js +32 -0
  159. package/bundle/_internal/gnost/reporters/vendor/layout-base.js +5230 -0
  160. package/bundle/_internal/gnost/reporters/vendor/marked.min.js +6 -0
  161. package/bundle/_internal/gnost/reporters/vendor/mermaid.min.js +2314 -0
  162. package/bundle/_internal/gnost/reporters/vendor/svg-pan-zoom.min.js +3 -0
  163. package/bundle/_internal/gnost/reporters/vendor/vendor.json +44 -0
  164. package/bundle/_internal/gnost/routes/__init__.py +45 -0
  165. package/bundle/_internal/gnost/routes/java.py +72 -0
  166. package/bundle/_internal/gnost/routes/javascript.py +275 -0
  167. package/bundle/_internal/gnost/routes/models.py +58 -0
  168. package/bundle/_internal/gnost/routes/python.py +429 -0
  169. package/bundle/_internal/gnost/scanner/__init__.py +4 -0
  170. package/bundle/_internal/gnost/scanner/classify.py +13 -0
  171. package/bundle/_internal/gnost/scanner/engine.py +169 -0
  172. package/bundle/_internal/gnost/scanner/filters.py +197 -0
  173. package/bundle/_internal/gnost/scanner/loc.py +93 -0
  174. package/bundle/_internal/gnost/scanner/models.py +27 -0
  175. package/bundle/_internal/gnost/schemas/insights.schema.json +517 -0
  176. package/bundle/_internal/gnost/utils/__init__.py +0 -0
  177. package/bundle/_internal/gnost/utils/logger.py +85 -0
  178. package/bundle/_internal/gnost/utils/paths.py +29 -0
  179. package/bundle/_internal/gnost/utils/printer.py +46 -0
  180. package/bundle/_internal/gnost/utils/progress.py +20 -0
  181. package/bundle/_internal/gnost-0.5.1rc2.dist-info/INSTALLER +1 -0
  182. package/bundle/_internal/gnost-0.5.1rc2.dist-info/METADATA +130 -0
  183. package/bundle/_internal/gnost-0.5.1rc2.dist-info/RECORD +178 -0
  184. package/bundle/_internal/gnost-0.5.1rc2.dist-info/REQUESTED +0 -0
  185. package/bundle/_internal/gnost-0.5.1rc2.dist-info/WHEEL +5 -0
  186. package/bundle/_internal/gnost-0.5.1rc2.dist-info/direct_url.json +1 -0
  187. package/bundle/_internal/gnost-0.5.1rc2.dist-info/entry_points.txt +2 -0
  188. package/bundle/_internal/gnost-0.5.1rc2.dist-info/licenses/LICENSE +21 -0
  189. package/bundle/_internal/gnost-0.5.1rc2.dist-info/top_level.txt +1 -0
  190. package/bundle/_internal/libcrypto.3.dylib +0 -0
  191. package/bundle/_internal/libncurses.6.dylib +0 -0
  192. package/bundle/_internal/librt/base64.cpython-312-darwin.so +0 -0
  193. package/bundle/_internal/librt/internal.cpython-312-darwin.so +0 -0
  194. package/bundle/_internal/libssl.3.dylib +0 -0
  195. package/bundle/_internal/mypy/__init__.cpython-312-darwin.so +0 -0
  196. package/bundle/_internal/mypy/__init__.py +1 -0
  197. package/bundle/_internal/mypy/__main__.py +52 -0
  198. package/bundle/_internal/mypy/api.cpython-312-darwin.so +0 -0
  199. package/bundle/_internal/mypy/api.py +95 -0
  200. package/bundle/_internal/mypy/applytype.cpython-312-darwin.so +0 -0
  201. package/bundle/_internal/mypy/applytype.py +317 -0
  202. package/bundle/_internal/mypy/argmap.cpython-312-darwin.so +0 -0
  203. package/bundle/_internal/mypy/argmap.py +269 -0
  204. package/bundle/_internal/mypy/binder.cpython-312-darwin.so +0 -0
  205. package/bundle/_internal/mypy/binder.py +710 -0
  206. package/bundle/_internal/mypy/bogus_type.py +27 -0
  207. package/bundle/_internal/mypy/build.cpython-312-darwin.so +0 -0
  208. package/bundle/_internal/mypy/build.py +5533 -0
  209. package/bundle/_internal/mypy/build_worker/__init__.cpython-312-darwin.so +0 -0
  210. package/bundle/_internal/mypy/build_worker/__init__.py +0 -0
  211. package/bundle/_internal/mypy/build_worker/__main__.py +6 -0
  212. package/bundle/_internal/mypy/build_worker/worker.cpython-312-darwin.so +0 -0
  213. package/bundle/_internal/mypy/build_worker/worker.py +379 -0
  214. package/bundle/_internal/mypy/cache.cpython-312-darwin.so +0 -0
  215. package/bundle/_internal/mypy/cache.py +626 -0
  216. package/bundle/_internal/mypy/checker.cpython-312-darwin.so +0 -0
  217. package/bundle/_internal/mypy/checker.py +10110 -0
  218. package/bundle/_internal/mypy/checker_shared.cpython-312-darwin.so +0 -0
  219. package/bundle/_internal/mypy/checker_shared.py +377 -0
  220. package/bundle/_internal/mypy/checker_state.cpython-312-darwin.so +0 -0
  221. package/bundle/_internal/mypy/checker_state.py +30 -0
  222. package/bundle/_internal/mypy/checkexpr.cpython-312-darwin.so +0 -0
  223. package/bundle/_internal/mypy/checkexpr.py +7018 -0
  224. package/bundle/_internal/mypy/checkmember.cpython-312-darwin.so +0 -0
  225. package/bundle/_internal/mypy/checkmember.py +1593 -0
  226. package/bundle/_internal/mypy/checkpattern.cpython-312-darwin.so +0 -0
  227. package/bundle/_internal/mypy/checkpattern.py +883 -0
  228. package/bundle/_internal/mypy/checkstrformat.cpython-312-darwin.so +0 -0
  229. package/bundle/_internal/mypy/checkstrformat.py +1103 -0
  230. package/bundle/_internal/mypy/config_parser.cpython-312-darwin.so +0 -0
  231. package/bundle/_internal/mypy/config_parser.py +749 -0
  232. package/bundle/_internal/mypy/constant_fold.cpython-312-darwin.so +0 -0
  233. package/bundle/_internal/mypy/constant_fold.py +187 -0
  234. package/bundle/_internal/mypy/constraints.cpython-312-darwin.so +0 -0
  235. package/bundle/_internal/mypy/constraints.py +1748 -0
  236. package/bundle/_internal/mypy/copytype.cpython-312-darwin.so +0 -0
  237. package/bundle/_internal/mypy/copytype.py +137 -0
  238. package/bundle/_internal/mypy/defaults.cpython-312-darwin.so +0 -0
  239. package/bundle/_internal/mypy/defaults.py +67 -0
  240. package/bundle/_internal/mypy/dmypy/__init__.cpython-312-darwin.so +0 -0
  241. package/bundle/_internal/mypy/dmypy/__init__.py +0 -0
  242. package/bundle/_internal/mypy/dmypy/__main__.py +6 -0
  243. package/bundle/_internal/mypy/dmypy/client.cpython-312-darwin.so +0 -0
  244. package/bundle/_internal/mypy/dmypy/client.py +732 -0
  245. package/bundle/_internal/mypy/dmypy_os.cpython-312-darwin.so +0 -0
  246. package/bundle/_internal/mypy/dmypy_os.py +43 -0
  247. package/bundle/_internal/mypy/dmypy_server.cpython-312-darwin.so +0 -0
  248. package/bundle/_internal/mypy/dmypy_server.py +1132 -0
  249. package/bundle/_internal/mypy/dmypy_util.cpython-312-darwin.so +0 -0
  250. package/bundle/_internal/mypy/dmypy_util.py +117 -0
  251. package/bundle/_internal/mypy/erasetype.cpython-312-darwin.so +0 -0
  252. package/bundle/_internal/mypy/erasetype.py +301 -0
  253. package/bundle/_internal/mypy/error_formatter.cpython-312-darwin.so +0 -0
  254. package/bundle/_internal/mypy/error_formatter.py +39 -0
  255. package/bundle/_internal/mypy/errorcodes.cpython-312-darwin.so +0 -0
  256. package/bundle/_internal/mypy/errorcodes.py +340 -0
  257. package/bundle/_internal/mypy/errors.cpython-312-darwin.so +0 -0
  258. package/bundle/_internal/mypy/errors.py +1468 -0
  259. package/bundle/_internal/mypy/evalexpr.cpython-312-darwin.so +0 -0
  260. package/bundle/_internal/mypy/evalexpr.py +211 -0
  261. package/bundle/_internal/mypy/expandtype.cpython-312-darwin.so +0 -0
  262. package/bundle/_internal/mypy/expandtype.py +662 -0
  263. package/bundle/_internal/mypy/exportjson.py +616 -0
  264. package/bundle/_internal/mypy/exprtotype.cpython-312-darwin.so +0 -0
  265. package/bundle/_internal/mypy/exprtotype.py +285 -0
  266. package/bundle/_internal/mypy/fastparse.cpython-312-darwin.so +0 -0
  267. package/bundle/_internal/mypy/fastparse.py +2267 -0
  268. package/bundle/_internal/mypy/find_sources.cpython-312-darwin.so +0 -0
  269. package/bundle/_internal/mypy/find_sources.py +257 -0
  270. package/bundle/_internal/mypy/fixup.cpython-312-darwin.so +0 -0
  271. package/bundle/_internal/mypy/fixup.py +438 -0
  272. package/bundle/_internal/mypy/freetree.cpython-312-darwin.so +0 -0
  273. package/bundle/_internal/mypy/freetree.py +23 -0
  274. package/bundle/_internal/mypy/fscache.cpython-312-darwin.so +0 -0
  275. package/bundle/_internal/mypy/fscache.py +312 -0
  276. package/bundle/_internal/mypy/fswatcher.cpython-312-darwin.so +0 -0
  277. package/bundle/_internal/mypy/fswatcher.py +106 -0
  278. package/bundle/_internal/mypy/gclogger.cpython-312-darwin.so +0 -0
  279. package/bundle/_internal/mypy/gclogger.py +48 -0
  280. package/bundle/_internal/mypy/git.cpython-312-darwin.so +0 -0
  281. package/bundle/_internal/mypy/git.py +69 -0
  282. package/bundle/_internal/mypy/graph_utils.cpython-312-darwin.so +0 -0
  283. package/bundle/_internal/mypy/graph_utils.py +161 -0
  284. package/bundle/_internal/mypy/indirection.cpython-312-darwin.so +0 -0
  285. package/bundle/_internal/mypy/indirection.py +176 -0
  286. package/bundle/_internal/mypy/infer.cpython-312-darwin.so +0 -0
  287. package/bundle/_internal/mypy/infer.py +80 -0
  288. package/bundle/_internal/mypy/inspections.cpython-312-darwin.so +0 -0
  289. package/bundle/_internal/mypy/inspections.py +626 -0
  290. package/bundle/_internal/mypy/ipc.cpython-312-darwin.so +0 -0
  291. package/bundle/_internal/mypy/ipc.py +508 -0
  292. package/bundle/_internal/mypy/join.cpython-312-darwin.so +0 -0
  293. package/bundle/_internal/mypy/join.py +962 -0
  294. package/bundle/_internal/mypy/known_modules.cpython-312-darwin.so +0 -0
  295. package/bundle/_internal/mypy/known_modules.py +174 -0
  296. package/bundle/_internal/mypy/literals.cpython-312-darwin.so +0 -0
  297. package/bundle/_internal/mypy/literals.py +327 -0
  298. package/bundle/_internal/mypy/lookup.cpython-312-darwin.so +0 -0
  299. package/bundle/_internal/mypy/lookup.py +80 -0
  300. package/bundle/_internal/mypy/main.cpython-312-darwin.so +0 -0
  301. package/bundle/_internal/mypy/main.py +1793 -0
  302. package/bundle/_internal/mypy/maptype.cpython-312-darwin.so +0 -0
  303. package/bundle/_internal/mypy/maptype.py +109 -0
  304. package/bundle/_internal/mypy/meet.cpython-312-darwin.so +0 -0
  305. package/bundle/_internal/mypy/meet.py +1371 -0
  306. package/bundle/_internal/mypy/memprofile.cpython-312-darwin.so +0 -0
  307. package/bundle/_internal/mypy/memprofile.py +122 -0
  308. package/bundle/_internal/mypy/message_registry.cpython-312-darwin.so +0 -0
  309. package/bundle/_internal/mypy/message_registry.py +378 -0
  310. package/bundle/_internal/mypy/messages.cpython-312-darwin.so +0 -0
  311. package/bundle/_internal/mypy/messages.py +3535 -0
  312. package/bundle/_internal/mypy/metastore.cpython-312-darwin.so +0 -0
  313. package/bundle/_internal/mypy/metastore.py +278 -0
  314. package/bundle/_internal/mypy/mixedtraverser.cpython-312-darwin.so +0 -0
  315. package/bundle/_internal/mypy/mixedtraverser.py +147 -0
  316. package/bundle/_internal/mypy/modulefinder.cpython-312-darwin.so +0 -0
  317. package/bundle/_internal/mypy/modulefinder.py +1008 -0
  318. package/bundle/_internal/mypy/moduleinspect.cpython-312-darwin.so +0 -0
  319. package/bundle/_internal/mypy/moduleinspect.py +184 -0
  320. package/bundle/_internal/mypy/modules_state.cpython-312-darwin.so +0 -0
  321. package/bundle/_internal/mypy/modules_state.py +20 -0
  322. package/bundle/_internal/mypy/mro.cpython-312-darwin.so +0 -0
  323. package/bundle/_internal/mypy/mro.py +62 -0
  324. package/bundle/_internal/mypy/nativeparse.cpython-312-darwin.so +0 -0
  325. package/bundle/_internal/mypy/nativeparse.py +2199 -0
  326. package/bundle/_internal/mypy/nodes.cpython-312-darwin.so +0 -0
  327. package/bundle/_internal/mypy/nodes.py +5608 -0
  328. package/bundle/_internal/mypy/operators.cpython-312-darwin.so +0 -0
  329. package/bundle/_internal/mypy/operators.py +126 -0
  330. package/bundle/_internal/mypy/options.cpython-312-darwin.so +0 -0
  331. package/bundle/_internal/mypy/options.py +678 -0
  332. package/bundle/_internal/mypy/parse.cpython-312-darwin.so +0 -0
  333. package/bundle/_internal/mypy/parse.py +135 -0
  334. package/bundle/_internal/mypy/partially_defined.cpython-312-darwin.so +0 -0
  335. package/bundle/_internal/mypy/partially_defined.py +703 -0
  336. package/bundle/_internal/mypy/patterns.cpython-312-darwin.so +0 -0
  337. package/bundle/_internal/mypy/patterns.py +162 -0
  338. package/bundle/_internal/mypy/plugin.cpython-312-darwin.so +0 -0
  339. package/bundle/_internal/mypy/plugin.py +945 -0
  340. package/bundle/_internal/mypy/plugins/__init__.py +0 -0
  341. package/bundle/_internal/mypy/plugins/attrs.cpython-312-darwin.so +0 -0
  342. package/bundle/_internal/mypy/plugins/attrs.py +1179 -0
  343. package/bundle/_internal/mypy/plugins/common.cpython-312-darwin.so +0 -0
  344. package/bundle/_internal/mypy/plugins/common.py +441 -0
  345. package/bundle/_internal/mypy/plugins/constants.cpython-312-darwin.so +0 -0
  346. package/bundle/_internal/mypy/plugins/constants.py +20 -0
  347. package/bundle/_internal/mypy/plugins/ctypes.cpython-312-darwin.so +0 -0
  348. package/bundle/_internal/mypy/plugins/ctypes.py +245 -0
  349. package/bundle/_internal/mypy/plugins/dataclasses.cpython-312-darwin.so +0 -0
  350. package/bundle/_internal/mypy/plugins/dataclasses.py +1135 -0
  351. package/bundle/_internal/mypy/plugins/default.cpython-312-darwin.so +0 -0
  352. package/bundle/_internal/mypy/plugins/default.py +612 -0
  353. package/bundle/_internal/mypy/plugins/enums.cpython-312-darwin.so +0 -0
  354. package/bundle/_internal/mypy/plugins/enums.py +299 -0
  355. package/bundle/_internal/mypy/plugins/functools.cpython-312-darwin.so +0 -0
  356. package/bundle/_internal/mypy/plugins/functools.py +399 -0
  357. package/bundle/_internal/mypy/plugins/proper_plugin.cpython-312-darwin.so +0 -0
  358. package/bundle/_internal/mypy/plugins/proper_plugin.py +178 -0
  359. package/bundle/_internal/mypy/plugins/singledispatch.cpython-312-darwin.so +0 -0
  360. package/bundle/_internal/mypy/plugins/singledispatch.py +212 -0
  361. package/bundle/_internal/mypy/py.typed +1 -0
  362. package/bundle/_internal/mypy/pyinfo.py +79 -0
  363. package/bundle/_internal/mypy/reachability.cpython-312-darwin.so +0 -0
  364. package/bundle/_internal/mypy/reachability.py +388 -0
  365. package/bundle/_internal/mypy/refinfo.cpython-312-darwin.so +0 -0
  366. package/bundle/_internal/mypy/refinfo.py +92 -0
  367. package/bundle/_internal/mypy/renaming.cpython-312-darwin.so +0 -0
  368. package/bundle/_internal/mypy/renaming.py +583 -0
  369. package/bundle/_internal/mypy/report.cpython-312-darwin.so +0 -0
  370. package/bundle/_internal/mypy/report.py +930 -0
  371. package/bundle/_internal/mypy/scope.cpython-312-darwin.so +0 -0
  372. package/bundle/_internal/mypy/scope.py +125 -0
  373. package/bundle/_internal/mypy/semanal.cpython-312-darwin.so +0 -0
  374. package/bundle/_internal/mypy/semanal.py +8674 -0
  375. package/bundle/_internal/mypy/semanal_classprop.cpython-312-darwin.so +0 -0
  376. package/bundle/_internal/mypy/semanal_classprop.py +188 -0
  377. package/bundle/_internal/mypy/semanal_enum.cpython-312-darwin.so +0 -0
  378. package/bundle/_internal/mypy/semanal_enum.py +259 -0
  379. package/bundle/_internal/mypy/semanal_infer.cpython-312-darwin.so +0 -0
  380. package/bundle/_internal/mypy/semanal_infer.py +135 -0
  381. package/bundle/_internal/mypy/semanal_main.cpython-312-darwin.so +0 -0
  382. package/bundle/_internal/mypy/semanal_main.py +542 -0
  383. package/bundle/_internal/mypy/semanal_namedtuple.cpython-312-darwin.so +0 -0
  384. package/bundle/_internal/mypy/semanal_namedtuple.py +679 -0
  385. package/bundle/_internal/mypy/semanal_newtype.cpython-312-darwin.so +0 -0
  386. package/bundle/_internal/mypy/semanal_newtype.py +272 -0
  387. package/bundle/_internal/mypy/semanal_pass1.cpython-312-darwin.so +0 -0
  388. package/bundle/_internal/mypy/semanal_pass1.py +159 -0
  389. package/bundle/_internal/mypy/semanal_shared.cpython-312-darwin.so +0 -0
  390. package/bundle/_internal/mypy/semanal_shared.py +499 -0
  391. package/bundle/_internal/mypy/semanal_typeargs.cpython-312-darwin.so +0 -0
  392. package/bundle/_internal/mypy/semanal_typeargs.py +309 -0
  393. package/bundle/_internal/mypy/semanal_typeddict.cpython-312-darwin.so +0 -0
  394. package/bundle/_internal/mypy/semanal_typeddict.py +826 -0
  395. package/bundle/_internal/mypy/server/__init__.py +0 -0
  396. package/bundle/_internal/mypy/server/astdiff.cpython-312-darwin.so +0 -0
  397. package/bundle/_internal/mypy/server/astdiff.py +552 -0
  398. package/bundle/_internal/mypy/server/astmerge.cpython-312-darwin.so +0 -0
  399. package/bundle/_internal/mypy/server/astmerge.py +583 -0
  400. package/bundle/_internal/mypy/server/aststrip.cpython-312-darwin.so +0 -0
  401. package/bundle/_internal/mypy/server/aststrip.py +255 -0
  402. package/bundle/_internal/mypy/server/deps.cpython-312-darwin.so +0 -0
  403. package/bundle/_internal/mypy/server/deps.py +1153 -0
  404. package/bundle/_internal/mypy/server/mergecheck.cpython-312-darwin.so +0 -0
  405. package/bundle/_internal/mypy/server/mergecheck.py +84 -0
  406. package/bundle/_internal/mypy/server/objgraph.cpython-312-darwin.so +0 -0
  407. package/bundle/_internal/mypy/server/objgraph.py +101 -0
  408. package/bundle/_internal/mypy/server/subexpr.cpython-312-darwin.so +0 -0
  409. package/bundle/_internal/mypy/server/subexpr.py +208 -0
  410. package/bundle/_internal/mypy/server/target.cpython-312-darwin.so +0 -0
  411. package/bundle/_internal/mypy/server/target.py +11 -0
  412. package/bundle/_internal/mypy/server/trigger.cpython-312-darwin.so +0 -0
  413. package/bundle/_internal/mypy/server/trigger.py +26 -0
  414. package/bundle/_internal/mypy/server/update.cpython-312-darwin.so +0 -0
  415. package/bundle/_internal/mypy/server/update.py +1372 -0
  416. package/bundle/_internal/mypy/sharedparse.cpython-312-darwin.so +0 -0
  417. package/bundle/_internal/mypy/sharedparse.py +114 -0
  418. package/bundle/_internal/mypy/solve.cpython-312-darwin.so +0 -0
  419. package/bundle/_internal/mypy/solve.py +602 -0
  420. package/bundle/_internal/mypy/split_namespace.py +35 -0
  421. package/bundle/_internal/mypy/state.cpython-312-darwin.so +0 -0
  422. package/bundle/_internal/mypy/state.py +29 -0
  423. package/bundle/_internal/mypy/stats.cpython-312-darwin.so +0 -0
  424. package/bundle/_internal/mypy/stats.py +494 -0
  425. package/bundle/_internal/mypy/strconv.cpython-312-darwin.so +0 -0
  426. package/bundle/_internal/mypy/strconv.py +707 -0
  427. package/bundle/_internal/mypy/stubdoc.py +545 -0
  428. package/bundle/_internal/mypy/stubgen.cpython-312-darwin.so +0 -0
  429. package/bundle/_internal/mypy/stubgen.py +2064 -0
  430. package/bundle/_internal/mypy/stubgenc.py +1046 -0
  431. package/bundle/_internal/mypy/stubinfo.cpython-312-darwin.so +0 -0
  432. package/bundle/_internal/mypy/stubinfo.py +321 -0
  433. package/bundle/_internal/mypy/stubtest.py +2676 -0
  434. package/bundle/_internal/mypy/stubutil.cpython-312-darwin.so +0 -0
  435. package/bundle/_internal/mypy/stubutil.py +895 -0
  436. package/bundle/_internal/mypy/subtypes.cpython-312-darwin.so +0 -0
  437. package/bundle/_internal/mypy/subtypes.py +2572 -0
  438. package/bundle/_internal/mypy/suggestions.cpython-312-darwin.so +0 -0
  439. package/bundle/_internal/mypy/suggestions.py +1068 -0
  440. package/bundle/_internal/mypy/test/__init__.py +0 -0
  441. package/bundle/_internal/mypy/test/config.py +31 -0
  442. package/bundle/_internal/mypy/test/data.py +864 -0
  443. package/bundle/_internal/mypy/test/helpers.py +546 -0
  444. package/bundle/_internal/mypy/test/meta/__init__.py +0 -0
  445. package/bundle/_internal/mypy/test/meta/_pytest.py +72 -0
  446. package/bundle/_internal/mypy/test/meta/test_diff_helper.py +47 -0
  447. package/bundle/_internal/mypy/test/meta/test_parse_data.py +69 -0
  448. package/bundle/_internal/mypy/test/meta/test_update_data.py +131 -0
  449. package/bundle/_internal/mypy/test/test_config_parser.py +130 -0
  450. package/bundle/_internal/mypy/test/test_diff_cache.py +209 -0
  451. package/bundle/_internal/mypy/test/test_find_sources.py +376 -0
  452. package/bundle/_internal/mypy/test/test_nativeparse.py +306 -0
  453. package/bundle/_internal/mypy/test/test_ref_info.py +46 -0
  454. package/bundle/_internal/mypy/test/testapi.py +45 -0
  455. package/bundle/_internal/mypy/test/testargs.py +202 -0
  456. package/bundle/_internal/mypy/test/testcheck.py +360 -0
  457. package/bundle/_internal/mypy/test/testcmdline.py +162 -0
  458. package/bundle/_internal/mypy/test/testconstraints.py +134 -0
  459. package/bundle/_internal/mypy/test/testdaemon.py +132 -0
  460. package/bundle/_internal/mypy/test/testdeps.py +85 -0
  461. package/bundle/_internal/mypy/test/testdiff.py +70 -0
  462. package/bundle/_internal/mypy/test/testerrorstream.py +46 -0
  463. package/bundle/_internal/mypy/test/testexportjson.py +104 -0
  464. package/bundle/_internal/mypy/test/testfinegrained.py +453 -0
  465. package/bundle/_internal/mypy/test/testfinegrainedcache.py +18 -0
  466. package/bundle/_internal/mypy/test/testformatter.py +85 -0
  467. package/bundle/_internal/mypy/test/testfscache.py +100 -0
  468. package/bundle/_internal/mypy/test/testgraph.py +138 -0
  469. package/bundle/_internal/mypy/test/testinfer.py +373 -0
  470. package/bundle/_internal/mypy/test/testipc.py +154 -0
  471. package/bundle/_internal/mypy/test/testmerge.py +235 -0
  472. package/bundle/_internal/mypy/test/testmodulefinder.py +284 -0
  473. package/bundle/_internal/mypy/test/testmypyc.py +26 -0
  474. package/bundle/_internal/mypy/test/testoutput.py +64 -0
  475. package/bundle/_internal/mypy/test/testparse.py +131 -0
  476. package/bundle/_internal/mypy/test/testpep561.py +174 -0
  477. package/bundle/_internal/mypy/test/testpythoneval.py +116 -0
  478. package/bundle/_internal/mypy/test/testreports.py +59 -0
  479. package/bundle/_internal/mypy/test/testsemanal.py +219 -0
  480. package/bundle/_internal/mypy/test/testsolve.py +287 -0
  481. package/bundle/_internal/mypy/test/teststubgen.py +1650 -0
  482. package/bundle/_internal/mypy/test/teststubinfo.py +24 -0
  483. package/bundle/_internal/mypy/test/teststubtest.py +3417 -0
  484. package/bundle/_internal/mypy/test/testsubtypes.py +306 -0
  485. package/bundle/_internal/mypy/test/testtransform.py +64 -0
  486. package/bundle/_internal/mypy/test/testtypegen.py +83 -0
  487. package/bundle/_internal/mypy/test/testtypes.py +1666 -0
  488. package/bundle/_internal/mypy/test/testutil.py +111 -0
  489. package/bundle/_internal/mypy/test/typefixture.py +419 -0
  490. package/bundle/_internal/mypy/test/update_data.py +87 -0
  491. package/bundle/_internal/mypy/test/visitors.cpython-312-darwin.so +0 -0
  492. package/bundle/_internal/mypy/test/visitors.py +77 -0
  493. package/bundle/_internal/mypy/traverser.cpython-312-darwin.so +0 -0
  494. package/bundle/_internal/mypy/traverser.py +1106 -0
  495. package/bundle/_internal/mypy/treetransform.cpython-312-darwin.so +0 -0
  496. package/bundle/_internal/mypy/treetransform.py +820 -0
  497. package/bundle/_internal/mypy/tvar_scope.cpython-312-darwin.so +0 -0
  498. package/bundle/_internal/mypy/tvar_scope.py +154 -0
  499. package/bundle/_internal/mypy/type_visitor.cpython-312-darwin.so +0 -0
  500. package/bundle/_internal/mypy/type_visitor.py +630 -0
  501. package/bundle/_internal/mypy/typeanal.cpython-312-darwin.so +0 -0
  502. package/bundle/_internal/mypy/typeanal.py +2961 -0
  503. package/bundle/_internal/mypy/typeops.cpython-312-darwin.so +0 -0
  504. package/bundle/_internal/mypy/typeops.py +1355 -0
  505. package/bundle/_internal/mypy/types.cpython-312-darwin.so +0 -0
  506. package/bundle/_internal/mypy/types.py +4639 -0
  507. package/bundle/_internal/mypy/types_utils.cpython-312-darwin.so +0 -0
  508. package/bundle/_internal/mypy/types_utils.py +183 -0
  509. package/bundle/_internal/mypy/typeshed/LICENSE +237 -0
  510. package/bundle/_internal/mypy/typeshed/stdlib/VERSIONS +349 -0
  511. package/bundle/_internal/mypy/typeshed/stdlib/__future__.pyi +36 -0
  512. package/bundle/_internal/mypy/typeshed/stdlib/__main__.pyi +1 -0
  513. package/bundle/_internal/mypy/typeshed/stdlib/_ast.pyi +141 -0
  514. package/bundle/_internal/mypy/typeshed/stdlib/_asyncio.pyi +114 -0
  515. package/bundle/_internal/mypy/typeshed/stdlib/_bisect.pyi +103 -0
  516. package/bundle/_internal/mypy/typeshed/stdlib/_blake2.pyi +119 -0
  517. package/bundle/_internal/mypy/typeshed/stdlib/_bz2.pyi +24 -0
  518. package/bundle/_internal/mypy/typeshed/stdlib/_codecs.pyi +125 -0
  519. package/bundle/_internal/mypy/typeshed/stdlib/_collections_abc.pyi +105 -0
  520. package/bundle/_internal/mypy/typeshed/stdlib/_compat_pickle.pyi +10 -0
  521. package/bundle/_internal/mypy/typeshed/stdlib/_compression.pyi +39 -0
  522. package/bundle/_internal/mypy/typeshed/stdlib/_contextvars.pyi +69 -0
  523. package/bundle/_internal/mypy/typeshed/stdlib/_csv.pyi +116 -0
  524. package/bundle/_internal/mypy/typeshed/stdlib/_ctypes.pyi +375 -0
  525. package/bundle/_internal/mypy/typeshed/stdlib/_curses.pyi +583 -0
  526. package/bundle/_internal/mypy/typeshed/stdlib/_curses_panel.pyi +27 -0
  527. package/bundle/_internal/mypy/typeshed/stdlib/_dbm.pyi +46 -0
  528. package/bundle/_internal/mypy/typeshed/stdlib/_decimal.pyi +73 -0
  529. package/bundle/_internal/mypy/typeshed/stdlib/_frozen_importlib.pyi +121 -0
  530. package/bundle/_internal/mypy/typeshed/stdlib/_frozen_importlib_external.pyi +218 -0
  531. package/bundle/_internal/mypy/typeshed/stdlib/_gdbm.pyi +50 -0
  532. package/bundle/_internal/mypy/typeshed/stdlib/_hashlib.pyi +127 -0
  533. package/bundle/_internal/mypy/typeshed/stdlib/_heapq.pyi +18 -0
  534. package/bundle/_internal/mypy/typeshed/stdlib/_imp.pyi +30 -0
  535. package/bundle/_internal/mypy/typeshed/stdlib/_interpchannels.pyi +86 -0
  536. package/bundle/_internal/mypy/typeshed/stdlib/_interpqueues.pyi +31 -0
  537. package/bundle/_internal/mypy/typeshed/stdlib/_interpreters.pyi +68 -0
  538. package/bundle/_internal/mypy/typeshed/stdlib/_io.pyi +330 -0
  539. package/bundle/_internal/mypy/typeshed/stdlib/_json.pyi +59 -0
  540. package/bundle/_internal/mypy/typeshed/stdlib/_locale.pyi +121 -0
  541. package/bundle/_internal/mypy/typeshed/stdlib/_lsprof.pyi +34 -0
  542. package/bundle/_internal/mypy/typeshed/stdlib/_lzma.pyi +71 -0
  543. package/bundle/_internal/mypy/typeshed/stdlib/_markupbase.pyi +10 -0
  544. package/bundle/_internal/mypy/typeshed/stdlib/_msi.pyi +97 -0
  545. package/bundle/_internal/mypy/typeshed/stdlib/_multibytecodec.pyi +49 -0
  546. package/bundle/_internal/mypy/typeshed/stdlib/_operator.pyi +130 -0
  547. package/bundle/_internal/mypy/typeshed/stdlib/_osx_support.pyi +34 -0
  548. package/bundle/_internal/mypy/typeshed/stdlib/_pickle.pyi +114 -0
  549. package/bundle/_internal/mypy/typeshed/stdlib/_posixsubprocess.pyi +59 -0
  550. package/bundle/_internal/mypy/typeshed/stdlib/_py_abc.pyi +14 -0
  551. package/bundle/_internal/mypy/typeshed/stdlib/_pydecimal.pyi +50 -0
  552. package/bundle/_internal/mypy/typeshed/stdlib/_queue.pyi +18 -0
  553. package/bundle/_internal/mypy/typeshed/stdlib/_random.pyi +14 -0
  554. package/bundle/_internal/mypy/typeshed/stdlib/_remote_debugging.pyi +186 -0
  555. package/bundle/_internal/mypy/typeshed/stdlib/_sitebuiltins.pyi +18 -0
  556. package/bundle/_internal/mypy/typeshed/stdlib/_socket.pyi +966 -0
  557. package/bundle/_internal/mypy/typeshed/stdlib/_sqlite3.pyi +311 -0
  558. package/bundle/_internal/mypy/typeshed/stdlib/_ssl.pyi +303 -0
  559. package/bundle/_internal/mypy/typeshed/stdlib/_stat.pyi +119 -0
  560. package/bundle/_internal/mypy/typeshed/stdlib/_struct.pyi +24 -0
  561. package/bundle/_internal/mypy/typeshed/stdlib/_thread.pyi +125 -0
  562. package/bundle/_internal/mypy/typeshed/stdlib/_threading_local.pyi +24 -0
  563. package/bundle/_internal/mypy/typeshed/stdlib/_tkinter.pyi +156 -0
  564. package/bundle/_internal/mypy/typeshed/stdlib/_tracemalloc.pyi +13 -0
  565. package/bundle/_internal/mypy/typeshed/stdlib/_typeshed/README.md +34 -0
  566. package/bundle/_internal/mypy/typeshed/stdlib/_typeshed/__init__.pyi +415 -0
  567. package/bundle/_internal/mypy/typeshed/stdlib/_typeshed/_type_checker_internals.pyi +102 -0
  568. package/bundle/_internal/mypy/typeshed/stdlib/_typeshed/dbapi.pyi +36 -0
  569. package/bundle/_internal/mypy/typeshed/stdlib/_typeshed/importlib.pyi +18 -0
  570. package/bundle/_internal/mypy/typeshed/stdlib/_typeshed/wsgi.pyi +43 -0
  571. package/bundle/_internal/mypy/typeshed/stdlib/_typeshed/xml.pyi +9 -0
  572. package/bundle/_internal/mypy/typeshed/stdlib/_warnings.pyi +54 -0
  573. package/bundle/_internal/mypy/typeshed/stdlib/_weakref.pyi +15 -0
  574. package/bundle/_internal/mypy/typeshed/stdlib/_weakrefset.pyi +49 -0
  575. package/bundle/_internal/mypy/typeshed/stdlib/_winapi.pyi +319 -0
  576. package/bundle/_internal/mypy/typeshed/stdlib/_zstd.pyi +102 -0
  577. package/bundle/_internal/mypy/typeshed/stdlib/abc.pyi +50 -0
  578. package/bundle/_internal/mypy/typeshed/stdlib/aifc.pyi +79 -0
  579. package/bundle/_internal/mypy/typeshed/stdlib/annotationlib.pyi +156 -0
  580. package/bundle/_internal/mypy/typeshed/stdlib/antigravity.pyi +3 -0
  581. package/bundle/_internal/mypy/typeshed/stdlib/argparse.pyi +866 -0
  582. package/bundle/_internal/mypy/typeshed/stdlib/array.pyi +113 -0
  583. package/bundle/_internal/mypy/typeshed/stdlib/ast.pyi +2199 -0
  584. package/bundle/_internal/mypy/typeshed/stdlib/asynchat.pyi +21 -0
  585. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/__init__.pyi +1022 -0
  586. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/base_events.pyi +607 -0
  587. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/base_futures.pyi +17 -0
  588. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/base_subprocess.pyi +62 -0
  589. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/base_tasks.pyi +17 -0
  590. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/constants.pyi +20 -0
  591. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/coroutines.pyi +45 -0
  592. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/events.pyi +803 -0
  593. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/exceptions.pyi +44 -0
  594. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/format_helpers.pyi +31 -0
  595. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/futures.pyi +19 -0
  596. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/graph.pyi +29 -0
  597. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/locks.pyi +83 -0
  598. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/log.pyi +3 -0
  599. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/mixins.pyi +9 -0
  600. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/proactor_events.pyi +53 -0
  601. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/protocols.pyi +39 -0
  602. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/queues.pyi +45 -0
  603. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/runners.pyi +41 -0
  604. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/selector_events.pyi +10 -0
  605. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/sslproto.pyi +164 -0
  606. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/staggered.pyi +10 -0
  607. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/streams.pyi +124 -0
  608. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/subprocess.pyi +166 -0
  609. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/taskgroups.pyi +41 -0
  610. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/tasks.pyi +315 -0
  611. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/threads.pyi +9 -0
  612. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/timeouts.pyi +20 -0
  613. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/tools.pyi +51 -0
  614. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/transports.pyi +57 -0
  615. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/trsock.pyi +137 -0
  616. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/unix_events.pyi +277 -0
  617. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/windows_events.pyi +122 -0
  618. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/windows_utils.pyi +49 -0
  619. package/bundle/_internal/mypy/typeshed/stdlib/asyncore.pyi +91 -0
  620. package/bundle/_internal/mypy/typeshed/stdlib/atexit.pyi +11 -0
  621. package/bundle/_internal/mypy/typeshed/stdlib/audioop.pyi +44 -0
  622. package/bundle/_internal/mypy/typeshed/stdlib/base64.pyi +124 -0
  623. package/bundle/_internal/mypy/typeshed/stdlib/bdb.pyi +139 -0
  624. package/bundle/_internal/mypy/typeshed/stdlib/binascii.pyi +102 -0
  625. package/bundle/_internal/mypy/typeshed/stdlib/binhex.pyi +44 -0
  626. package/bundle/_internal/mypy/typeshed/stdlib/bisect.pyi +4 -0
  627. package/bundle/_internal/mypy/typeshed/stdlib/builtins.pyi +2470 -0
  628. package/bundle/_internal/mypy/typeshed/stdlib/bz2.pyi +121 -0
  629. package/bundle/_internal/mypy/typeshed/stdlib/cProfile.pyi +33 -0
  630. package/bundle/_internal/mypy/typeshed/stdlib/calendar.pyi +249 -0
  631. package/bundle/_internal/mypy/typeshed/stdlib/cgi.pyi +120 -0
  632. package/bundle/_internal/mypy/typeshed/stdlib/cgitb.pyi +32 -0
  633. package/bundle/_internal/mypy/typeshed/stdlib/chunk.pyi +20 -0
  634. package/bundle/_internal/mypy/typeshed/stdlib/cmath.pyi +36 -0
  635. package/bundle/_internal/mypy/typeshed/stdlib/cmd.pyi +46 -0
  636. package/bundle/_internal/mypy/typeshed/stdlib/code.pyi +55 -0
  637. package/bundle/_internal/mypy/typeshed/stdlib/codecs.pyi +357 -0
  638. package/bundle/_internal/mypy/typeshed/stdlib/codeop.pyi +21 -0
  639. package/bundle/_internal/mypy/typeshed/stdlib/collections/__init__.pyi +565 -0
  640. package/bundle/_internal/mypy/typeshed/stdlib/collections/abc.pyi +2 -0
  641. package/bundle/_internal/mypy/typeshed/stdlib/colorsys.pyi +15 -0
  642. package/bundle/_internal/mypy/typeshed/stdlib/compileall.pyi +51 -0
  643. package/bundle/_internal/mypy/typeshed/stdlib/compression/__init__.pyi +0 -0
  644. package/bundle/_internal/mypy/typeshed/stdlib/compression/_common/__init__.pyi +0 -0
  645. package/bundle/_internal/mypy/typeshed/stdlib/compression/_common/_streams.pyi +37 -0
  646. package/bundle/_internal/mypy/typeshed/stdlib/compression/bz2.pyi +1 -0
  647. package/bundle/_internal/mypy/typeshed/stdlib/compression/gzip.pyi +1 -0
  648. package/bundle/_internal/mypy/typeshed/stdlib/compression/lzma.pyi +1 -0
  649. package/bundle/_internal/mypy/typeshed/stdlib/compression/zlib.pyi +1 -0
  650. package/bundle/_internal/mypy/typeshed/stdlib/compression/zstd/__init__.pyi +94 -0
  651. package/bundle/_internal/mypy/typeshed/stdlib/compression/zstd/_zstdfile.pyi +117 -0
  652. package/bundle/_internal/mypy/typeshed/stdlib/concurrent/__init__.pyi +0 -0
  653. package/bundle/_internal/mypy/typeshed/stdlib/concurrent/futures/__init__.pyi +71 -0
  654. package/bundle/_internal/mypy/typeshed/stdlib/concurrent/futures/_base.pyi +119 -0
  655. package/bundle/_internal/mypy/typeshed/stdlib/concurrent/futures/interpreter.pyi +82 -0
  656. package/bundle/_internal/mypy/typeshed/stdlib/concurrent/futures/process.pyi +248 -0
  657. package/bundle/_internal/mypy/typeshed/stdlib/concurrent/futures/thread.pyi +143 -0
  658. package/bundle/_internal/mypy/typeshed/stdlib/concurrent/interpreters/__init__.pyi +68 -0
  659. package/bundle/_internal/mypy/typeshed/stdlib/concurrent/interpreters/_crossinterp.pyi +30 -0
  660. package/bundle/_internal/mypy/typeshed/stdlib/concurrent/interpreters/_queues.pyi +74 -0
  661. package/bundle/_internal/mypy/typeshed/stdlib/configparser.pyi +509 -0
  662. package/bundle/_internal/mypy/typeshed/stdlib/contextlib.pyi +211 -0
  663. package/bundle/_internal/mypy/typeshed/stdlib/contextvars.pyi +3 -0
  664. package/bundle/_internal/mypy/typeshed/stdlib/copy.pyi +37 -0
  665. package/bundle/_internal/mypy/typeshed/stdlib/copyreg.pyi +20 -0
  666. package/bundle/_internal/mypy/typeshed/stdlib/crypt.pyi +26 -0
  667. package/bundle/_internal/mypy/typeshed/stdlib/csv.pyi +153 -0
  668. package/bundle/_internal/mypy/typeshed/stdlib/ctypes/__init__.pyi +394 -0
  669. package/bundle/_internal/mypy/typeshed/stdlib/ctypes/_endian.pyi +16 -0
  670. package/bundle/_internal/mypy/typeshed/stdlib/ctypes/macholib/__init__.pyi +3 -0
  671. package/bundle/_internal/mypy/typeshed/stdlib/ctypes/macholib/dyld.pyi +8 -0
  672. package/bundle/_internal/mypy/typeshed/stdlib/ctypes/macholib/dylib.pyi +14 -0
  673. package/bundle/_internal/mypy/typeshed/stdlib/ctypes/macholib/framework.pyi +14 -0
  674. package/bundle/_internal/mypy/typeshed/stdlib/ctypes/util.pyi +11 -0
  675. package/bundle/_internal/mypy/typeshed/stdlib/ctypes/wintypes.pyi +321 -0
  676. package/bundle/_internal/mypy/typeshed/stdlib/curses/__init__.pyi +38 -0
  677. package/bundle/_internal/mypy/typeshed/stdlib/curses/ascii.pyi +62 -0
  678. package/bundle/_internal/mypy/typeshed/stdlib/curses/has_key.pyi +1 -0
  679. package/bundle/_internal/mypy/typeshed/stdlib/curses/panel.pyi +1 -0
  680. package/bundle/_internal/mypy/typeshed/stdlib/curses/textpad.pyi +11 -0
  681. package/bundle/_internal/mypy/typeshed/stdlib/dataclasses.pyi +401 -0
  682. package/bundle/_internal/mypy/typeshed/stdlib/datetime.pyi +381 -0
  683. package/bundle/_internal/mypy/typeshed/stdlib/dbm/__init__.pyi +105 -0
  684. package/bundle/_internal/mypy/typeshed/stdlib/dbm/dumb.pyi +41 -0
  685. package/bundle/_internal/mypy/typeshed/stdlib/dbm/gnu.pyi +1 -0
  686. package/bundle/_internal/mypy/typeshed/stdlib/dbm/ndbm.pyi +1 -0
  687. package/bundle/_internal/mypy/typeshed/stdlib/dbm/sqlite3.pyi +34 -0
  688. package/bundle/_internal/mypy/typeshed/stdlib/decimal.pyi +278 -0
  689. package/bundle/_internal/mypy/typeshed/stdlib/difflib.pyi +157 -0
  690. package/bundle/_internal/mypy/typeshed/stdlib/dis.pyi +302 -0
  691. package/bundle/_internal/mypy/typeshed/stdlib/distutils/__init__.pyi +5 -0
  692. package/bundle/_internal/mypy/typeshed/stdlib/distutils/_msvccompiler.pyi +13 -0
  693. package/bundle/_internal/mypy/typeshed/stdlib/distutils/archive_util.pyi +36 -0
  694. package/bundle/_internal/mypy/typeshed/stdlib/distutils/bcppcompiler.pyi +3 -0
  695. package/bundle/_internal/mypy/typeshed/stdlib/distutils/ccompiler.pyi +182 -0
  696. package/bundle/_internal/mypy/typeshed/stdlib/distutils/cmd.pyi +238 -0
  697. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/__init__.pyi +41 -0
  698. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/bdist.pyi +27 -0
  699. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/bdist_dumb.pyi +22 -0
  700. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/bdist_msi.pyi +45 -0
  701. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/bdist_packager.pyi +0 -0
  702. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/bdist_rpm.pyi +53 -0
  703. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/build.pyi +34 -0
  704. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/build_clib.pyi +29 -0
  705. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/build_ext.pyi +52 -0
  706. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/build_py.pyi +45 -0
  707. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/build_scripts.pyi +25 -0
  708. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/check.pyi +39 -0
  709. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/clean.pyi +18 -0
  710. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/config.pyi +84 -0
  711. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/install.pyi +67 -0
  712. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/install_data.pyi +20 -0
  713. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/install_egg_info.pyi +19 -0
  714. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/install_headers.pyi +17 -0
  715. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/install_lib.pyi +26 -0
  716. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/install_scripts.pyi +19 -0
  717. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/register.pyi +20 -0
  718. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/sdist.pyi +45 -0
  719. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/upload.pyi +18 -0
  720. package/bundle/_internal/mypy/typeshed/stdlib/distutils/config.pyi +17 -0
  721. package/bundle/_internal/mypy/typeshed/stdlib/distutils/core.pyi +58 -0
  722. package/bundle/_internal/mypy/typeshed/stdlib/distutils/cygwinccompiler.pyi +20 -0
  723. package/bundle/_internal/mypy/typeshed/stdlib/distutils/debug.pyi +3 -0
  724. package/bundle/_internal/mypy/typeshed/stdlib/distutils/dep_util.pyi +14 -0
  725. package/bundle/_internal/mypy/typeshed/stdlib/distutils/dir_util.pyi +23 -0
  726. package/bundle/_internal/mypy/typeshed/stdlib/distutils/dist.pyi +318 -0
  727. package/bundle/_internal/mypy/typeshed/stdlib/distutils/errors.pyi +19 -0
  728. package/bundle/_internal/mypy/typeshed/stdlib/distutils/extension.pyi +36 -0
  729. package/bundle/_internal/mypy/typeshed/stdlib/distutils/fancy_getopt.pyi +45 -0
  730. package/bundle/_internal/mypy/typeshed/stdlib/distutils/file_util.pyi +40 -0
  731. package/bundle/_internal/mypy/typeshed/stdlib/distutils/filelist.pyi +61 -0
  732. package/bundle/_internal/mypy/typeshed/stdlib/distutils/log.pyi +26 -0
  733. package/bundle/_internal/mypy/typeshed/stdlib/distutils/msvccompiler.pyi +3 -0
  734. package/bundle/_internal/mypy/typeshed/stdlib/distutils/spawn.pyi +10 -0
  735. package/bundle/_internal/mypy/typeshed/stdlib/distutils/sysconfig.pyi +32 -0
  736. package/bundle/_internal/mypy/typeshed/stdlib/distutils/text_file.pyi +21 -0
  737. package/bundle/_internal/mypy/typeshed/stdlib/distutils/unixccompiler.pyi +3 -0
  738. package/bundle/_internal/mypy/typeshed/stdlib/distutils/util.pyi +53 -0
  739. package/bundle/_internal/mypy/typeshed/stdlib/distutils/version.pyi +36 -0
  740. package/bundle/_internal/mypy/typeshed/stdlib/doctest.pyi +265 -0
  741. package/bundle/_internal/mypy/typeshed/stdlib/email/__init__.pyi +68 -0
  742. package/bundle/_internal/mypy/typeshed/stdlib/email/_header_value_parser.pyi +415 -0
  743. package/bundle/_internal/mypy/typeshed/stdlib/email/_policybase.pyi +80 -0
  744. package/bundle/_internal/mypy/typeshed/stdlib/email/base64mime.pyi +13 -0
  745. package/bundle/_internal/mypy/typeshed/stdlib/email/charset.pyi +44 -0
  746. package/bundle/_internal/mypy/typeshed/stdlib/email/contentmanager.pyi +11 -0
  747. package/bundle/_internal/mypy/typeshed/stdlib/email/encoders.pyi +8 -0
  748. package/bundle/_internal/mypy/typeshed/stdlib/email/errors.pyi +38 -0
  749. package/bundle/_internal/mypy/typeshed/stdlib/email/feedparser.pyi +24 -0
  750. package/bundle/_internal/mypy/typeshed/stdlib/email/generator.pyi +79 -0
  751. package/bundle/_internal/mypy/typeshed/stdlib/email/header.pyi +32 -0
  752. package/bundle/_internal/mypy/typeshed/stdlib/email/headerregistry.pyi +196 -0
  753. package/bundle/_internal/mypy/typeshed/stdlib/email/iterators.pyi +15 -0
  754. package/bundle/_internal/mypy/typeshed/stdlib/email/message.pyi +191 -0
  755. package/bundle/_internal/mypy/typeshed/stdlib/email/mime/__init__.pyi +0 -0
  756. package/bundle/_internal/mypy/typeshed/stdlib/email/mime/application.pyi +17 -0
  757. package/bundle/_internal/mypy/typeshed/stdlib/email/mime/audio.pyi +17 -0
  758. package/bundle/_internal/mypy/typeshed/stdlib/email/mime/base.pyi +8 -0
  759. package/bundle/_internal/mypy/typeshed/stdlib/email/mime/image.pyi +17 -0
  760. package/bundle/_internal/mypy/typeshed/stdlib/email/mime/message.pyi +8 -0
  761. package/bundle/_internal/mypy/typeshed/stdlib/email/mime/multipart.pyi +18 -0
  762. package/bundle/_internal/mypy/typeshed/stdlib/email/mime/nonmultipart.pyi +5 -0
  763. package/bundle/_internal/mypy/typeshed/stdlib/email/mime/text.pyi +9 -0
  764. package/bundle/_internal/mypy/typeshed/stdlib/email/parser.pyi +42 -0
  765. package/bundle/_internal/mypy/typeshed/stdlib/email/policy.pyi +78 -0
  766. package/bundle/_internal/mypy/typeshed/stdlib/email/quoprimime.pyi +28 -0
  767. package/bundle/_internal/mypy/typeshed/stdlib/email/utils.pyi +72 -0
  768. package/bundle/_internal/mypy/typeshed/stdlib/encodings/__init__.pyi +15 -0
  769. package/bundle/_internal/mypy/typeshed/stdlib/encodings/aliases.pyi +1 -0
  770. package/bundle/_internal/mypy/typeshed/stdlib/encodings/ascii.pyi +30 -0
  771. package/bundle/_internal/mypy/typeshed/stdlib/encodings/base64_codec.pyi +26 -0
  772. package/bundle/_internal/mypy/typeshed/stdlib/encodings/big5.pyi +23 -0
  773. package/bundle/_internal/mypy/typeshed/stdlib/encodings/big5hkscs.pyi +23 -0
  774. package/bundle/_internal/mypy/typeshed/stdlib/encodings/bz2_codec.pyi +26 -0
  775. package/bundle/_internal/mypy/typeshed/stdlib/encodings/charmap.pyi +33 -0
  776. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp037.pyi +21 -0
  777. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1006.pyi +21 -0
  778. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1026.pyi +21 -0
  779. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1125.pyi +21 -0
  780. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1140.pyi +21 -0
  781. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1250.pyi +21 -0
  782. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1251.pyi +21 -0
  783. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1252.pyi +21 -0
  784. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1253.pyi +21 -0
  785. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1254.pyi +21 -0
  786. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1255.pyi +21 -0
  787. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1256.pyi +21 -0
  788. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1257.pyi +21 -0
  789. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1258.pyi +21 -0
  790. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp273.pyi +21 -0
  791. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp424.pyi +21 -0
  792. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp437.pyi +21 -0
  793. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp500.pyi +21 -0
  794. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp720.pyi +21 -0
  795. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp737.pyi +21 -0
  796. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp775.pyi +21 -0
  797. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp850.pyi +21 -0
  798. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp852.pyi +21 -0
  799. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp855.pyi +21 -0
  800. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp856.pyi +21 -0
  801. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp857.pyi +21 -0
  802. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp858.pyi +21 -0
  803. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp860.pyi +21 -0
  804. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp861.pyi +21 -0
  805. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp862.pyi +21 -0
  806. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp863.pyi +21 -0
  807. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp864.pyi +21 -0
  808. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp865.pyi +21 -0
  809. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp866.pyi +21 -0
  810. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp869.pyi +21 -0
  811. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp874.pyi +21 -0
  812. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp875.pyi +21 -0
  813. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp932.pyi +23 -0
  814. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp949.pyi +23 -0
  815. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp950.pyi +23 -0
  816. package/bundle/_internal/mypy/typeshed/stdlib/encodings/euc_jis_2004.pyi +23 -0
  817. package/bundle/_internal/mypy/typeshed/stdlib/encodings/euc_jisx0213.pyi +23 -0
  818. package/bundle/_internal/mypy/typeshed/stdlib/encodings/euc_jp.pyi +23 -0
  819. package/bundle/_internal/mypy/typeshed/stdlib/encodings/euc_kr.pyi +23 -0
  820. package/bundle/_internal/mypy/typeshed/stdlib/encodings/gb18030.pyi +23 -0
  821. package/bundle/_internal/mypy/typeshed/stdlib/encodings/gb2312.pyi +23 -0
  822. package/bundle/_internal/mypy/typeshed/stdlib/encodings/gbk.pyi +23 -0
  823. package/bundle/_internal/mypy/typeshed/stdlib/encodings/hex_codec.pyi +26 -0
  824. package/bundle/_internal/mypy/typeshed/stdlib/encodings/hp_roman8.pyi +21 -0
  825. package/bundle/_internal/mypy/typeshed/stdlib/encodings/hz.pyi +23 -0
  826. package/bundle/_internal/mypy/typeshed/stdlib/encodings/idna.pyi +26 -0
  827. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso2022_jp.pyi +23 -0
  828. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso2022_jp_1.pyi +23 -0
  829. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso2022_jp_2.pyi +23 -0
  830. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso2022_jp_2004.pyi +23 -0
  831. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso2022_jp_3.pyi +23 -0
  832. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso2022_jp_ext.pyi +23 -0
  833. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso2022_kr.pyi +23 -0
  834. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_1.pyi +21 -0
  835. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_10.pyi +21 -0
  836. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_11.pyi +21 -0
  837. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_13.pyi +21 -0
  838. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_14.pyi +21 -0
  839. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_15.pyi +21 -0
  840. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_16.pyi +21 -0
  841. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_2.pyi +21 -0
  842. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_3.pyi +21 -0
  843. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_4.pyi +21 -0
  844. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_5.pyi +21 -0
  845. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_6.pyi +21 -0
  846. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_7.pyi +21 -0
  847. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_8.pyi +21 -0
  848. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_9.pyi +21 -0
  849. package/bundle/_internal/mypy/typeshed/stdlib/encodings/johab.pyi +23 -0
  850. package/bundle/_internal/mypy/typeshed/stdlib/encodings/koi8_r.pyi +21 -0
  851. package/bundle/_internal/mypy/typeshed/stdlib/encodings/koi8_t.pyi +21 -0
  852. package/bundle/_internal/mypy/typeshed/stdlib/encodings/koi8_u.pyi +21 -0
  853. package/bundle/_internal/mypy/typeshed/stdlib/encodings/kz1048.pyi +21 -0
  854. package/bundle/_internal/mypy/typeshed/stdlib/encodings/latin_1.pyi +30 -0
  855. package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_arabic.pyi +21 -0
  856. package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_croatian.pyi +21 -0
  857. package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_cyrillic.pyi +21 -0
  858. package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_farsi.pyi +21 -0
  859. package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_greek.pyi +21 -0
  860. package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_iceland.pyi +21 -0
  861. package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_latin2.pyi +21 -0
  862. package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_roman.pyi +21 -0
  863. package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_romanian.pyi +21 -0
  864. package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_turkish.pyi +21 -0
  865. package/bundle/_internal/mypy/typeshed/stdlib/encodings/mbcs.pyi +28 -0
  866. package/bundle/_internal/mypy/typeshed/stdlib/encodings/oem.pyi +28 -0
  867. package/bundle/_internal/mypy/typeshed/stdlib/encodings/palmos.pyi +21 -0
  868. package/bundle/_internal/mypy/typeshed/stdlib/encodings/ptcp154.pyi +21 -0
  869. package/bundle/_internal/mypy/typeshed/stdlib/encodings/punycode.pyi +33 -0
  870. package/bundle/_internal/mypy/typeshed/stdlib/encodings/quopri_codec.pyi +26 -0
  871. package/bundle/_internal/mypy/typeshed/stdlib/encodings/raw_unicode_escape.pyi +23 -0
  872. package/bundle/_internal/mypy/typeshed/stdlib/encodings/rot_13.pyi +23 -0
  873. package/bundle/_internal/mypy/typeshed/stdlib/encodings/shift_jis.pyi +23 -0
  874. package/bundle/_internal/mypy/typeshed/stdlib/encodings/shift_jis_2004.pyi +23 -0
  875. package/bundle/_internal/mypy/typeshed/stdlib/encodings/shift_jisx0213.pyi +23 -0
  876. package/bundle/_internal/mypy/typeshed/stdlib/encodings/tis_620.pyi +21 -0
  877. package/bundle/_internal/mypy/typeshed/stdlib/encodings/undefined.pyi +20 -0
  878. package/bundle/_internal/mypy/typeshed/stdlib/encodings/unicode_escape.pyi +23 -0
  879. package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_16.pyi +20 -0
  880. package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_16_be.pyi +26 -0
  881. package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_16_le.pyi +26 -0
  882. package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_32.pyi +20 -0
  883. package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_32_be.pyi +26 -0
  884. package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_32_le.pyi +26 -0
  885. package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_7.pyi +26 -0
  886. package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_8.pyi +26 -0
  887. package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_8_sig.pyi +22 -0
  888. package/bundle/_internal/mypy/typeshed/stdlib/encodings/uu_codec.pyi +28 -0
  889. package/bundle/_internal/mypy/typeshed/stdlib/encodings/zlib_codec.pyi +26 -0
  890. package/bundle/_internal/mypy/typeshed/stdlib/ensurepip/__init__.pyi +12 -0
  891. package/bundle/_internal/mypy/typeshed/stdlib/enum.pyi +374 -0
  892. package/bundle/_internal/mypy/typeshed/stdlib/errno.pyi +227 -0
  893. package/bundle/_internal/mypy/typeshed/stdlib/faulthandler.pyi +61 -0
  894. package/bundle/_internal/mypy/typeshed/stdlib/fcntl.pyi +157 -0
  895. package/bundle/_internal/mypy/typeshed/stdlib/filecmp.pyi +65 -0
  896. package/bundle/_internal/mypy/typeshed/stdlib/fileinput.pyi +141 -0
  897. package/bundle/_internal/mypy/typeshed/stdlib/fnmatch.pyi +16 -0
  898. package/bundle/_internal/mypy/typeshed/stdlib/fractions.pyi +185 -0
  899. package/bundle/_internal/mypy/typeshed/stdlib/ftplib.pyi +174 -0
  900. package/bundle/_internal/mypy/typeshed/stdlib/functools.pyi +287 -0
  901. package/bundle/_internal/mypy/typeshed/stdlib/gc.pyi +32 -0
  902. package/bundle/_internal/mypy/typeshed/stdlib/genericpath.pyi +98 -0
  903. package/bundle/_internal/mypy/typeshed/stdlib/getopt.pyi +27 -0
  904. package/bundle/_internal/mypy/typeshed/stdlib/getpass.pyi +14 -0
  905. package/bundle/_internal/mypy/typeshed/stdlib/gettext.pyi +190 -0
  906. package/bundle/_internal/mypy/typeshed/stdlib/glob.pyi +50 -0
  907. package/bundle/_internal/mypy/typeshed/stdlib/graphlib.pyi +29 -0
  908. package/bundle/_internal/mypy/typeshed/stdlib/grp.pyi +21 -0
  909. package/bundle/_internal/mypy/typeshed/stdlib/gzip.pyi +181 -0
  910. package/bundle/_internal/mypy/typeshed/stdlib/hashlib.pyi +112 -0
  911. package/bundle/_internal/mypy/typeshed/stdlib/heapq.pyi +32 -0
  912. package/bundle/_internal/mypy/typeshed/stdlib/hmac.pyi +33 -0
  913. package/bundle/_internal/mypy/typeshed/stdlib/html/__init__.pyi +7 -0
  914. package/bundle/_internal/mypy/typeshed/stdlib/html/entities.pyi +8 -0
  915. package/bundle/_internal/mypy/typeshed/stdlib/html/parser.pyi +40 -0
  916. package/bundle/_internal/mypy/typeshed/stdlib/http/__init__.pyi +118 -0
  917. package/bundle/_internal/mypy/typeshed/stdlib/http/client.pyi +318 -0
  918. package/bundle/_internal/mypy/typeshed/stdlib/http/cookiejar.pyi +158 -0
  919. package/bundle/_internal/mypy/typeshed/stdlib/http/cookies.pyi +57 -0
  920. package/bundle/_internal/mypy/typeshed/stdlib/http/server.pyi +139 -0
  921. package/bundle/_internal/mypy/typeshed/stdlib/imaplib.pyi +212 -0
  922. package/bundle/_internal/mypy/typeshed/stdlib/imghdr.pyi +18 -0
  923. package/bundle/_internal/mypy/typeshed/stdlib/imp.pyi +63 -0
  924. package/bundle/_internal/mypy/typeshed/stdlib/importlib/__init__.pyi +17 -0
  925. package/bundle/_internal/mypy/typeshed/stdlib/importlib/_abc.pyi +21 -0
  926. package/bundle/_internal/mypy/typeshed/stdlib/importlib/_bootstrap.pyi +2 -0
  927. package/bundle/_internal/mypy/typeshed/stdlib/importlib/_bootstrap_external.pyi +2 -0
  928. package/bundle/_internal/mypy/typeshed/stdlib/importlib/abc.pyi +165 -0
  929. package/bundle/_internal/mypy/typeshed/stdlib/importlib/machinery.pyi +43 -0
  930. package/bundle/_internal/mypy/typeshed/stdlib/importlib/metadata/__init__.pyi +310 -0
  931. package/bundle/_internal/mypy/typeshed/stdlib/importlib/metadata/_meta.pyi +65 -0
  932. package/bundle/_internal/mypy/typeshed/stdlib/importlib/metadata/diagnose.pyi +2 -0
  933. package/bundle/_internal/mypy/typeshed/stdlib/importlib/readers.pyi +69 -0
  934. package/bundle/_internal/mypy/typeshed/stdlib/importlib/resources/__init__.pyi +81 -0
  935. package/bundle/_internal/mypy/typeshed/stdlib/importlib/resources/_common.pyi +48 -0
  936. package/bundle/_internal/mypy/typeshed/stdlib/importlib/resources/_functional.pyi +35 -0
  937. package/bundle/_internal/mypy/typeshed/stdlib/importlib/resources/abc.pyi +64 -0
  938. package/bundle/_internal/mypy/typeshed/stdlib/importlib/resources/readers.pyi +14 -0
  939. package/bundle/_internal/mypy/typeshed/stdlib/importlib/resources/simple.pyi +59 -0
  940. package/bundle/_internal/mypy/typeshed/stdlib/importlib/simple.pyi +11 -0
  941. package/bundle/_internal/mypy/typeshed/stdlib/importlib/util.pyi +75 -0
  942. package/bundle/_internal/mypy/typeshed/stdlib/inspect.pyi +749 -0
  943. package/bundle/_internal/mypy/typeshed/stdlib/io.pyi +75 -0
  944. package/bundle/_internal/mypy/typeshed/stdlib/ipaddress.pyi +249 -0
  945. package/bundle/_internal/mypy/typeshed/stdlib/itertools.pyi +376 -0
  946. package/bundle/_internal/mypy/typeshed/stdlib/json/__init__.pyi +93 -0
  947. package/bundle/_internal/mypy/typeshed/stdlib/json/decoder.pyi +50 -0
  948. package/bundle/_internal/mypy/typeshed/stdlib/json/encoder.pyi +40 -0
  949. package/bundle/_internal/mypy/typeshed/stdlib/json/scanner.pyi +7 -0
  950. package/bundle/_internal/mypy/typeshed/stdlib/json/tool.pyi +1 -0
  951. package/bundle/_internal/mypy/typeshed/stdlib/keyword.pyi +16 -0
  952. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/__init__.pyi +0 -0
  953. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/btm_matcher.pyi +28 -0
  954. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixer_base.pyi +42 -0
  955. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/__init__.pyi +0 -0
  956. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_apply.pyi +8 -0
  957. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_asserts.pyi +10 -0
  958. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_basestring.pyi +8 -0
  959. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_buffer.pyi +8 -0
  960. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_dict.pyi +16 -0
  961. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_except.pyi +14 -0
  962. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_exec.pyi +8 -0
  963. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_execfile.pyi +8 -0
  964. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_exitfunc.pyi +13 -0
  965. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_filter.pyi +9 -0
  966. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_funcattrs.pyi +8 -0
  967. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_future.pyi +8 -0
  968. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_getcwdu.pyi +8 -0
  969. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_has_key.pyi +8 -0
  970. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_idioms.pyi +15 -0
  971. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_import.pyi +16 -0
  972. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_imports.pyi +21 -0
  973. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_imports2.pyi +8 -0
  974. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_input.pyi +11 -0
  975. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_intern.pyi +9 -0
  976. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_isinstance.pyi +8 -0
  977. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_itertools.pyi +9 -0
  978. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_itertools_imports.pyi +7 -0
  979. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_long.pyi +7 -0
  980. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_map.pyi +9 -0
  981. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_metaclass.pyi +17 -0
  982. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_methodattrs.pyi +10 -0
  983. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_ne.pyi +8 -0
  984. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_next.pyi +19 -0
  985. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_nonzero.pyi +8 -0
  986. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_numliterals.pyi +8 -0
  987. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_operator.pyi +12 -0
  988. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_paren.pyi +8 -0
  989. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_print.pyi +12 -0
  990. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_raise.pyi +8 -0
  991. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_raw_input.pyi +8 -0
  992. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_reduce.pyi +8 -0
  993. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_reload.pyi +9 -0
  994. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_renames.pyi +17 -0
  995. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_repr.pyi +8 -0
  996. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_set_literal.pyi +7 -0
  997. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_standarderror.pyi +8 -0
  998. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_sys_exc.pyi +9 -0
  999. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_throw.pyi +8 -0
  1000. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_tuple_params.pyi +16 -0
  1001. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_types.pyi +8 -0
  1002. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_unicode.pyi +12 -0
  1003. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_urllib.pyi +15 -0
  1004. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_ws_comma.pyi +12 -0
  1005. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_xrange.pyi +20 -0
  1006. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_xreadlines.pyi +8 -0
  1007. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_zip.pyi +9 -0
  1008. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/main.pyi +42 -0
  1009. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/__init__.pyi +8 -0
  1010. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/driver.pyi +27 -0
  1011. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/grammar.pyi +25 -0
  1012. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/literals.pyi +7 -0
  1013. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/parse.pyi +30 -0
  1014. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/pgen.pyi +53 -0
  1015. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/token.pyi +69 -0
  1016. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/tokenize.pyi +96 -0
  1017. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pygram.pyi +114 -0
  1018. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pytree.pyi +118 -0
  1019. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/refactor.pyi +86 -0
  1020. package/bundle/_internal/mypy/typeshed/stdlib/linecache.pyi +18 -0
  1021. package/bundle/_internal/mypy/typeshed/stdlib/locale.pyi +160 -0
  1022. package/bundle/_internal/mypy/typeshed/stdlib/logging/__init__.pyi +674 -0
  1023. package/bundle/_internal/mypy/typeshed/stdlib/logging/config.pyi +141 -0
  1024. package/bundle/_internal/mypy/typeshed/stdlib/logging/handlers.pyi +258 -0
  1025. package/bundle/_internal/mypy/typeshed/stdlib/lzma.pyi +181 -0
  1026. package/bundle/_internal/mypy/typeshed/stdlib/mailbox.pyi +307 -0
  1027. package/bundle/_internal/mypy/typeshed/stdlib/mailcap.pyi +11 -0
  1028. package/bundle/_internal/mypy/typeshed/stdlib/marshal.pyi +51 -0
  1029. package/bundle/_internal/mypy/typeshed/stdlib/math/__init__.pyi +157 -0
  1030. package/bundle/_internal/mypy/typeshed/stdlib/math/integer.pyi +8 -0
  1031. package/bundle/_internal/mypy/typeshed/stdlib/mimetypes.pyi +56 -0
  1032. package/bundle/_internal/mypy/typeshed/stdlib/mmap.pyi +191 -0
  1033. package/bundle/_internal/mypy/typeshed/stdlib/modulefinder.pyi +68 -0
  1034. package/bundle/_internal/mypy/typeshed/stdlib/msilib/__init__.pyi +177 -0
  1035. package/bundle/_internal/mypy/typeshed/stdlib/msilib/schema.pyi +95 -0
  1036. package/bundle/_internal/mypy/typeshed/stdlib/msilib/sequence.pyi +13 -0
  1037. package/bundle/_internal/mypy/typeshed/stdlib/msilib/text.pyi +8 -0
  1038. package/bundle/_internal/mypy/typeshed/stdlib/msvcrt.pyi +31 -0
  1039. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/__init__.pyi +90 -0
  1040. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/connection.pyi +97 -0
  1041. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/context.pyi +220 -0
  1042. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/dummy/__init__.pyi +89 -0
  1043. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/dummy/connection.pyi +39 -0
  1044. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/forkserver.pyi +78 -0
  1045. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/heap.pyi +41 -0
  1046. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/managers.pyi +390 -0
  1047. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/pool.pyi +101 -0
  1048. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/popen_fork.pyi +26 -0
  1049. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/popen_forkserver.pyi +16 -0
  1050. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/popen_spawn_posix.pyi +20 -0
  1051. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/popen_spawn_win32.pyi +30 -0
  1052. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/process.pyi +57 -0
  1053. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/queues.pyi +46 -0
  1054. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/reduction.pyi +95 -0
  1055. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/resource_sharer.pyi +20 -0
  1056. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/resource_tracker.pyi +21 -0
  1057. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/shared_memory.pyi +43 -0
  1058. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/sharedctypes.pyi +140 -0
  1059. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/spawn.pyi +32 -0
  1060. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/synchronize.pyi +63 -0
  1061. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/util.pyi +109 -0
  1062. package/bundle/_internal/mypy/typeshed/stdlib/netrc.pyi +23 -0
  1063. package/bundle/_internal/mypy/typeshed/stdlib/nis.pyi +9 -0
  1064. package/bundle/_internal/mypy/typeshed/stdlib/nntplib.pyi +120 -0
  1065. package/bundle/_internal/mypy/typeshed/stdlib/nt.pyi +116 -0
  1066. package/bundle/_internal/mypy/typeshed/stdlib/ntpath.pyi +134 -0
  1067. package/bundle/_internal/mypy/typeshed/stdlib/nturl2path.pyi +6 -0
  1068. package/bundle/_internal/mypy/typeshed/stdlib/numbers.pyi +220 -0
  1069. package/bundle/_internal/mypy/typeshed/stdlib/opcode.pyi +53 -0
  1070. package/bundle/_internal/mypy/typeshed/stdlib/operator.pyi +219 -0
  1071. package/bundle/_internal/mypy/typeshed/stdlib/optparse.pyi +312 -0
  1072. package/bundle/_internal/mypy/typeshed/stdlib/os/__init__.pyi +1878 -0
  1073. package/bundle/_internal/mypy/typeshed/stdlib/os/path.pyi +8 -0
  1074. package/bundle/_internal/mypy/typeshed/stdlib/ossaudiodev.pyi +132 -0
  1075. package/bundle/_internal/mypy/typeshed/stdlib/pathlib/__init__.pyi +358 -0
  1076. package/bundle/_internal/mypy/typeshed/stdlib/pathlib/types.pyi +8 -0
  1077. package/bundle/_internal/mypy/typeshed/stdlib/pdb.pyi +275 -0
  1078. package/bundle/_internal/mypy/typeshed/stdlib/pickle.pyi +240 -0
  1079. package/bundle/_internal/mypy/typeshed/stdlib/pickletools.pyi +176 -0
  1080. package/bundle/_internal/mypy/typeshed/stdlib/pipes.pyi +16 -0
  1081. package/bundle/_internal/mypy/typeshed/stdlib/pkgutil.pyi +60 -0
  1082. package/bundle/_internal/mypy/typeshed/stdlib/platform.pyi +100 -0
  1083. package/bundle/_internal/mypy/typeshed/stdlib/plistlib.pyi +84 -0
  1084. package/bundle/_internal/mypy/typeshed/stdlib/poplib.pyi +93 -0
  1085. package/bundle/_internal/mypy/typeshed/stdlib/posix.pyi +427 -0
  1086. package/bundle/_internal/mypy/typeshed/stdlib/posixpath.pyi +230 -0
  1087. package/bundle/_internal/mypy/typeshed/stdlib/pprint.pyi +170 -0
  1088. package/bundle/_internal/mypy/typeshed/stdlib/profile.pyi +31 -0
  1089. package/bundle/_internal/mypy/typeshed/stdlib/profiling/__init__.pyi +3 -0
  1090. package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/__init__.pyi +17 -0
  1091. package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/collector.pyi +25 -0
  1092. package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/gecko_collector.pyi +111 -0
  1093. package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/heatmap_collector.pyi +24 -0
  1094. package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/jsonl_collector.pyi +15 -0
  1095. package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/pstats_collector.pyi +17 -0
  1096. package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/stack_collector.pyi +40 -0
  1097. package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/string_table.pyi +5 -0
  1098. package/bundle/_internal/mypy/typeshed/stdlib/profiling/tracing.pyi +9 -0
  1099. package/bundle/_internal/mypy/typeshed/stdlib/pstats.pyi +96 -0
  1100. package/bundle/_internal/mypy/typeshed/stdlib/pty.pyi +24 -0
  1101. package/bundle/_internal/mypy/typeshed/stdlib/pwd.pyi +27 -0
  1102. package/bundle/_internal/mypy/typeshed/stdlib/py_compile.pyi +28 -0
  1103. package/bundle/_internal/mypy/typeshed/stdlib/pyclbr.pyi +57 -0
  1104. package/bundle/_internal/mypy/typeshed/stdlib/pydoc.pyi +348 -0
  1105. package/bundle/_internal/mypy/typeshed/stdlib/pydoc_data/__init__.pyi +0 -0
  1106. package/bundle/_internal/mypy/typeshed/stdlib/pydoc_data/module_docs.pyi +3 -0
  1107. package/bundle/_internal/mypy/typeshed/stdlib/pydoc_data/topics.pyi +3 -0
  1108. package/bundle/_internal/mypy/typeshed/stdlib/pyexpat/__init__.pyi +88 -0
  1109. package/bundle/_internal/mypy/typeshed/stdlib/pyexpat/errors.pyi +53 -0
  1110. package/bundle/_internal/mypy/typeshed/stdlib/pyexpat/model.pyi +13 -0
  1111. package/bundle/_internal/mypy/typeshed/stdlib/queue.pyi +55 -0
  1112. package/bundle/_internal/mypy/typeshed/stdlib/quopri.pyi +12 -0
  1113. package/bundle/_internal/mypy/typeshed/stdlib/random.pyi +135 -0
  1114. package/bundle/_internal/mypy/typeshed/stdlib/re.pyi +347 -0
  1115. package/bundle/_internal/mypy/typeshed/stdlib/readline.pyi +39 -0
  1116. package/bundle/_internal/mypy/typeshed/stdlib/reprlib.pyi +64 -0
  1117. package/bundle/_internal/mypy/typeshed/stdlib/resource.pyi +102 -0
  1118. package/bundle/_internal/mypy/typeshed/stdlib/rlcompleter.pyi +9 -0
  1119. package/bundle/_internal/mypy/typeshed/stdlib/runpy.pyi +24 -0
  1120. package/bundle/_internal/mypy/typeshed/stdlib/sched.pyi +34 -0
  1121. package/bundle/_internal/mypy/typeshed/stdlib/secrets.pyi +17 -0
  1122. package/bundle/_internal/mypy/typeshed/stdlib/select.pyi +171 -0
  1123. package/bundle/_internal/mypy/typeshed/stdlib/selectors.pyi +67 -0
  1124. package/bundle/_internal/mypy/typeshed/stdlib/shelve.pyi +110 -0
  1125. package/bundle/_internal/mypy/typeshed/stdlib/shlex.pyi +63 -0
  1126. package/bundle/_internal/mypy/typeshed/stdlib/shutil.pyi +243 -0
  1127. package/bundle/_internal/mypy/typeshed/stdlib/signal.pyi +174 -0
  1128. package/bundle/_internal/mypy/typeshed/stdlib/site.pyi +46 -0
  1129. package/bundle/_internal/mypy/typeshed/stdlib/smtpd.pyi +92 -0
  1130. package/bundle/_internal/mypy/typeshed/stdlib/smtplib.pyi +223 -0
  1131. package/bundle/_internal/mypy/typeshed/stdlib/sndhdr.pyi +14 -0
  1132. package/bundle/_internal/mypy/typeshed/stdlib/socket.pyi +1587 -0
  1133. package/bundle/_internal/mypy/typeshed/stdlib/socketserver.pyi +170 -0
  1134. package/bundle/_internal/mypy/typeshed/stdlib/spwd.pyi +45 -0
  1135. package/bundle/_internal/mypy/typeshed/stdlib/sqlite3/__init__.pyi +510 -0
  1136. package/bundle/_internal/mypy/typeshed/stdlib/sqlite3/dbapi2.pyi +244 -0
  1137. package/bundle/_internal/mypy/typeshed/stdlib/sqlite3/dump.pyi +2 -0
  1138. package/bundle/_internal/mypy/typeshed/stdlib/sre_compile.pyi +12 -0
  1139. package/bundle/_internal/mypy/typeshed/stdlib/sre_constants.pyi +135 -0
  1140. package/bundle/_internal/mypy/typeshed/stdlib/sre_parse.pyi +102 -0
  1141. package/bundle/_internal/mypy/typeshed/stdlib/ssl.pyi +540 -0
  1142. package/bundle/_internal/mypy/typeshed/stdlib/stat.pyi +126 -0
  1143. package/bundle/_internal/mypy/typeshed/stdlib/statistics.pyi +161 -0
  1144. package/bundle/_internal/mypy/typeshed/stdlib/string/__init__.pyi +81 -0
  1145. package/bundle/_internal/mypy/typeshed/stdlib/string/templatelib.pyi +36 -0
  1146. package/bundle/_internal/mypy/typeshed/stdlib/stringprep.pyi +29 -0
  1147. package/bundle/_internal/mypy/typeshed/stdlib/struct.pyi +5 -0
  1148. package/bundle/_internal/mypy/typeshed/stdlib/subprocess.pyi +1484 -0
  1149. package/bundle/_internal/mypy/typeshed/stdlib/sunau.pyi +82 -0
  1150. package/bundle/_internal/mypy/typeshed/stdlib/symtable.pyi +95 -0
  1151. package/bundle/_internal/mypy/typeshed/stdlib/sys/__init__.pyi +538 -0
  1152. package/bundle/_internal/mypy/typeshed/stdlib/sys/__jit.pyi +11 -0
  1153. package/bundle/_internal/mypy/typeshed/stdlib/sys/_monitoring.pyi +69 -0
  1154. package/bundle/_internal/mypy/typeshed/stdlib/sysconfig.pyi +59 -0
  1155. package/bundle/_internal/mypy/typeshed/stdlib/syslog.pyi +58 -0
  1156. package/bundle/_internal/mypy/typeshed/stdlib/tabnanny.pyi +16 -0
  1157. package/bundle/_internal/mypy/typeshed/stdlib/tarfile.pyi +868 -0
  1158. package/bundle/_internal/mypy/typeshed/stdlib/telnetlib.pyi +123 -0
  1159. package/bundle/_internal/mypy/typeshed/stdlib/tempfile.pyi +474 -0
  1160. package/bundle/_internal/mypy/typeshed/stdlib/termios.pyi +303 -0
  1161. package/bundle/_internal/mypy/typeshed/stdlib/textwrap.pyi +103 -0
  1162. package/bundle/_internal/mypy/typeshed/stdlib/this.pyi +2 -0
  1163. package/bundle/_internal/mypy/typeshed/stdlib/threading.pyi +221 -0
  1164. package/bundle/_internal/mypy/typeshed/stdlib/time.pyi +117 -0
  1165. package/bundle/_internal/mypy/typeshed/stdlib/timeit.pyi +46 -0
  1166. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/__init__.pyi +4376 -0
  1167. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/colorchooser.pyi +12 -0
  1168. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/commondialog.pyi +14 -0
  1169. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/constants.pyi +80 -0
  1170. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/dialog.pyi +13 -0
  1171. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/dnd.pyi +19 -0
  1172. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/filedialog.pyi +149 -0
  1173. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/font.pyi +123 -0
  1174. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/messagebox.pyi +98 -0
  1175. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/scrolledtext.pyi +9 -0
  1176. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/simpledialog.pyi +58 -0
  1177. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/tix.pyi +299 -0
  1178. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/ttk.pyi +1434 -0
  1179. package/bundle/_internal/mypy/typeshed/stdlib/token.pyi +166 -0
  1180. package/bundle/_internal/mypy/typeshed/stdlib/tokenize.pyi +201 -0
  1181. package/bundle/_internal/mypy/typeshed/stdlib/tomllib.pyi +27 -0
  1182. package/bundle/_internal/mypy/typeshed/stdlib/trace.pyi +85 -0
  1183. package/bundle/_internal/mypy/typeshed/stdlib/traceback.pyi +293 -0
  1184. package/bundle/_internal/mypy/typeshed/stdlib/tracemalloc.pyi +123 -0
  1185. package/bundle/_internal/mypy/typeshed/stdlib/tty.pyi +29 -0
  1186. package/bundle/_internal/mypy/typeshed/stdlib/turtle.pyi +856 -0
  1187. package/bundle/_internal/mypy/typeshed/stdlib/types.pyi +744 -0
  1188. package/bundle/_internal/mypy/typeshed/stdlib/typing.pyi +1250 -0
  1189. package/bundle/_internal/mypy/typeshed/stdlib/typing_extensions.pyi +749 -0
  1190. package/bundle/_internal/mypy/typeshed/stdlib/unicodedata.pyi +94 -0
  1191. package/bundle/_internal/mypy/typeshed/stdlib/unittest/__init__.pyi +63 -0
  1192. package/bundle/_internal/mypy/typeshed/stdlib/unittest/_log.pyi +29 -0
  1193. package/bundle/_internal/mypy/typeshed/stdlib/unittest/async_case.pyi +24 -0
  1194. package/bundle/_internal/mypy/typeshed/stdlib/unittest/case.pyi +352 -0
  1195. package/bundle/_internal/mypy/typeshed/stdlib/unittest/loader.pyi +55 -0
  1196. package/bundle/_internal/mypy/typeshed/stdlib/unittest/main.pyi +74 -0
  1197. package/bundle/_internal/mypy/typeshed/stdlib/unittest/mock.pyi +555 -0
  1198. package/bundle/_internal/mypy/typeshed/stdlib/unittest/result.pyi +46 -0
  1199. package/bundle/_internal/mypy/typeshed/stdlib/unittest/runner.pyi +93 -0
  1200. package/bundle/_internal/mypy/typeshed/stdlib/unittest/signals.pyi +15 -0
  1201. package/bundle/_internal/mypy/typeshed/stdlib/unittest/suite.pyi +23 -0
  1202. package/bundle/_internal/mypy/typeshed/stdlib/unittest/util.pyi +39 -0
  1203. package/bundle/_internal/mypy/typeshed/stdlib/urllib/__init__.pyi +0 -0
  1204. package/bundle/_internal/mypy/typeshed/stdlib/urllib/error.pyi +29 -0
  1205. package/bundle/_internal/mypy/typeshed/stdlib/urllib/parse.pyi +354 -0
  1206. package/bundle/_internal/mypy/typeshed/stdlib/urllib/request.pyi +447 -0
  1207. package/bundle/_internal/mypy/typeshed/stdlib/urllib/response.pyi +45 -0
  1208. package/bundle/_internal/mypy/typeshed/stdlib/urllib/robotparser.pyi +20 -0
  1209. package/bundle/_internal/mypy/typeshed/stdlib/uu.pyi +12 -0
  1210. package/bundle/_internal/mypy/typeshed/stdlib/uuid.pyi +106 -0
  1211. package/bundle/_internal/mypy/typeshed/stdlib/venv/__init__.pyi +86 -0
  1212. package/bundle/_internal/mypy/typeshed/stdlib/warnings.pyi +146 -0
  1213. package/bundle/_internal/mypy/typeshed/stdlib/wave.pyi +105 -0
  1214. package/bundle/_internal/mypy/typeshed/stdlib/weakref.pyi +217 -0
  1215. package/bundle/_internal/mypy/typeshed/stdlib/webbrowser.pyi +93 -0
  1216. package/bundle/_internal/mypy/typeshed/stdlib/winreg.pyi +137 -0
  1217. package/bundle/_internal/mypy/typeshed/stdlib/winsound.pyi +40 -0
  1218. package/bundle/_internal/mypy/typeshed/stdlib/wsgiref/__init__.pyi +0 -0
  1219. package/bundle/_internal/mypy/typeshed/stdlib/wsgiref/handlers.pyi +91 -0
  1220. package/bundle/_internal/mypy/typeshed/stdlib/wsgiref/headers.pyi +27 -0
  1221. package/bundle/_internal/mypy/typeshed/stdlib/wsgiref/simple_server.pyi +37 -0
  1222. package/bundle/_internal/mypy/typeshed/stdlib/wsgiref/types.pyi +31 -0
  1223. package/bundle/_internal/mypy/typeshed/stdlib/wsgiref/util.pyi +26 -0
  1224. package/bundle/_internal/mypy/typeshed/stdlib/wsgiref/validate.pyi +50 -0
  1225. package/bundle/_internal/mypy/typeshed/stdlib/xdrlib.pyi +57 -0
  1226. package/bundle/_internal/mypy/typeshed/stdlib/xml/__init__.pyi +9 -0
  1227. package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/NodeFilter.pyi +22 -0
  1228. package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/__init__.pyi +101 -0
  1229. package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/domreg.pyi +8 -0
  1230. package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/expatbuilder.pyi +126 -0
  1231. package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/minicompat.pyi +24 -0
  1232. package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/minidom.pyi +693 -0
  1233. package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/pulldom.pyi +109 -0
  1234. package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/xmlbuilder.pyi +82 -0
  1235. package/bundle/_internal/mypy/typeshed/stdlib/xml/etree/ElementInclude.pyi +28 -0
  1236. package/bundle/_internal/mypy/typeshed/stdlib/xml/etree/ElementPath.pyi +42 -0
  1237. package/bundle/_internal/mypy/typeshed/stdlib/xml/etree/ElementTree.pyi +402 -0
  1238. package/bundle/_internal/mypy/typeshed/stdlib/xml/etree/__init__.pyi +0 -0
  1239. package/bundle/_internal/mypy/typeshed/stdlib/xml/etree/cElementTree.pyi +1 -0
  1240. package/bundle/_internal/mypy/typeshed/stdlib/xml/parsers/__init__.pyi +1 -0
  1241. package/bundle/_internal/mypy/typeshed/stdlib/xml/parsers/expat/__init__.pyi +7 -0
  1242. package/bundle/_internal/mypy/typeshed/stdlib/xml/parsers/expat/errors.pyi +1 -0
  1243. package/bundle/_internal/mypy/typeshed/stdlib/xml/parsers/expat/model.pyi +1 -0
  1244. package/bundle/_internal/mypy/typeshed/stdlib/xml/sax/__init__.pyi +42 -0
  1245. package/bundle/_internal/mypy/typeshed/stdlib/xml/sax/_exceptions.pyi +19 -0
  1246. package/bundle/_internal/mypy/typeshed/stdlib/xml/sax/expatreader.pyi +72 -0
  1247. package/bundle/_internal/mypy/typeshed/stdlib/xml/sax/handler.pyi +85 -0
  1248. package/bundle/_internal/mypy/typeshed/stdlib/xml/sax/saxutils.pyi +69 -0
  1249. package/bundle/_internal/mypy/typeshed/stdlib/xml/sax/xmlreader.pyi +94 -0
  1250. package/bundle/_internal/mypy/typeshed/stdlib/xml/utils.pyi +2 -0
  1251. package/bundle/_internal/mypy/typeshed/stdlib/xmlrpc/__init__.pyi +0 -0
  1252. package/bundle/_internal/mypy/typeshed/stdlib/xmlrpc/client.pyi +300 -0
  1253. package/bundle/_internal/mypy/typeshed/stdlib/xmlrpc/server.pyi +149 -0
  1254. package/bundle/_internal/mypy/typeshed/stdlib/xxlimited.pyi +15 -0
  1255. package/bundle/_internal/mypy/typeshed/stdlib/zipapp.pyi +19 -0
  1256. package/bundle/_internal/mypy/typeshed/stdlib/zipfile/__init__.pyi +411 -0
  1257. package/bundle/_internal/mypy/typeshed/stdlib/zipfile/_path/__init__.pyi +87 -0
  1258. package/bundle/_internal/mypy/typeshed/stdlib/zipfile/_path/glob.pyi +26 -0
  1259. package/bundle/_internal/mypy/typeshed/stdlib/zipimport.pyi +44 -0
  1260. package/bundle/_internal/mypy/typeshed/stdlib/zlib.pyi +81 -0
  1261. package/bundle/_internal/mypy/typeshed/stdlib/zoneinfo/__init__.pyi +36 -0
  1262. package/bundle/_internal/mypy/typeshed/stdlib/zoneinfo/_common.pyi +14 -0
  1263. package/bundle/_internal/mypy/typeshed/stdlib/zoneinfo/_tzpath.pyi +13 -0
  1264. package/bundle/_internal/mypy/typeshed/stubs/librt/librt/__init__.pyi +0 -0
  1265. package/bundle/_internal/mypy/typeshed/stubs/librt/librt/base64.pyi +4 -0
  1266. package/bundle/_internal/mypy/typeshed/stubs/librt/librt/internal.pyi +22 -0
  1267. package/bundle/_internal/mypy/typeshed/stubs/librt/librt/random.pyi +22 -0
  1268. package/bundle/_internal/mypy/typeshed/stubs/librt/librt/strings.pyi +61 -0
  1269. package/bundle/_internal/mypy/typeshed/stubs/librt/librt/threading.pyi +16 -0
  1270. package/bundle/_internal/mypy/typeshed/stubs/librt/librt/time.pyi +1 -0
  1271. package/bundle/_internal/mypy/typeshed/stubs/librt/librt/vecs.pyi +24 -0
  1272. package/bundle/_internal/mypy/typeshed/stubs/mypy-extensions/mypy_extensions.pyi +226 -0
  1273. package/bundle/_internal/mypy/typestate.cpython-312-darwin.so +0 -0
  1274. package/bundle/_internal/mypy/typestate.py +334 -0
  1275. package/bundle/_internal/mypy/typetraverser.cpython-312-darwin.so +0 -0
  1276. package/bundle/_internal/mypy/typetraverser.py +166 -0
  1277. package/bundle/_internal/mypy/typevars.cpython-312-darwin.so +0 -0
  1278. package/bundle/_internal/mypy/typevars.py +84 -0
  1279. package/bundle/_internal/mypy/typevartuples.cpython-312-darwin.so +0 -0
  1280. package/bundle/_internal/mypy/typevartuples.py +36 -0
  1281. package/bundle/_internal/mypy/util.cpython-312-darwin.so +0 -0
  1282. package/bundle/_internal/mypy/util.py +1055 -0
  1283. package/bundle/_internal/mypy/version.py +1 -0
  1284. package/bundle/_internal/mypy/visitor.cpython-312-darwin.so +0 -0
  1285. package/bundle/_internal/mypy/visitor.py +639 -0
  1286. package/bundle/_internal/mypy/xml/mypy-html.css +104 -0
  1287. package/bundle/_internal/mypy/xml/mypy-html.xslt +81 -0
  1288. package/bundle/_internal/mypy/xml/mypy-txt.xslt +100 -0
  1289. package/bundle/_internal/mypy/xml/mypy.xsd +50 -0
  1290. package/bundle/_internal/mypy-2.4.1.dist-info/INSTALLER +1 -0
  1291. package/bundle/_internal/mypy-2.4.1.dist-info/METADATA +56 -0
  1292. package/bundle/_internal/mypy-2.4.1.dist-info/RECORD +1814 -0
  1293. package/bundle/_internal/mypy-2.4.1.dist-info/WHEEL +6 -0
  1294. package/bundle/_internal/mypy-2.4.1.dist-info/entry_points.txt +6 -0
  1295. package/bundle/_internal/mypy-2.4.1.dist-info/licenses/LICENSE +264 -0
  1296. package/bundle/_internal/mypy-2.4.1.dist-info/licenses/mypy/typeshed/LICENSE +237 -0
  1297. package/bundle/_internal/mypy-2.4.1.dist-info/top_level.txt +3 -0
  1298. package/bundle/_internal/mypyc/__init__.cpython-312-darwin.so +0 -0
  1299. package/bundle/_internal/python3.12/lib-dynload/_asyncio.cpython-312-darwin.so +0 -0
  1300. package/bundle/_internal/python3.12/lib-dynload/_bisect.cpython-312-darwin.so +0 -0
  1301. package/bundle/_internal/python3.12/lib-dynload/_blake2.cpython-312-darwin.so +0 -0
  1302. package/bundle/_internal/python3.12/lib-dynload/_bz2.cpython-312-darwin.so +0 -0
  1303. package/bundle/_internal/python3.12/lib-dynload/_codecs_cn.cpython-312-darwin.so +0 -0
  1304. package/bundle/_internal/python3.12/lib-dynload/_codecs_hk.cpython-312-darwin.so +0 -0
  1305. package/bundle/_internal/python3.12/lib-dynload/_codecs_iso2022.cpython-312-darwin.so +0 -0
  1306. package/bundle/_internal/python3.12/lib-dynload/_codecs_jp.cpython-312-darwin.so +0 -0
  1307. package/bundle/_internal/python3.12/lib-dynload/_codecs_kr.cpython-312-darwin.so +0 -0
  1308. package/bundle/_internal/python3.12/lib-dynload/_codecs_tw.cpython-312-darwin.so +0 -0
  1309. package/bundle/_internal/python3.12/lib-dynload/_contextvars.cpython-312-darwin.so +0 -0
  1310. package/bundle/_internal/python3.12/lib-dynload/_csv.cpython-312-darwin.so +0 -0
  1311. package/bundle/_internal/python3.12/lib-dynload/_ctypes.cpython-312-darwin.so +0 -0
  1312. package/bundle/_internal/python3.12/lib-dynload/_curses.cpython-312-darwin.so +0 -0
  1313. package/bundle/_internal/python3.12/lib-dynload/_datetime.cpython-312-darwin.so +0 -0
  1314. package/bundle/_internal/python3.12/lib-dynload/_decimal.cpython-312-darwin.so +0 -0
  1315. package/bundle/_internal/python3.12/lib-dynload/_elementtree.cpython-312-darwin.so +0 -0
  1316. package/bundle/_internal/python3.12/lib-dynload/_hashlib.cpython-312-darwin.so +0 -0
  1317. package/bundle/_internal/python3.12/lib-dynload/_heapq.cpython-312-darwin.so +0 -0
  1318. package/bundle/_internal/python3.12/lib-dynload/_json.cpython-312-darwin.so +0 -0
  1319. package/bundle/_internal/python3.12/lib-dynload/_lzma.cpython-312-darwin.so +0 -0
  1320. package/bundle/_internal/python3.12/lib-dynload/_md5.cpython-312-darwin.so +0 -0
  1321. package/bundle/_internal/python3.12/lib-dynload/_multibytecodec.cpython-312-darwin.so +0 -0
  1322. package/bundle/_internal/python3.12/lib-dynload/_multiprocessing.cpython-312-darwin.so +0 -0
  1323. package/bundle/_internal/python3.12/lib-dynload/_opcode.cpython-312-darwin.so +0 -0
  1324. package/bundle/_internal/python3.12/lib-dynload/_pickle.cpython-312-darwin.so +0 -0
  1325. package/bundle/_internal/python3.12/lib-dynload/_posixshmem.cpython-312-darwin.so +0 -0
  1326. package/bundle/_internal/python3.12/lib-dynload/_posixsubprocess.cpython-312-darwin.so +0 -0
  1327. package/bundle/_internal/python3.12/lib-dynload/_queue.cpython-312-darwin.so +0 -0
  1328. package/bundle/_internal/python3.12/lib-dynload/_random.cpython-312-darwin.so +0 -0
  1329. package/bundle/_internal/python3.12/lib-dynload/_scproxy.cpython-312-darwin.so +0 -0
  1330. package/bundle/_internal/python3.12/lib-dynload/_sha1.cpython-312-darwin.so +0 -0
  1331. package/bundle/_internal/python3.12/lib-dynload/_sha2.cpython-312-darwin.so +0 -0
  1332. package/bundle/_internal/python3.12/lib-dynload/_sha3.cpython-312-darwin.so +0 -0
  1333. package/bundle/_internal/python3.12/lib-dynload/_socket.cpython-312-darwin.so +0 -0
  1334. package/bundle/_internal/python3.12/lib-dynload/_sqlite3.cpython-312-darwin.so +0 -0
  1335. package/bundle/_internal/python3.12/lib-dynload/_ssl.cpython-312-darwin.so +0 -0
  1336. package/bundle/_internal/python3.12/lib-dynload/_statistics.cpython-312-darwin.so +0 -0
  1337. package/bundle/_internal/python3.12/lib-dynload/_struct.cpython-312-darwin.so +0 -0
  1338. package/bundle/_internal/python3.12/lib-dynload/_uuid.cpython-312-darwin.so +0 -0
  1339. package/bundle/_internal/python3.12/lib-dynload/array.cpython-312-darwin.so +0 -0
  1340. package/bundle/_internal/python3.12/lib-dynload/binascii.cpython-312-darwin.so +0 -0
  1341. package/bundle/_internal/python3.12/lib-dynload/fcntl.cpython-312-darwin.so +0 -0
  1342. package/bundle/_internal/python3.12/lib-dynload/grp.cpython-312-darwin.so +0 -0
  1343. package/bundle/_internal/python3.12/lib-dynload/math.cpython-312-darwin.so +0 -0
  1344. package/bundle/_internal/python3.12/lib-dynload/mmap.cpython-312-darwin.so +0 -0
  1345. package/bundle/_internal/python3.12/lib-dynload/pyexpat.cpython-312-darwin.so +0 -0
  1346. package/bundle/_internal/python3.12/lib-dynload/readline.cpython-312-darwin.so +0 -0
  1347. package/bundle/_internal/python3.12/lib-dynload/resource.cpython-312-darwin.so +0 -0
  1348. package/bundle/_internal/python3.12/lib-dynload/select.cpython-312-darwin.so +0 -0
  1349. package/bundle/_internal/python3.12/lib-dynload/syslog.cpython-312-darwin.so +0 -0
  1350. package/bundle/_internal/python3.12/lib-dynload/termios.cpython-312-darwin.so +0 -0
  1351. package/bundle/_internal/python3.12/lib-dynload/unicodedata.cpython-312-darwin.so +0 -0
  1352. package/bundle/_internal/python3.12/lib-dynload/zlib.cpython-312-darwin.so +0 -0
  1353. package/bundle/_internal/radon/__init__.py +21 -0
  1354. package/bundle/_internal/radon/__main__.py +4 -0
  1355. package/bundle/_internal/radon/cli/__init__.py +433 -0
  1356. package/bundle/_internal/radon/cli/colors.py +49 -0
  1357. package/bundle/_internal/radon/cli/harvest.py +449 -0
  1358. package/bundle/_internal/radon/cli/tools.py +597 -0
  1359. package/bundle/_internal/radon/complexity.py +108 -0
  1360. package/bundle/_internal/radon/contrib/__init__.py +0 -0
  1361. package/bundle/_internal/radon/contrib/flake8.py +72 -0
  1362. package/bundle/_internal/radon/metrics.py +157 -0
  1363. package/bundle/_internal/radon/raw.py +245 -0
  1364. package/bundle/_internal/radon/tests/__init__.py +0 -0
  1365. package/bundle/_internal/radon/tests/conftest.py +31 -0
  1366. package/bundle/_internal/radon/tests/data/__init__.py +5 -0
  1367. package/bundle/_internal/radon/tests/data/no_encoding.py +2 -0
  1368. package/bundle/_internal/radon/tests/data/py3unicode.py +5 -0
  1369. package/bundle/_internal/radon/tests/run.py +14 -0
  1370. package/bundle/_internal/radon/tests/test_cli.py +282 -0
  1371. package/bundle/_internal/radon/tests/test_cli_colors.py +22 -0
  1372. package/bundle/_internal/radon/tests/test_cli_harvest.py +392 -0
  1373. package/bundle/_internal/radon/tests/test_cli_tools.py +616 -0
  1374. package/bundle/_internal/radon/tests/test_complexity_utils.py +118 -0
  1375. package/bundle/_internal/radon/tests/test_complexity_visitor.py +754 -0
  1376. package/bundle/_internal/radon/tests/test_halstead.py +113 -0
  1377. package/bundle/_internal/radon/tests/test_ipynb.py +141 -0
  1378. package/bundle/_internal/radon/tests/test_other_metrics.py +169 -0
  1379. package/bundle/_internal/radon/tests/test_raw.py +467 -0
  1380. package/bundle/_internal/radon/visitors.py +460 -0
  1381. package/bundle/_internal/radon-6.0.1.dist-info/INSTALLER +1 -0
  1382. package/bundle/_internal/radon-6.0.1.dist-info/LICENSE +22 -0
  1383. package/bundle/_internal/radon-6.0.1.dist-info/METADATA +263 -0
  1384. package/bundle/_internal/radon-6.0.1.dist-info/RECORD +64 -0
  1385. package/bundle/_internal/radon-6.0.1.dist-info/WHEEL +6 -0
  1386. package/bundle/_internal/radon-6.0.1.dist-info/entry_points.txt +8 -0
  1387. package/bundle/_internal/radon-6.0.1.dist-info/top_level.txt +1 -0
  1388. package/bundle/_internal/setuptools/_vendor/jaraco/text/Lorem ipsum.txt +2 -0
  1389. package/bundle/_internal/stevedore-5.10.0.dist-info/INSTALLER +1 -0
  1390. package/bundle/_internal/stevedore-5.10.0.dist-info/METADATA +56 -0
  1391. package/bundle/_internal/stevedore-5.10.0.dist-info/RECORD +84 -0
  1392. package/bundle/_internal/stevedore-5.10.0.dist-info/WHEEL +5 -0
  1393. package/bundle/_internal/stevedore-5.10.0.dist-info/entry_points.txt +10 -0
  1394. package/bundle/_internal/stevedore-5.10.0.dist-info/licenses/AUTHORS +76 -0
  1395. package/bundle/_internal/stevedore-5.10.0.dist-info/licenses/LICENSE +202 -0
  1396. package/bundle/_internal/stevedore-5.10.0.dist-info/pbr.json +1 -0
  1397. package/bundle/_internal/stevedore-5.10.0.dist-info/top_level.txt +1 -0
  1398. package/bundle/_internal/tqdm-4.70.1.dist-info/INSTALLER +1 -0
  1399. package/bundle/_internal/tqdm-4.70.1.dist-info/METADATA +1600 -0
  1400. package/bundle/_internal/tqdm-4.70.1.dist-info/RECORD +72 -0
  1401. package/bundle/_internal/tqdm-4.70.1.dist-info/WHEEL +5 -0
  1402. package/bundle/_internal/tqdm-4.70.1.dist-info/entry_points.txt +2 -0
  1403. package/bundle/_internal/tqdm-4.70.1.dist-info/licenses/LICENCE +49 -0
  1404. package/bundle/_internal/tqdm-4.70.1.dist-info/top_level.txt +1 -0
  1405. package/bundle/_internal/yaml/_yaml.cpython-312-darwin.so +0 -0
  1406. package/bundle/gnost +0 -0
  1407. package/package.json +10 -7
@@ -0,0 +1,1748 @@
1
+ """Type inference constraints."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from collections.abc import Iterable, Sequence
6
+ from typing import TYPE_CHECKING, Final, TypeGuard, cast
7
+
8
+ import mypy.subtypes
9
+ import mypy.typeops
10
+ from mypy.argmap import ArgTypeExpander
11
+ from mypy.erasetype import erase_typevars
12
+ from mypy.expandtype import expand_type_by_instance
13
+ from mypy.maptype import map_instance_to_supertype
14
+ from mypy.nodes import (
15
+ ARG_OPT,
16
+ ARG_POS,
17
+ ARG_STAR,
18
+ ARG_STAR2,
19
+ CONTRAVARIANT,
20
+ COVARIANT,
21
+ ArgKind,
22
+ TypeInfo,
23
+ )
24
+ from mypy.types import (
25
+ MAX_PROTOCOL_DEPTH,
26
+ TUPLE_LIKE_INSTANCE_NAMES,
27
+ AnyType,
28
+ CallableType,
29
+ DeletedType,
30
+ ErasedType,
31
+ Instance,
32
+ LiteralType,
33
+ NoneType,
34
+ NormalizedCallableType,
35
+ Overloaded,
36
+ Parameters,
37
+ ParamSpecType,
38
+ PartialType,
39
+ ProperType,
40
+ TupleType,
41
+ Type,
42
+ TypeAliasType,
43
+ TypedDictType,
44
+ TypeOfAny,
45
+ TypeType,
46
+ TypeVarId,
47
+ TypeVarLikeType,
48
+ TypeVarTupleType,
49
+ TypeVarType,
50
+ TypeVisitor,
51
+ UnboundType,
52
+ UninhabitedType,
53
+ UnionType,
54
+ UnpackType,
55
+ find_unpack_in_list,
56
+ flatten_nested_tuples,
57
+ get_proper_type,
58
+ has_recursive_types,
59
+ has_type_vars,
60
+ is_named_instance,
61
+ split_with_prefix_and_suffix,
62
+ )
63
+ from mypy.types_utils import is_union_with_any
64
+ from mypy.typestate import type_state
65
+
66
+ if TYPE_CHECKING:
67
+ from mypy.infer import ArgumentInferContext
68
+
69
+ SUBTYPE_OF: Final = 0
70
+ SUPERTYPE_OF: Final = 1
71
+
72
+
73
+ class Constraint:
74
+ """A representation of a type constraint.
75
+
76
+ It can be either T <: type or T :> type (T is a type variable).
77
+ """
78
+
79
+ type_var: TypeVarId
80
+ op = 0 # SUBTYPE_OF or SUPERTYPE_OF
81
+ target: Type
82
+
83
+ def __init__(self, type_var: TypeVarLikeType, op: int, target: Type) -> None:
84
+ self.type_var = type_var.id
85
+ self.op = op
86
+ # TODO: should we add "assert not isinstance(target, UnpackType)"?
87
+ # UnpackType is a synthetic type, and is never valid as a constraint target.
88
+ self.target = target
89
+ self.origin_type_var = type_var
90
+ # These are additional type variables that should be solved for together with type_var.
91
+ # TODO: A cleaner solution may be to modify the return type of infer_constraints()
92
+ # to include these instead, but this is a rather big refactoring.
93
+ self.extra_tvars: list[TypeVarLikeType] = []
94
+
95
+ def __repr__(self) -> str:
96
+ op_str = "<:"
97
+ if self.op == SUPERTYPE_OF:
98
+ op_str = ":>"
99
+ return f"{self.type_var} {op_str} {self.target}"
100
+
101
+ def __hash__(self) -> int:
102
+ return hash((self.type_var, self.op, self.target))
103
+
104
+ def __eq__(self, other: object) -> bool:
105
+ if not isinstance(other, Constraint):
106
+ return False
107
+ return (self.type_var, self.op, self.target) == (other.type_var, other.op, other.target)
108
+
109
+
110
+ def infer_constraints_for_callable(
111
+ callee: CallableType,
112
+ arg_types: Sequence[Type | None],
113
+ arg_kinds: list[ArgKind],
114
+ arg_names: Sequence[str | None] | None,
115
+ formal_to_actual: list[list[int]],
116
+ context: ArgumentInferContext,
117
+ ) -> list[Constraint]:
118
+ """Infer type variable constraints for a callable and actual arguments.
119
+
120
+ Return a list of constraints.
121
+ """
122
+ constraints: list[Constraint] = []
123
+ mapper = ArgTypeExpander(context)
124
+
125
+ param_spec = callee.param_spec()
126
+ param_spec_arg_types = []
127
+ param_spec_arg_names = []
128
+ param_spec_arg_kinds: list[ArgKind] = []
129
+
130
+ incomplete_star_mapping = False
131
+ for i, actuals in enumerate(formal_to_actual): # TODO: isn't this `enumerate(arg_types)`?
132
+ for actual in actuals:
133
+ if actual is None and callee.arg_kinds[i] in (ARG_STAR, ARG_STAR2): # type: ignore[unreachable]
134
+ # We can't use arguments to infer ParamSpec constraint, if only some
135
+ # are present in the current inference pass.
136
+ incomplete_star_mapping = True # type: ignore[unreachable]
137
+ break
138
+
139
+ for i, actuals in enumerate(formal_to_actual):
140
+ if isinstance(callee.arg_types[i], UnpackType):
141
+ unpack_type = callee.arg_types[i]
142
+ assert isinstance(unpack_type, UnpackType)
143
+
144
+ # In this case we are binding all the actuals to *args,
145
+ # and we want a constraint that the typevar tuple being unpacked
146
+ # is equal to a type list of all the actuals.
147
+ actual_types = []
148
+
149
+ unpacked_type = get_proper_type(unpack_type.type)
150
+ if isinstance(unpacked_type, TypeVarTupleType):
151
+ tuple_instance = unpacked_type.tuple_fallback
152
+ elif isinstance(unpacked_type, TupleType):
153
+ tuple_instance = unpacked_type.partial_fallback
154
+ else:
155
+ assert False, "mypy bug: unhandled constraint inference case"
156
+
157
+ for actual in actuals:
158
+ actual_arg_type = arg_types[actual]
159
+ if actual_arg_type is None:
160
+ continue
161
+
162
+ expanded_actual = mapper.expand_actual_type(
163
+ actual_arg_type,
164
+ arg_kinds[actual],
165
+ callee.arg_names[i],
166
+ callee.arg_kinds[i],
167
+ allow_unpack=True,
168
+ )
169
+
170
+ if arg_kinds[actual] != ARG_STAR or isinstance(
171
+ get_proper_type(actual_arg_type), TupleType
172
+ ):
173
+ actual_types.append(expanded_actual)
174
+ else:
175
+ # If we are expanding an iterable inside * actual, append a homogeneous item instead
176
+ actual_types.append(
177
+ UnpackType(tuple_instance.copy_modified(args=[expanded_actual]))
178
+ )
179
+
180
+ if isinstance(unpacked_type, TypeVarTupleType):
181
+ constraints.append(
182
+ Constraint(
183
+ unpacked_type,
184
+ SUPERTYPE_OF,
185
+ TupleType(actual_types, unpacked_type.tuple_fallback),
186
+ )
187
+ )
188
+ elif isinstance(unpacked_type, TupleType):
189
+ # Prefixes get converted to positional args, so technically the only case we
190
+ # should have here is like Tuple[Unpack[Ts], Y1, Y2, Y3]. If this turns out
191
+ # not to hold we can always handle the prefixes too.
192
+ inner_unpack = unpacked_type.items[0]
193
+ assert isinstance(inner_unpack, UnpackType)
194
+ inner_unpacked_type = get_proper_type(inner_unpack.type)
195
+ suffix_len = len(unpacked_type.items) - 1
196
+ if isinstance(inner_unpacked_type, TypeVarTupleType):
197
+ # Variadic item can be either *Ts...
198
+ constraints.append(
199
+ Constraint(
200
+ inner_unpacked_type,
201
+ SUPERTYPE_OF,
202
+ TupleType(
203
+ actual_types[:-suffix_len], inner_unpacked_type.tuple_fallback
204
+ ),
205
+ )
206
+ )
207
+ else:
208
+ # ...or it can be a homogeneous tuple.
209
+ assert (
210
+ isinstance(inner_unpacked_type, Instance)
211
+ and inner_unpacked_type.type.fullname == "builtins.tuple"
212
+ )
213
+ for at in actual_types[:-suffix_len]:
214
+ constraints.extend(
215
+ infer_constraints(inner_unpacked_type.args[0], at, SUPERTYPE_OF)
216
+ )
217
+ # Now handle the suffix (if any).
218
+ if suffix_len:
219
+ for tt, at in zip(unpacked_type.items[1:], actual_types[-suffix_len:]):
220
+ constraints.extend(infer_constraints(tt, at, SUPERTYPE_OF))
221
+ else:
222
+ assert False, "mypy bug: unhandled constraint inference case"
223
+ else:
224
+ for actual in actuals:
225
+ actual_arg_type = arg_types[actual]
226
+ if actual_arg_type is None:
227
+ continue
228
+
229
+ if param_spec and callee.arg_kinds[i] in (ARG_STAR, ARG_STAR2):
230
+ # If actual arguments are mapped to ParamSpec type, we can't infer individual
231
+ # constraints, instead store them and infer single constraint at the end.
232
+ # It is impossible to map actual kind to formal kind, so use some heuristic.
233
+ # This inference is used as a fallback, so relying on heuristic should be OK.
234
+ if not incomplete_star_mapping:
235
+ param_spec_arg_types.append(
236
+ mapper.expand_actual_type(
237
+ actual_arg_type, arg_kinds[actual], None, arg_kinds[actual]
238
+ )
239
+ )
240
+ actual_kind = arg_kinds[actual]
241
+ param_spec_arg_kinds.append(
242
+ ARG_POS if actual_kind not in (ARG_STAR, ARG_STAR2) else actual_kind
243
+ )
244
+ param_spec_arg_names.append(arg_names[actual] if arg_names else None)
245
+ else:
246
+ actual_type = mapper.expand_actual_type(
247
+ actual_arg_type,
248
+ arg_kinds[actual],
249
+ callee.arg_names[i],
250
+ callee.arg_kinds[i],
251
+ )
252
+ c = infer_constraints(callee.arg_types[i], actual_type, SUPERTYPE_OF)
253
+ constraints.extend(c)
254
+ if (
255
+ param_spec
256
+ and not any(c.type_var == param_spec.id for c in constraints)
257
+ and not incomplete_star_mapping
258
+ ):
259
+ # Use ParamSpec constraint from arguments only if there are no other constraints,
260
+ # since as explained above it is quite ad-hoc.
261
+ constraints.append(
262
+ Constraint(
263
+ param_spec,
264
+ SUPERTYPE_OF,
265
+ Parameters(
266
+ arg_types=param_spec_arg_types,
267
+ arg_kinds=param_spec_arg_kinds,
268
+ arg_names=param_spec_arg_names,
269
+ imprecise_arg_kinds=True,
270
+ ),
271
+ )
272
+ )
273
+ if any(isinstance(v, ParamSpecType) for v in callee.variables):
274
+ # As a perf optimization filter imprecise constraints only when we can have them.
275
+ constraints = filter_imprecise_kinds(constraints)
276
+ return constraints
277
+
278
+
279
+ def infer_constraints(
280
+ template: Type,
281
+ actual: Type,
282
+ direction: int,
283
+ skip_neg_op: bool = False,
284
+ erase_types: bool = True,
285
+ ) -> list[Constraint]:
286
+ """Infer type constraints.
287
+
288
+ Match a template type, which may contain type variable references,
289
+ recursively against a type which does not contain (the same) type
290
+ variable references. The result is a list of type constrains of
291
+ form 'T is a supertype/subtype of x', where T is a type variable
292
+ present in the template and x is a type without reference to type
293
+ variables present in the template.
294
+
295
+ Assume T and S are type variables. Now the following results can be
296
+ calculated (read as '(template, actual) --> result'):
297
+
298
+ (T, X) --> T :> X
299
+ (X[T], X[Y]) --> T <: Y and T :> Y
300
+ ((T, T), (X, Y)) --> T :> X and T :> Y
301
+ ((T, S), (X, Y)) --> T :> X and S :> Y
302
+ (X[T], Any) --> T <: Any and T :> Any
303
+
304
+ The constraints are represented as Constraint objects. If skip_neg_op == True,
305
+ then skip adding reverse (polymorphic) constraints (since this is already a call
306
+ to infer such constraints).
307
+ """
308
+ if any(
309
+ get_proper_type(template) == get_proper_type(t)
310
+ and get_proper_type(actual) == get_proper_type(a)
311
+ for (t, a) in reversed(type_state.inferring)
312
+ ):
313
+ return []
314
+ if has_recursive_types(template) or isinstance(get_proper_type(template), Instance):
315
+ # This case requires special care because it may cause infinite recursion.
316
+ # Note that we include Instances because the may be recursive as str(Sequence[str]).
317
+ if not has_type_vars(template):
318
+ # Return early on an empty branch.
319
+ return []
320
+ type_state.inferring.append((template, actual))
321
+ res = _infer_constraints(template, actual, direction, skip_neg_op, erase_types)
322
+ type_state.inferring.pop()
323
+ return res
324
+ return _infer_constraints(template, actual, direction, skip_neg_op, erase_types)
325
+
326
+
327
+ def _infer_constraints(
328
+ template: Type, actual: Type, direction: int, skip_neg_op: bool, erase_types: bool
329
+ ) -> list[Constraint]:
330
+ orig_template = template
331
+ template = get_proper_type(template)
332
+ actual = get_proper_type(actual)
333
+
334
+ # Type inference shouldn't be affected by whether union types have been simplified.
335
+ # We however keep any ErasedType items, so that the caller will see it when using
336
+ # checkexpr.has_erased_component().
337
+ if not type_state.keep_unions and isinstance(template, UnionType):
338
+ template = mypy.typeops.make_simplified_union(template.items, keep_erased=True)
339
+ if not type_state.keep_unions and isinstance(actual, UnionType):
340
+ actual = mypy.typeops.make_simplified_union(actual.items, keep_erased=True)
341
+
342
+ # Ignore Any types from the type suggestion engine to avoid them
343
+ # causing us to infer Any in situations where a better job could
344
+ # be done otherwise. (This can produce false positives but that
345
+ # doesn't really matter because it is all heuristic anyway.)
346
+ if isinstance(actual, AnyType) and actual.type_of_any == TypeOfAny.suggestion_engine:
347
+ return []
348
+
349
+ # type[A | B] is always represented as type[A] | type[B] internally.
350
+ # This makes our constraint solver choke on type[T] <: type[A] | type[B],
351
+ # solving T as generic meet(A, B) which is often `object`. Force unwrap such unions
352
+ # if both sides are type[...] or unions thereof. See `testTypeVarType` test
353
+ type_type_unwrapped = False
354
+ if _is_type_type(template) and _is_type_type(actual):
355
+ type_type_unwrapped = True
356
+ template = _unwrap_type_type(template)
357
+ actual = _unwrap_type_type(actual)
358
+
359
+ # If the template is simply a type variable, emit a Constraint directly.
360
+ # We need to handle this case before handling Unions for two reasons:
361
+ # 1. "T <: Union[U1, U2]" is not equivalent to "T <: U1 or T <: U2",
362
+ # because T can itself be a union (notably, Union[U1, U2] itself).
363
+ # 2. "T :> Union[U1, U2]" is logically equivalent to "T :> U1 and
364
+ # T :> U2", but they are not equivalent to the constraint solver,
365
+ # which never introduces new Union types (it uses join() instead).
366
+ if isinstance(template, TypeVarType):
367
+ return [Constraint(template, direction, actual)]
368
+
369
+ if (
370
+ isinstance(actual, TypeVarType)
371
+ and not actual.id.is_meta_var()
372
+ and direction == SUPERTYPE_OF
373
+ ):
374
+ # Unless template is also a type variable (or a union that contains one), using the upper
375
+ # bound for inference will usually give better result for actual that is a type variable.
376
+ if not isinstance(template, UnionType) or not any(
377
+ isinstance(t, TypeVarType) for t in template.items
378
+ ):
379
+ actual = get_proper_type(actual.upper_bound)
380
+
381
+ # Now handle the case of either template or actual being a Union.
382
+ # For a Union to be a subtype of another type, every item of the Union
383
+ # must be a subtype of that type, so concatenate the constraints.
384
+ if direction == SUBTYPE_OF and isinstance(template, UnionType):
385
+ res = []
386
+ for t_item in template.items:
387
+ res.extend(infer_constraints(t_item, actual, direction))
388
+ return res
389
+ if direction == SUPERTYPE_OF and isinstance(actual, UnionType):
390
+ res = []
391
+ for a_item in actual.items:
392
+ # `orig_template` has to be preserved intact in case it's recursive.
393
+ # If we unwrapped ``type[...]`` previously, wrap the item back again,
394
+ # as ``type[...]`` can't be removed from `orig_template`.
395
+ if type_type_unwrapped:
396
+ a_item = TypeType.make_normalized(a_item)
397
+ res.extend(infer_constraints(orig_template, a_item, direction))
398
+ return res
399
+
400
+ # Now the potential subtype is known not to be a Union or a type
401
+ # variable that we are solving for. In that case, for a Union to
402
+ # be a supertype of the potential subtype, some item of the Union
403
+ # must be a supertype of it.
404
+ if direction == SUBTYPE_OF and isinstance(actual, UnionType):
405
+ # We infer constraints eagerly -- try to find constraints for a type
406
+ # variable if possible. This seems to help with some real-world
407
+ # use cases.
408
+ return any_constraints(
409
+ [
410
+ infer_constraints_if_possible(template, a_item, direction)
411
+ for a_item in actual.items
412
+ ],
413
+ eager=True,
414
+ )
415
+ if direction == SUPERTYPE_OF and isinstance(template, UnionType):
416
+ # When the template is a union, we are okay with leaving some
417
+ # type variables indeterminate. This helps with some special
418
+ # cases, though this isn't very principled.
419
+ result = any_constraints(
420
+ [
421
+ infer_constraints_if_possible(t_item, actual, direction)
422
+ for t_item in template.items
423
+ ],
424
+ eager=isinstance(actual, AnyType),
425
+ )
426
+ if result:
427
+ return result
428
+ elif has_recursive_types(template) and not has_recursive_types(actual):
429
+ return handle_recursive_union(template, actual, direction)
430
+ return []
431
+
432
+ # Remaining cases are handled by ConstraintBuilderVisitor.
433
+ return template.accept(ConstraintBuilderVisitor(actual, direction, skip_neg_op, erase_types))
434
+
435
+
436
+ def _is_type_type(tp: ProperType) -> TypeGuard[TypeType | UnionType]:
437
+ """Is ``tp`` a ``type[...]`` or a union thereof?
438
+
439
+ ``Type[A | B]`` is internally represented as ``type[A] | type[B]``, and this
440
+ troubles the solver sometimes.
441
+ """
442
+ return (
443
+ isinstance(tp, TypeType)
444
+ or isinstance(tp, UnionType)
445
+ and all(isinstance(get_proper_type(o), TypeType) for o in tp.items)
446
+ )
447
+
448
+
449
+ def _unwrap_type_type(tp: TypeType | UnionType) -> ProperType:
450
+ """Extract the inner type from ``type[...]`` expression or a union thereof."""
451
+ if isinstance(tp, TypeType):
452
+ return tp.item
453
+ return UnionType.make_union([cast(TypeType, get_proper_type(o)).item for o in tp.items])
454
+
455
+
456
+ def infer_constraints_if_possible(
457
+ template: Type, actual: Type, direction: int
458
+ ) -> list[Constraint] | None:
459
+ """Like infer_constraints, but return None if the input relation is
460
+ known to be unsatisfiable, for example if template=List[T] and actual=int.
461
+ (In this case infer_constraints would return [], just like it would for
462
+ an automatically satisfied relation like template=List[T] and actual=object.)
463
+ """
464
+ if direction == SUBTYPE_OF and not mypy.subtypes.is_subtype(erase_typevars(template), actual):
465
+ return None
466
+ if direction == SUPERTYPE_OF and not mypy.subtypes.is_subtype(
467
+ actual, erase_typevars(template)
468
+ ):
469
+ return None
470
+ if (
471
+ direction == SUPERTYPE_OF
472
+ and isinstance(template, TypeVarType)
473
+ and not mypy.subtypes.is_subtype(actual, erase_typevars(template.upper_bound))
474
+ ):
475
+ # This is not caught by the above branch because of the erase_typevars() call,
476
+ # that would return 'Any' for a type variable.
477
+ return None
478
+ return infer_constraints(template, actual, direction)
479
+
480
+
481
+ def select_trivial(options: Sequence[list[Constraint] | None]) -> list[list[Constraint]]:
482
+ """Select only those lists where each item is a constraint against Any."""
483
+ res = []
484
+ for option in options:
485
+ if option is None:
486
+ continue
487
+ if all(isinstance(get_proper_type(c.target), AnyType) for c in option):
488
+ res.append(option)
489
+ return res
490
+
491
+
492
+ def merge_with_any(constraint: Constraint) -> Constraint:
493
+ """Transform a constraint target into a union with given Any type."""
494
+ target = constraint.target
495
+ if is_union_with_any(target):
496
+ # Do not produce redundant unions.
497
+ return constraint
498
+ # TODO: if we will support multiple sources Any, use this here instead.
499
+ any_type = AnyType(TypeOfAny.implementation_artifact)
500
+ return Constraint(
501
+ constraint.origin_type_var,
502
+ constraint.op,
503
+ UnionType.make_union([target, any_type], target.line, target.column),
504
+ )
505
+
506
+
507
+ def handle_recursive_union(template: UnionType, actual: Type, direction: int) -> list[Constraint]:
508
+ # This is a hack to special-case things like Union[T, Inst[T]] in recursive types. Although
509
+ # it is quite arbitrary, it is a relatively common pattern, so we should handle it well.
510
+ # This function may be called when inferring against such union resulted in different
511
+ # constraints for each item. Normally we give up in such case, but here we instead split
512
+ # the union in two parts, and try inferring sequentially.
513
+ non_type_var_items = [t for t in template.items if not isinstance(t, TypeVarType)]
514
+ type_var_items = [t for t in template.items if isinstance(t, TypeVarType)]
515
+ return infer_constraints(
516
+ UnionType.make_union(non_type_var_items), actual, direction
517
+ ) or infer_constraints(UnionType.make_union(type_var_items), actual, direction)
518
+
519
+
520
+ def any_constraints(options: list[list[Constraint] | None], *, eager: bool) -> list[Constraint]:
521
+ """Deduce what we can from a collection of constraint lists.
522
+
523
+ It's a given that at least one of the lists must be satisfied. A
524
+ None element in the list of options represents an unsatisfiable
525
+ constraint and is ignored. Ignore empty constraint lists if eager
526
+ is true -- they are always trivially satisfiable.
527
+ """
528
+ if eager:
529
+ valid_options = [option for option in options if option]
530
+ else:
531
+ valid_options = [option for option in options if option is not None]
532
+
533
+ if not valid_options:
534
+ return []
535
+
536
+ if len(valid_options) == 1:
537
+ return valid_options[0]
538
+
539
+ if all(is_same_constraints(valid_options[0], c) for c in valid_options[1:]):
540
+ # Multiple sets of constraints that are all the same. Just pick any one of them.
541
+ return valid_options[0]
542
+
543
+ if all(is_similar_constraints(valid_options[0], c) for c in valid_options[1:]):
544
+ # All options have same structure. In this case we can merge-in trivial
545
+ # options (i.e. those that only have Any) and try again.
546
+ # TODO: More generally, if a given (variable, direction) pair appears in
547
+ # every option, combine the bounds with meet/join always, not just for Any.
548
+ trivial_options = select_trivial(valid_options)
549
+ if trivial_options and len(trivial_options) < len(valid_options):
550
+ merged_options = []
551
+ for option in valid_options:
552
+ if option in trivial_options:
553
+ continue
554
+ merged_options.append([merge_with_any(c) for c in option])
555
+ return any_constraints(list(merged_options), eager=eager)
556
+
557
+ # If normal logic didn't work, try excluding trivially unsatisfiable constraint (due to
558
+ # upper bounds) from each option, and comparing them again.
559
+ filtered_options = [filter_satisfiable(o) for o in options]
560
+ if filtered_options != options:
561
+ return any_constraints(filtered_options, eager=eager)
562
+
563
+ # Try harder: if that didn't work, try to strip typevars that aren't meta vars.
564
+ # Note this is what we would always do, but unfortunately some callers may not
565
+ # set the meta var status correctly (for historical reasons), so we use this as
566
+ # a fallback only.
567
+ filtered_options = [exclude_non_meta_vars(o) for o in options]
568
+ if filtered_options != options:
569
+ return any_constraints(filtered_options, eager=eager)
570
+
571
+ # Otherwise, there are either no valid options or multiple, inconsistent valid
572
+ # options. Give up and deduce nothing.
573
+ return []
574
+
575
+
576
+ def filter_satisfiable(option: list[Constraint] | None) -> list[Constraint] | None:
577
+ """Keep only constraints that can possibly be satisfied.
578
+
579
+ Currently, we filter out constraints where target is not a subtype of the upper bound.
580
+ Since those can be never satisfied. We may add more cases in future if it improves type
581
+ inference.
582
+ """
583
+ if not option:
584
+ return option
585
+
586
+ satisfiable = []
587
+ for c in option:
588
+ if isinstance(c.origin_type_var, TypeVarType) and c.origin_type_var.values:
589
+ if any(
590
+ mypy.subtypes.is_subtype(c.target, value) for value in c.origin_type_var.values
591
+ ):
592
+ satisfiable.append(c)
593
+ elif mypy.subtypes.is_subtype(c.target, c.origin_type_var.upper_bound):
594
+ satisfiable.append(c)
595
+ if not satisfiable:
596
+ return None
597
+ return satisfiable
598
+
599
+
600
+ def exclude_non_meta_vars(option: list[Constraint] | None) -> list[Constraint] | None:
601
+ # If we had an empty list, keep it intact
602
+ if not option:
603
+ return option
604
+ # However, if none of the options actually references meta vars, better remove
605
+ # this constraint entirely.
606
+ return [c for c in option if c.type_var.is_meta_var()] or None
607
+
608
+
609
+ def is_same_constraints(x: list[Constraint], y: list[Constraint]) -> bool:
610
+ for c1 in x:
611
+ if not any(is_same_constraint(c1, c2) for c2 in y):
612
+ return False
613
+ for c1 in y:
614
+ if not any(is_same_constraint(c1, c2) for c2 in x):
615
+ return False
616
+ return True
617
+
618
+
619
+ def is_same_constraint(c1: Constraint, c2: Constraint) -> bool:
620
+ # Ignore direction when comparing constraints against Any.
621
+ skip_op_check = isinstance(get_proper_type(c1.target), AnyType) and isinstance(
622
+ get_proper_type(c2.target), AnyType
623
+ )
624
+ return (
625
+ c1.type_var == c2.type_var
626
+ and (c1.op == c2.op or skip_op_check)
627
+ and mypy.subtypes.is_same_type(c1.target, c2.target)
628
+ )
629
+
630
+
631
+ def is_similar_constraints(x: list[Constraint], y: list[Constraint]) -> bool:
632
+ """Check that two lists of constraints have similar structure.
633
+
634
+ This means that each list has same type variable plus direction pairs (i.e we
635
+ ignore the target). Except for constraints where target is Any type, there
636
+ we ignore direction as well.
637
+ """
638
+ return _is_similar_constraints(x, y) and _is_similar_constraints(y, x)
639
+
640
+
641
+ def _is_similar_constraints(x: list[Constraint], y: list[Constraint]) -> bool:
642
+ """Check that every constraint in the first list has a similar one in the second.
643
+
644
+ See docstring above for definition of similarity.
645
+ """
646
+ for c1 in x:
647
+ has_similar = False
648
+ for c2 in y:
649
+ # Ignore direction when either constraint is against Any.
650
+ skip_op_check = isinstance(get_proper_type(c1.target), AnyType) or isinstance(
651
+ get_proper_type(c2.target), AnyType
652
+ )
653
+ if c1.type_var == c2.type_var and (c1.op == c2.op or skip_op_check):
654
+ has_similar = True
655
+ break
656
+ if not has_similar:
657
+ return False
658
+ return True
659
+
660
+
661
+ class ConstraintBuilderVisitor(TypeVisitor[list[Constraint]]):
662
+ """Visitor class for inferring type constraints."""
663
+
664
+ # The type that is compared against a template
665
+ # TODO: The value may be None. Is that actually correct?
666
+ actual: ProperType
667
+
668
+ def __init__(
669
+ self, actual: ProperType, direction: int, skip_neg_op: bool, erase_types: bool
670
+ ) -> None:
671
+ # Direction must be SUBTYPE_OF or SUPERTYPE_OF.
672
+ self.actual = actual
673
+ self.direction = direction
674
+ # Whether to skip polymorphic inference (involves inference in opposite direction)
675
+ # this is used to prevent infinite recursion when both template and actual are
676
+ # generic callables.
677
+ self.skip_neg_op = skip_neg_op
678
+ # Normally we should erase generic actual type when inferring against type[T]
679
+ # to avoid leaking type variables, see testGenericClassAsArgumentToType.
680
+ # The only exception is self-types in generic classes, where we set this to False.
681
+ self.erase_types = erase_types
682
+
683
+ # Trivial leaf types
684
+
685
+ def visit_unbound_type(self, template: UnboundType) -> list[Constraint]:
686
+ return []
687
+
688
+ def visit_any(self, template: AnyType) -> list[Constraint]:
689
+ return []
690
+
691
+ def visit_none_type(self, template: NoneType) -> list[Constraint]:
692
+ return []
693
+
694
+ def visit_uninhabited_type(self, template: UninhabitedType) -> list[Constraint]:
695
+ return []
696
+
697
+ def visit_erased_type(self, template: ErasedType) -> list[Constraint]:
698
+ return []
699
+
700
+ def visit_deleted_type(self, template: DeletedType) -> list[Constraint]:
701
+ return []
702
+
703
+ def visit_literal_type(self, template: LiteralType) -> list[Constraint]:
704
+ return []
705
+
706
+ # Errors
707
+
708
+ def visit_partial_type(self, template: PartialType) -> list[Constraint]:
709
+ # We can't do anything useful with a partial type here.
710
+ assert False, "Internal error"
711
+
712
+ # Non-trivial leaf type
713
+
714
+ def visit_type_var(self, template: TypeVarType) -> list[Constraint]:
715
+ assert False, (
716
+ "Unexpected TypeVarType in ConstraintBuilderVisitor"
717
+ " (should have been handled in infer_constraints)"
718
+ )
719
+
720
+ def visit_param_spec(self, template: ParamSpecType) -> list[Constraint]:
721
+ # Can't infer ParamSpecs from component values (only via Callable[P, T]).
722
+ return []
723
+
724
+ def visit_type_var_tuple(self, template: TypeVarTupleType) -> list[Constraint]:
725
+ raise NotImplementedError
726
+
727
+ def visit_unpack_type(self, template: UnpackType) -> list[Constraint]:
728
+ raise RuntimeError("Mypy bug: unpack should be handled at a higher level.")
729
+
730
+ def visit_parameters(self, template: Parameters) -> list[Constraint]:
731
+ # Constraining Any against C[P] turns into infer_against_any([P], Any)
732
+ if isinstance(self.actual, AnyType):
733
+ return self.infer_against_any(template.arg_types, self.actual)
734
+ if type_state.infer_polymorphic and isinstance(self.actual, Parameters):
735
+ # For polymorphic inference we need to be able to infer secondary constraints
736
+ # in situations like [x: T] <: P <: [x: int].
737
+ return infer_callable_arguments_constraints(template, self.actual, self.direction)
738
+ if type_state.infer_polymorphic and isinstance(self.actual, ParamSpecType):
739
+ # Similar for [x: T] <: Q <: Concatenate[int, P].
740
+ return infer_callable_arguments_constraints(
741
+ template, self.actual.prefix, self.direction
742
+ )
743
+ # There also may be unpatched types after a user error, simply ignore them.
744
+ return []
745
+
746
+ # Non-leaf types
747
+
748
+ def visit_instance(self, template: Instance) -> list[Constraint]:
749
+ original_actual = actual = self.actual
750
+ res: list[Constraint] = []
751
+ if isinstance(actual, (CallableType, Overloaded)) and template.type.is_protocol:
752
+ if "__call__" in template.type.protocol_members:
753
+ # Special case: a generic callback protocol
754
+ if len(template.type.inferring) < MAX_PROTOCOL_DEPTH and not any(
755
+ template == t for t in template.type.inferring
756
+ ):
757
+ template.type.inferring.append(template)
758
+ call = mypy.subtypes.find_member(
759
+ "__call__", template, actual, is_operator=True
760
+ )
761
+ assert call is not None
762
+ if (
763
+ self.direction == SUPERTYPE_OF
764
+ and mypy.subtypes.is_subtype(actual, erase_typevars(call))
765
+ or self.direction == SUBTYPE_OF
766
+ and mypy.subtypes.is_subtype(erase_typevars(call), actual)
767
+ ):
768
+ res.extend(infer_constraints(call, actual, self.direction))
769
+ template.type.inferring.pop()
770
+ if isinstance(actual, CallableType) and actual.fallback is not None:
771
+ if (
772
+ actual.is_type_obj()
773
+ and template.type.is_protocol
774
+ and self.direction == SUPERTYPE_OF
775
+ ):
776
+ instance_type = actual.get_instance_type(force_fallback=True)
777
+ if isinstance(instance_type, Instance):
778
+ res.extend(
779
+ self.infer_constraints_from_protocol_members(
780
+ instance_type, template, instance_type, template, class_obj=True
781
+ )
782
+ )
783
+ actual = actual.fallback
784
+ if isinstance(actual, TypeType) and template.type.is_protocol:
785
+ if self.direction == SUPERTYPE_OF:
786
+ a_item = actual.item
787
+ if isinstance(a_item, Instance):
788
+ res.extend(
789
+ self.infer_constraints_from_protocol_members(
790
+ a_item, template, a_item, template, class_obj=True
791
+ )
792
+ )
793
+ # Infer constraints for Type[T] via metaclass of T when it makes sense.
794
+ if isinstance(a_item, TypeVarType):
795
+ a_item = get_proper_type(a_item.upper_bound)
796
+ if isinstance(a_item, Instance) and a_item.type.metaclass_type:
797
+ res.extend(
798
+ self.infer_constraints_from_protocol_members(
799
+ a_item.type.metaclass_type, template, actual, template
800
+ )
801
+ )
802
+
803
+ if isinstance(actual, Overloaded) and actual.fallback is not None:
804
+ actual = actual.fallback
805
+ if isinstance(actual, TypedDictType):
806
+ actual = actual.create_anonymous_fallback()
807
+ if isinstance(actual, LiteralType):
808
+ actual = actual.fallback
809
+ if isinstance(actual, Instance):
810
+ instance = actual
811
+ erased = erase_typevars(template)
812
+ assert isinstance(erased, ProperType) and isinstance(erased, Instance)
813
+ # We always try nominal inference if possible,
814
+ # it is much faster than the structural one.
815
+ if self.direction == SUBTYPE_OF and template.type.has_base(instance.type.fullname):
816
+ mapped = map_instance_to_supertype(template, instance.type)
817
+ tvars = mapped.type.defn.type_vars
818
+
819
+ if instance.type.has_type_var_tuple_type:
820
+ # Variadic types need special handling to map each type argument to
821
+ # the correct corresponding type variable.
822
+ assert instance.type.type_var_tuple_prefix is not None
823
+ assert instance.type.type_var_tuple_suffix is not None
824
+ prefix_len = instance.type.type_var_tuple_prefix
825
+ suffix_len = instance.type.type_var_tuple_suffix
826
+ tvt = instance.type.defn.type_vars[prefix_len]
827
+ assert isinstance(tvt, TypeVarTupleType)
828
+ fallback = tvt.tuple_fallback
829
+ i_prefix, i_middle, i_suffix = split_with_prefix_and_suffix(
830
+ instance.args, prefix_len, suffix_len
831
+ )
832
+ m_prefix, m_middle, m_suffix = split_with_prefix_and_suffix(
833
+ mapped.args, prefix_len, suffix_len
834
+ )
835
+ instance_args = i_prefix + (TupleType(list(i_middle), fallback),) + i_suffix
836
+ mapped_args = m_prefix + (TupleType(list(m_middle), fallback),) + m_suffix
837
+ else:
838
+ mapped_args = mapped.args
839
+ instance_args = instance.args
840
+
841
+ # N.B: We use zip instead of indexing because the lengths might have
842
+ # mismatches during daemon reprocessing.
843
+ for tvar, mapped_arg, instance_arg in zip(tvars, mapped_args, instance_args):
844
+ if isinstance(tvar, TypeVarType):
845
+ # The constraints for generic type parameters depend on variance.
846
+ # Include constraints from both directions if invariant.
847
+ if tvar.variance != CONTRAVARIANT:
848
+ res.extend(infer_constraints(mapped_arg, instance_arg, self.direction))
849
+ if tvar.variance != COVARIANT:
850
+ res.extend(
851
+ infer_constraints(mapped_arg, instance_arg, neg_op(self.direction))
852
+ )
853
+ elif isinstance(tvar, ParamSpecType) and isinstance(mapped_arg, ParamSpecType):
854
+ prefix = mapped_arg.prefix
855
+ if isinstance(instance_arg, Parameters):
856
+ # No such thing as variance for ParamSpecs, consider them invariant
857
+ # TODO: constraints between prefixes using
858
+ # infer_callable_arguments_constraints()
859
+ suffix: Type = instance_arg.copy_modified(
860
+ instance_arg.arg_types[len(prefix.arg_types) :],
861
+ instance_arg.arg_kinds[len(prefix.arg_kinds) :],
862
+ instance_arg.arg_names[len(prefix.arg_names) :],
863
+ )
864
+ res.append(Constraint(mapped_arg, SUBTYPE_OF, suffix))
865
+ res.append(Constraint(mapped_arg, SUPERTYPE_OF, suffix))
866
+ elif isinstance(instance_arg, ParamSpecType):
867
+ suffix = instance_arg.copy_modified(
868
+ prefix=Parameters(
869
+ instance_arg.prefix.arg_types[len(prefix.arg_types) :],
870
+ instance_arg.prefix.arg_kinds[len(prefix.arg_kinds) :],
871
+ instance_arg.prefix.arg_names[len(prefix.arg_names) :],
872
+ )
873
+ )
874
+ res.append(Constraint(mapped_arg, SUBTYPE_OF, suffix))
875
+ res.append(Constraint(mapped_arg, SUPERTYPE_OF, suffix))
876
+ elif isinstance(tvar, TypeVarTupleType):
877
+ # Handle variadic type variables covariantly for consistency.
878
+ res.extend(infer_constraints(mapped_arg, instance_arg, self.direction))
879
+
880
+ return res
881
+ elif self.direction == SUPERTYPE_OF and instance.type.has_base(template.type.fullname):
882
+ mapped = map_instance_to_supertype(instance, template.type)
883
+ tvars = template.type.defn.type_vars
884
+ if template.type.has_type_var_tuple_type:
885
+ # Variadic types need special handling to map each type argument to
886
+ # the correct corresponding type variable.
887
+ assert template.type.type_var_tuple_prefix is not None
888
+ assert template.type.type_var_tuple_suffix is not None
889
+ prefix_len = template.type.type_var_tuple_prefix
890
+ suffix_len = template.type.type_var_tuple_suffix
891
+ tvt = template.type.defn.type_vars[prefix_len]
892
+ assert isinstance(tvt, TypeVarTupleType)
893
+ fallback = tvt.tuple_fallback
894
+ t_prefix, t_middle, t_suffix = split_with_prefix_and_suffix(
895
+ template.args, prefix_len, suffix_len
896
+ )
897
+ m_prefix, m_middle, m_suffix = split_with_prefix_and_suffix(
898
+ mapped.args, prefix_len, suffix_len
899
+ )
900
+ template_args = t_prefix + (TupleType(list(t_middle), fallback),) + t_suffix
901
+ mapped_args = m_prefix + (TupleType(list(m_middle), fallback),) + m_suffix
902
+ else:
903
+ mapped_args = mapped.args
904
+ template_args = template.args
905
+ # N.B: We use zip instead of indexing because the lengths might have
906
+ # mismatches during daemon reprocessing.
907
+ for tvar, mapped_arg, template_arg in zip(tvars, mapped_args, template_args):
908
+ if isinstance(tvar, TypeVarType):
909
+ # The constraints for generic type parameters depend on variance.
910
+ # Include constraints from both directions if invariant.
911
+ if tvar.variance != CONTRAVARIANT:
912
+ res.extend(infer_constraints(template_arg, mapped_arg, self.direction))
913
+ if tvar.variance != COVARIANT:
914
+ res.extend(
915
+ infer_constraints(template_arg, mapped_arg, neg_op(self.direction))
916
+ )
917
+ elif isinstance(tvar, ParamSpecType) and isinstance(
918
+ template_arg, ParamSpecType
919
+ ):
920
+ prefix = template_arg.prefix
921
+ if isinstance(mapped_arg, Parameters):
922
+ # No such thing as variance for ParamSpecs, consider them invariant
923
+ # TODO: constraints between prefixes using
924
+ # infer_callable_arguments_constraints()
925
+ suffix = mapped_arg.copy_modified(
926
+ mapped_arg.arg_types[len(prefix.arg_types) :],
927
+ mapped_arg.arg_kinds[len(prefix.arg_kinds) :],
928
+ mapped_arg.arg_names[len(prefix.arg_names) :],
929
+ )
930
+ res.append(Constraint(template_arg, SUBTYPE_OF, suffix))
931
+ res.append(Constraint(template_arg, SUPERTYPE_OF, suffix))
932
+ elif isinstance(mapped_arg, ParamSpecType):
933
+ suffix = mapped_arg.copy_modified(
934
+ prefix=Parameters(
935
+ mapped_arg.prefix.arg_types[len(prefix.arg_types) :],
936
+ mapped_arg.prefix.arg_kinds[len(prefix.arg_kinds) :],
937
+ mapped_arg.prefix.arg_names[len(prefix.arg_names) :],
938
+ )
939
+ )
940
+ res.append(Constraint(template_arg, SUBTYPE_OF, suffix))
941
+ res.append(Constraint(template_arg, SUPERTYPE_OF, suffix))
942
+ elif isinstance(tvar, TypeVarTupleType):
943
+ # Consider variadic type variables to be invariant.
944
+ res.extend(infer_constraints(template_arg, mapped_arg, SUBTYPE_OF))
945
+ res.extend(infer_constraints(template_arg, mapped_arg, SUPERTYPE_OF))
946
+ return res
947
+ if (
948
+ template.type.is_protocol
949
+ and self.direction == SUPERTYPE_OF
950
+ and len(template.type.inferring) < MAX_PROTOCOL_DEPTH
951
+ and
952
+ # We avoid infinite recursion for structural subtypes by checking
953
+ # whether this type already appeared in the inference chain.
954
+ # This is a conservative way to break the inference cycles.
955
+ # It never produces any "false" constraints but gives up soon
956
+ # on purely structural inference cycles, see #3829.
957
+ # Note that we use is_protocol_implementation instead of is_subtype
958
+ # because some type may be considered a subtype of a protocol
959
+ # due to _promote, but still not implement the protocol.
960
+ not any(template == t for t in reversed(template.type.inferring))
961
+ and mypy.subtypes.is_protocol_implementation(instance, erased, skip=["__call__"])
962
+ ):
963
+ template.type.inferring.append(template)
964
+ res.extend(
965
+ self.infer_constraints_from_protocol_members(
966
+ instance, template, original_actual, template
967
+ )
968
+ )
969
+ template.type.inferring.pop()
970
+ return res
971
+ elif (
972
+ instance.type.is_protocol
973
+ and self.direction == SUBTYPE_OF
974
+ and len(instance.type.inferring) < MAX_PROTOCOL_DEPTH
975
+ and
976
+ # We avoid infinite recursion for structural subtypes also here.
977
+ not any(instance == i for i in reversed(instance.type.inferring))
978
+ and mypy.subtypes.is_protocol_implementation(erased, instance, skip=["__call__"])
979
+ ):
980
+ instance.type.inferring.append(instance)
981
+ res.extend(
982
+ self.infer_constraints_from_protocol_members(
983
+ instance, template, template, instance
984
+ )
985
+ )
986
+ instance.type.inferring.pop()
987
+ return res
988
+ if res:
989
+ return res
990
+
991
+ if isinstance(actual, AnyType):
992
+ return self.infer_against_any(template.args, actual)
993
+ if (
994
+ isinstance(actual, TupleType)
995
+ and is_named_instance(template, TUPLE_LIKE_INSTANCE_NAMES)
996
+ and self.direction == SUPERTYPE_OF
997
+ ):
998
+ for item in actual.items:
999
+ if isinstance(item, UnpackType):
1000
+ unpacked = get_proper_type(item.type)
1001
+ if isinstance(unpacked, TypeVarTupleType):
1002
+ # Cannot infer anything for T from [T, ...] <: *Ts
1003
+ continue
1004
+ assert (
1005
+ isinstance(unpacked, Instance)
1006
+ and unpacked.type.fullname == "builtins.tuple"
1007
+ )
1008
+ item = unpacked.args[0]
1009
+ cb = infer_constraints(template.args[0], item, SUPERTYPE_OF)
1010
+ res.extend(cb)
1011
+ return res
1012
+ elif isinstance(actual, TupleType) and self.direction == SUPERTYPE_OF:
1013
+ instance = mypy.typeops.tuple_fallback(actual)
1014
+ erased = erase_typevars(template)
1015
+ assert isinstance(erased, ProperType) and isinstance(erased, Instance)
1016
+ # Special-case protocols before using fallback to get more precise constraints
1017
+ # for custom tuple types like NamedTuples.
1018
+ if (
1019
+ template.type.is_protocol
1020
+ and self.direction == SUPERTYPE_OF
1021
+ and len(template.type.inferring) < MAX_PROTOCOL_DEPTH
1022
+ and not any(template == t for t in reversed(template.type.inferring))
1023
+ and mypy.subtypes.is_protocol_implementation(instance, erased, skip=["__call__"])
1024
+ ):
1025
+ template.type.inferring.append(template)
1026
+ res = self.infer_constraints_from_protocol_members(
1027
+ instance, template, original_actual, template
1028
+ )
1029
+ template.type.inferring.pop()
1030
+ return res
1031
+ return infer_constraints(template, instance, self.direction)
1032
+ elif isinstance(actual, TypeVarType):
1033
+ if not actual.values and not actual.id.is_meta_var():
1034
+ return infer_constraints(template, actual.upper_bound, self.direction)
1035
+ return []
1036
+ elif isinstance(actual, ParamSpecType):
1037
+ return infer_constraints(template, actual.upper_bound, self.direction)
1038
+ elif isinstance(actual, TypeVarTupleType):
1039
+ raise NotImplementedError
1040
+ else:
1041
+ return []
1042
+
1043
+ def infer_constraints_from_protocol_members(
1044
+ self,
1045
+ instance: Instance,
1046
+ template: Instance,
1047
+ subtype: Type,
1048
+ protocol: Instance,
1049
+ class_obj: bool = False,
1050
+ ) -> list[Constraint]:
1051
+ """Infer constraints for situations where either 'template' or 'instance' is a protocol.
1052
+
1053
+ The 'protocol' is the one of two that is an instance of protocol type, 'subtype'
1054
+ is the type used to bind self during inference. Currently, we just infer constrains for
1055
+ every protocol member type (both ways for settable members).
1056
+ """
1057
+ res = []
1058
+ for member in protocol.type.protocol_members:
1059
+ inst = mypy.subtypes.find_member(member, instance, subtype, class_obj=class_obj)
1060
+ temp = mypy.subtypes.find_member(member, template, subtype)
1061
+ if inst is None or temp is None:
1062
+ if member == "__call__":
1063
+ continue
1064
+ return [] # See #11020
1065
+ # The above is safe since at this point we know that 'instance' is a subtype
1066
+ # of (erased) 'template', therefore it defines all protocol members
1067
+ if class_obj:
1068
+ # For class objects we must only infer constraints if possible, otherwise it
1069
+ # can lead to confusion between class and instance, for example StrEnum is
1070
+ # Iterable[str] for an instance, but Iterable[StrEnum] for a class object.
1071
+ if not mypy.subtypes.is_subtype(
1072
+ inst, erase_typevars(temp), ignore_pos_arg_names=True
1073
+ ):
1074
+ continue
1075
+ # This exception matches the one in typeops.py, see PR #14121 for context.
1076
+ if member == "__call__" and instance.type.is_metaclass(precise=True):
1077
+ continue
1078
+ res.extend(infer_constraints(temp, inst, self.direction))
1079
+ if mypy.subtypes.IS_SETTABLE in mypy.subtypes.get_member_flags(member, protocol):
1080
+ # Settable members are invariant, add opposite constraints
1081
+ res.extend(infer_constraints(temp, inst, neg_op(self.direction)))
1082
+ return res
1083
+
1084
+ def visit_callable_type(self, template: CallableType) -> list[Constraint]:
1085
+ # Normalize callables before matching against each other.
1086
+ # Note that non-normalized callables can be created in annotations
1087
+ # using e.g. callback protocols.
1088
+ # TODO: check that callables match? Ideally we should not infer constraints
1089
+ # callables that can never be subtypes of one another in given direction.
1090
+ template = template.with_unpacked_kwargs().with_normalized_var_args()
1091
+ extra_tvars = False
1092
+ if isinstance(self.actual, CallableType):
1093
+ res: list[Constraint] = []
1094
+ cactual = self.actual.with_unpacked_kwargs().with_normalized_var_args()
1095
+ param_spec = template.param_spec()
1096
+
1097
+ template_ret_type, cactual_ret_type = template.ret_type, cactual.ret_type
1098
+ if template.type_guard is not None and cactual.type_guard is not None:
1099
+ template_ret_type = template.type_guard
1100
+ cactual_ret_type = cactual.type_guard
1101
+
1102
+ if template.type_is is not None and cactual.type_is is not None:
1103
+ template_ret_type = template.type_is
1104
+ cactual_ret_type = cactual.type_is
1105
+
1106
+ res.extend(infer_constraints(template_ret_type, cactual_ret_type, self.direction))
1107
+
1108
+ if param_spec is None:
1109
+ # TODO: Erase template variables if it is generic?
1110
+ if (
1111
+ type_state.infer_polymorphic
1112
+ and cactual.variables
1113
+ and not self.skip_neg_op
1114
+ # Technically, the correct inferred type for application of e.g.
1115
+ # Callable[..., T] -> Callable[..., T] (with literal ellipsis), to a generic
1116
+ # like U -> U, should be Callable[..., Any], but if U is a self-type, we can
1117
+ # allow it to leak, to be later bound to self. A bunch of existing code
1118
+ # depends on this old behaviour.
1119
+ and not (
1120
+ any(tv.id.is_self() for tv in cactual.variables)
1121
+ and template.is_ellipsis_args
1122
+ )
1123
+ ):
1124
+ # If the actual callable is generic, infer constraints in the opposite
1125
+ # direction, and indicate to the solver there are extra type variables
1126
+ # to solve for (see more details in mypy/solve.py).
1127
+ res.extend(
1128
+ infer_constraints(
1129
+ cactual, template, neg_op(self.direction), skip_neg_op=True
1130
+ )
1131
+ )
1132
+ extra_tvars = True
1133
+
1134
+ # We can't infer constraints from arguments if the template is Callable[..., T]
1135
+ # (with literal '...').
1136
+ if not template.is_ellipsis_args:
1137
+ unpack_present = find_unpack_in_list(template.arg_types)
1138
+ # When both ParamSpec and TypeVarTuple are present, things become messy
1139
+ # quickly. For now, we only allow ParamSpec to "capture" TypeVarTuple,
1140
+ # but not vice versa.
1141
+ # TODO: infer more from prefixes when possible.
1142
+ if unpack_present is not None and not cactual.param_spec():
1143
+ # We need to re-normalize args to the form they appear in tuples,
1144
+ # for callables we always pack the suffix inside another tuple.
1145
+ unpack = template.arg_types[unpack_present]
1146
+ assert isinstance(unpack, UnpackType)
1147
+ tuple_type = get_tuple_fallback_from_unpack(unpack)
1148
+ template_types = repack_callable_args(template, tuple_type)
1149
+ actual_types = repack_callable_args(cactual, tuple_type)
1150
+ # Now we can use the same general helper as for tuple types.
1151
+ unpack_constraints = build_constraints_for_simple_unpack(
1152
+ template_types, actual_types, neg_op(self.direction)
1153
+ )
1154
+ res.extend(unpack_constraints)
1155
+ else:
1156
+ # TODO: do we need some special-casing when unpack is present in actual
1157
+ # callable but not in template callable?
1158
+ res.extend(
1159
+ infer_callable_arguments_constraints(template, cactual, self.direction)
1160
+ )
1161
+ else:
1162
+ prefix = param_spec.prefix
1163
+ prefix_len = len(prefix.arg_types)
1164
+ cactual_ps = cactual.param_spec()
1165
+
1166
+ if type_state.infer_polymorphic and cactual.variables and not self.skip_neg_op:
1167
+ # Similar logic to the branch above.
1168
+ res.extend(
1169
+ infer_constraints(
1170
+ cactual, template, neg_op(self.direction), skip_neg_op=True
1171
+ )
1172
+ )
1173
+ extra_tvars = True
1174
+
1175
+ # Compare prefixes as well
1176
+ cactual_prefix = cactual.copy_modified(
1177
+ arg_types=cactual.arg_types[:prefix_len],
1178
+ arg_kinds=cactual.arg_kinds[:prefix_len],
1179
+ arg_names=cactual.arg_names[:prefix_len],
1180
+ )
1181
+ res.extend(
1182
+ infer_callable_arguments_constraints(prefix, cactual_prefix, self.direction)
1183
+ )
1184
+
1185
+ param_spec_target: Type | None = None
1186
+ if not cactual_ps:
1187
+ max_prefix_len = len([k for k in cactual.arg_kinds if k in (ARG_POS, ARG_OPT)])
1188
+ prefix_len = min(prefix_len, max_prefix_len)
1189
+ param_spec_target = Parameters(
1190
+ arg_types=cactual.arg_types[prefix_len:],
1191
+ arg_kinds=cactual.arg_kinds[prefix_len:],
1192
+ arg_names=cactual.arg_names[prefix_len:],
1193
+ variables=cactual.variables if not type_state.infer_polymorphic else [],
1194
+ imprecise_arg_kinds=cactual.imprecise_arg_kinds,
1195
+ )
1196
+ else:
1197
+ if len(param_spec.prefix.arg_types) <= len(cactual_ps.prefix.arg_types):
1198
+ param_spec_target = cactual_ps.copy_modified(
1199
+ prefix=Parameters(
1200
+ arg_types=cactual_ps.prefix.arg_types[prefix_len:],
1201
+ arg_kinds=cactual_ps.prefix.arg_kinds[prefix_len:],
1202
+ arg_names=cactual_ps.prefix.arg_names[prefix_len:],
1203
+ imprecise_arg_kinds=cactual_ps.prefix.imprecise_arg_kinds,
1204
+ )
1205
+ )
1206
+ if param_spec_target is not None:
1207
+ res.append(Constraint(param_spec, self.direction, param_spec_target))
1208
+ if extra_tvars:
1209
+ for c in res:
1210
+ c.extra_tvars += cactual.variables
1211
+ return res
1212
+ elif isinstance(self.actual, AnyType):
1213
+ param_spec = template.param_spec()
1214
+ any_type = AnyType(TypeOfAny.from_another_any, source_any=self.actual)
1215
+ if param_spec is None:
1216
+ # FIX what if generic
1217
+ res = self.infer_against_any(template.arg_types, self.actual)
1218
+ else:
1219
+ res = [
1220
+ Constraint(
1221
+ param_spec,
1222
+ SUBTYPE_OF,
1223
+ Parameters([any_type, any_type], [ARG_STAR, ARG_STAR2], [None, None]),
1224
+ )
1225
+ ]
1226
+ res.extend(infer_constraints(template.ret_type, any_type, self.direction))
1227
+ return res
1228
+ elif isinstance(self.actual, Overloaded):
1229
+ return self.infer_against_overloaded(self.actual, template)
1230
+ elif isinstance(self.actual, TypeType):
1231
+ # This matches the corresponding logic in subtypes.py.
1232
+ item = self.actual.item
1233
+ if isinstance(item, TupleType):
1234
+ item = mypy.typeops.tuple_fallback(item)
1235
+ if isinstance(item, Instance):
1236
+ constructor = mypy.typeops.type_object_type(item.type)
1237
+ constructor = expand_type_by_instance(constructor, item)
1238
+ # Only consider return type to match historic behavior (see below).
1239
+ if isinstance(constructor, CallableType):
1240
+ return infer_constraints(
1241
+ template.ret_type, constructor.ret_type, self.direction
1242
+ )
1243
+ elif isinstance(constructor, Overloaded):
1244
+ return self.infer_against_overloaded(constructor, template, ret_only=True)
1245
+ return infer_constraints(template.ret_type, self.actual.item, self.direction)
1246
+ elif isinstance(self.actual, Instance):
1247
+ # Instances with __call__ method defined are considered structural
1248
+ # subtypes of Callable with a compatible signature.
1249
+ call = mypy.subtypes.find_member(
1250
+ "__call__", self.actual, self.actual, is_operator=True
1251
+ )
1252
+ if call:
1253
+ return infer_constraints(template, call, self.direction)
1254
+ else:
1255
+ return []
1256
+ else:
1257
+ return []
1258
+
1259
+ def infer_against_overloaded(
1260
+ self, overloaded: Overloaded, template: CallableType, ret_only: bool = False
1261
+ ) -> list[Constraint]:
1262
+ # Create constraints by matching an overloaded type against a template.
1263
+ # This is tricky to do in general. We cheat by only matching against
1264
+ # the first overload item that is callable compatible. This
1265
+ # seems to work somewhat well, but we should really use a more
1266
+ # reliable technique.
1267
+ item = find_matching_overload_item(overloaded, template)
1268
+ if ret_only:
1269
+ return infer_constraints(template.ret_type, item.ret_type, self.direction)
1270
+ return infer_constraints(template, item, self.direction)
1271
+
1272
+ def visit_tuple_type(self, template: TupleType) -> list[Constraint]:
1273
+ actual = self.actual
1274
+ unpack_index = find_unpack_in_list(template.items)
1275
+ # TODO: we may need to be careful with direction to avoid spurious constraints.
1276
+ is_varlength_tuple = isinstance(actual, Instance) and actual.type.has_base(
1277
+ "builtins.tuple"
1278
+ )
1279
+
1280
+ if isinstance(actual, TupleType) or is_varlength_tuple:
1281
+ res: list[Constraint] = []
1282
+ if unpack_index is not None:
1283
+ if is_varlength_tuple:
1284
+ # Variadic tuple can be only a supertype of a tuple type, but even if
1285
+ # direction is opposite, inferring something may give better error messages.
1286
+ unpack_type = template.items[unpack_index]
1287
+ assert isinstance(unpack_type, UnpackType)
1288
+ unpacked_type = get_proper_type(unpack_type.type)
1289
+ assert isinstance(actual, Instance) # ensured by is_varlength_tuple == True
1290
+ mapped = map_instance_to_supertype(
1291
+ actual, actual.type.get_base("builtins.tuple")
1292
+ )
1293
+ if isinstance(unpacked_type, TypeVarTupleType):
1294
+ res = [
1295
+ Constraint(type_var=unpacked_type, op=self.direction, target=mapped)
1296
+ ]
1297
+ else:
1298
+ assert (
1299
+ isinstance(unpacked_type, Instance)
1300
+ and unpacked_type.type.fullname == "builtins.tuple"
1301
+ )
1302
+ res = infer_constraints(unpacked_type, mapped, self.direction)
1303
+ for i, ti in enumerate(template.items):
1304
+ if i == unpack_index:
1305
+ # This one we just handled above.
1306
+ continue
1307
+ # For Tuple[T, *Ts, S] <: tuple[X, ...] infer also T <: X and S <: X.
1308
+ res.extend(infer_constraints(ti, mapped.args[0], self.direction))
1309
+ return res
1310
+ else:
1311
+ assert isinstance(actual, TupleType)
1312
+ unpack_constraints = build_constraints_for_simple_unpack(
1313
+ template.items, actual.items, self.direction
1314
+ )
1315
+ actual_items: tuple[Type, ...] = ()
1316
+ template_items: tuple[Type, ...] = ()
1317
+ res.extend(unpack_constraints)
1318
+ elif isinstance(actual, TupleType):
1319
+ a_unpack_index = find_unpack_in_list(actual.items)
1320
+ if a_unpack_index is not None:
1321
+ # The case where template tuple doesn't have an unpack, but actual tuple
1322
+ # has an unpack. We can infer something if actual unpack is a variadic tuple.
1323
+ # Tuple[T, S, U] <: tuple[X, *tuple[Y, ...], Z] => T <: X, S <: Y, U <: Z.
1324
+ a_unpack = actual.items[a_unpack_index]
1325
+ assert isinstance(a_unpack, UnpackType)
1326
+ a_unpacked = get_proper_type(a_unpack.type)
1327
+ if len(actual.items) <= len(template.items) + 1:
1328
+ a_prefix_len = a_unpack_index
1329
+ a_suffix_len = len(actual.items) - a_unpack_index - 1
1330
+ t_prefix, t_middle, t_suffix = split_with_prefix_and_suffix(
1331
+ tuple(template.items), a_prefix_len, a_suffix_len
1332
+ )
1333
+ actual_items = tuple(actual.items[:a_prefix_len])
1334
+ if a_suffix_len:
1335
+ actual_items += tuple(actual.items[-a_suffix_len:])
1336
+ template_items = t_prefix + t_suffix
1337
+ if isinstance(a_unpacked, Instance):
1338
+ assert a_unpacked.type.fullname == "builtins.tuple"
1339
+ for tm in t_middle:
1340
+ res.extend(
1341
+ infer_constraints(tm, a_unpacked.args[0], self.direction)
1342
+ )
1343
+ else:
1344
+ actual_items = ()
1345
+ template_items = ()
1346
+ else:
1347
+ actual_items = tuple(actual.items)
1348
+ template_items = tuple(template.items)
1349
+ else:
1350
+ return res
1351
+
1352
+ # Cases above will return if actual wasn't a TupleType.
1353
+ assert isinstance(actual, TupleType)
1354
+ if len(actual_items) == len(template_items):
1355
+ if (
1356
+ actual.partial_fallback.type.is_named_tuple
1357
+ and template.partial_fallback.type.is_named_tuple
1358
+ ):
1359
+ # For named tuples using just the fallbacks usually gives better results.
1360
+ return res + infer_constraints(
1361
+ template.partial_fallback, actual.partial_fallback, self.direction
1362
+ )
1363
+ for i in range(len(template_items)):
1364
+ res.extend(
1365
+ infer_constraints(template_items[i], actual_items[i], self.direction)
1366
+ )
1367
+ res.extend(
1368
+ infer_constraints(
1369
+ template.partial_fallback, actual.partial_fallback, self.direction
1370
+ )
1371
+ )
1372
+ return res
1373
+ elif isinstance(actual, AnyType):
1374
+ return self.infer_against_any(template.items, actual)
1375
+ else:
1376
+ return []
1377
+
1378
+ def visit_typeddict_type(self, template: TypedDictType) -> list[Constraint]:
1379
+ actual = self.actual
1380
+ if isinstance(actual, TypedDictType):
1381
+ res: list[Constraint] = []
1382
+ # NOTE: Non-matching keys are ignored. Compatibility is checked
1383
+ # elsewhere so this shouldn't be unsafe.
1384
+ for item_name, template_item_type, actual_item_type in template.zip(actual):
1385
+ res.extend(infer_constraints(template_item_type, actual_item_type, self.direction))
1386
+ return res
1387
+ elif isinstance(actual, AnyType):
1388
+ return self.infer_against_any(template.items.values(), actual)
1389
+ else:
1390
+ return []
1391
+
1392
+ def visit_union_type(self, template: UnionType) -> list[Constraint]:
1393
+ assert False, (
1394
+ "Unexpected UnionType in ConstraintBuilderVisitor"
1395
+ " (should have been handled in infer_constraints)"
1396
+ )
1397
+
1398
+ def visit_type_alias_type(self, template: TypeAliasType) -> list[Constraint]:
1399
+ assert False, f"This should be never called, got {template}"
1400
+
1401
+ def infer_against_any(self, types: Iterable[Type], any_type: AnyType) -> list[Constraint]:
1402
+ res: list[Constraint] = []
1403
+ # Some items may be things like `*Tuple[*Ts, T]` for example from callable types with
1404
+ # suffix after *arg, so flatten them.
1405
+ for t in flatten_nested_tuples(types):
1406
+ if isinstance(t, UnpackType):
1407
+ if isinstance(t.type, TypeVarTupleType):
1408
+ res.append(Constraint(t.type, self.direction, any_type))
1409
+ else:
1410
+ unpacked = get_proper_type(t.type)
1411
+ assert isinstance(unpacked, Instance)
1412
+ res.extend(infer_constraints(unpacked, any_type, self.direction))
1413
+ else:
1414
+ # Note that we ignore variance and simply always use the
1415
+ # original direction. This is because for Any targets direction is
1416
+ # irrelevant in most cases, see e.g. is_same_constraint().
1417
+ res.extend(infer_constraints(t, any_type, self.direction))
1418
+ return res
1419
+
1420
+ def visit_overloaded(self, template: Overloaded) -> list[Constraint]:
1421
+ if isinstance(self.actual, CallableType):
1422
+ items = find_matching_overload_items(template, self.actual)
1423
+ else:
1424
+ items = template.items
1425
+ res: list[Constraint] = []
1426
+ for t in items:
1427
+ res.extend(infer_constraints(t, self.actual, self.direction))
1428
+ return res
1429
+
1430
+ def visit_type_type(self, template: TypeType) -> list[Constraint]:
1431
+ if isinstance(self.actual, CallableType):
1432
+ if self.actual.is_type_obj():
1433
+ instance_type = self.actual.get_instance_type()
1434
+ if self.erase_types:
1435
+ instance_type = erase_typevars(instance_type)
1436
+ return infer_constraints(template.item, instance_type, self.direction)
1437
+ return infer_constraints(template.item, self.actual.ret_type, self.direction)
1438
+ elif isinstance(self.actual, Overloaded):
1439
+ if self.actual.is_type_obj():
1440
+ instance_type = self.actual.items[0].get_instance_type()
1441
+ if self.erase_types:
1442
+ instance_type = erase_typevars(instance_type)
1443
+ return infer_constraints(template.item, instance_type, self.direction)
1444
+ return infer_constraints(template.item, self.actual.items[0].ret_type, self.direction)
1445
+ elif isinstance(self.actual, TypeType):
1446
+ return infer_constraints(template.item, self.actual.item, self.direction)
1447
+ elif isinstance(self.actual, AnyType):
1448
+ return infer_constraints(template.item, self.actual, self.direction)
1449
+ else:
1450
+ return []
1451
+
1452
+
1453
+ def neg_op(op: int) -> int:
1454
+ """Map SubtypeOf to SupertypeOf and vice versa."""
1455
+
1456
+ if op == SUBTYPE_OF:
1457
+ return SUPERTYPE_OF
1458
+ elif op == SUPERTYPE_OF:
1459
+ return SUBTYPE_OF
1460
+ else:
1461
+ raise ValueError(f"Invalid operator {op}")
1462
+
1463
+
1464
+ def find_matching_overload_item(overloaded: Overloaded, template: CallableType) -> CallableType:
1465
+ """Disambiguate overload item against a template."""
1466
+ items = overloaded.items
1467
+ for item in items:
1468
+ # Return type may be indeterminate in the template, so ignore it when performing a
1469
+ # subtype check.
1470
+ if mypy.subtypes.is_callable_compatible(
1471
+ item,
1472
+ template,
1473
+ is_compat=mypy.subtypes.is_subtype,
1474
+ is_proper_subtype=False,
1475
+ ignore_return=True,
1476
+ ):
1477
+ return item
1478
+ # Fall back to the first item if we can't find a match. This is totally arbitrary --
1479
+ # maybe we should just bail out at this point.
1480
+ return items[0]
1481
+
1482
+
1483
+ def find_matching_overload_items(
1484
+ overloaded: Overloaded, template: CallableType
1485
+ ) -> list[CallableType]:
1486
+ """Like find_matching_overload_item, but return all matches, not just the first."""
1487
+ items = overloaded.items
1488
+ res = []
1489
+ for item in items:
1490
+ # Return type may be indeterminate in the template, so ignore it when performing a
1491
+ # subtype check.
1492
+ if mypy.subtypes.is_callable_compatible(
1493
+ item,
1494
+ template,
1495
+ is_compat=mypy.subtypes.is_subtype,
1496
+ is_proper_subtype=False,
1497
+ ignore_return=True,
1498
+ ):
1499
+ res.append(item)
1500
+ if not res:
1501
+ # Falling back to all items if we can't find a match is pretty arbitrary, but
1502
+ # it maintains backward compatibility.
1503
+ res = items.copy()
1504
+ return res
1505
+
1506
+
1507
+ def get_tuple_fallback_from_unpack(unpack: UnpackType) -> TypeInfo:
1508
+ """Get builtins.tuple type from available types to construct homogeneous tuples."""
1509
+ tp = get_proper_type(unpack.type)
1510
+ if isinstance(tp, Instance) and tp.type.fullname == "builtins.tuple":
1511
+ return tp.type
1512
+ if isinstance(tp, TypeVarTupleType):
1513
+ return tp.tuple_fallback.type
1514
+ if isinstance(tp, TupleType):
1515
+ for base in tp.partial_fallback.type.mro:
1516
+ if base.fullname == "builtins.tuple":
1517
+ return base
1518
+ assert False, "Invalid unpack type"
1519
+
1520
+
1521
+ def repack_callable_args(callable: CallableType, tuple_type: TypeInfo) -> list[Type]:
1522
+ """Present callable with star unpack in a normalized form.
1523
+
1524
+ Since positional arguments cannot follow star argument, they are packed in a suffix,
1525
+ while prefix is represented as individual positional args. We want to put all in a single
1526
+ list with unpack in the middle, and prefix/suffix on the sides (as they would appear
1527
+ in e.g. a TupleType).
1528
+ """
1529
+ if ARG_STAR not in callable.arg_kinds:
1530
+ return callable.arg_types
1531
+ star_index = callable.arg_kinds.index(ARG_STAR)
1532
+ arg_types = callable.arg_types[:star_index]
1533
+ star_type = callable.arg_types[star_index]
1534
+ suffix_types = []
1535
+ if not isinstance(star_type, UnpackType):
1536
+ # Re-normalize *args: X -> *args: *tuple[X, ...]
1537
+ star_type = UnpackType(Instance(tuple_type, [star_type]))
1538
+ else:
1539
+ tp = get_proper_type(star_type.type)
1540
+ if isinstance(tp, TupleType):
1541
+ assert isinstance(tp.items[0], UnpackType)
1542
+ star_type = tp.items[0]
1543
+ suffix_types = tp.items[1:]
1544
+ return arg_types + [star_type] + suffix_types
1545
+
1546
+
1547
+ def build_constraints_for_simple_unpack(
1548
+ template_args: list[Type], actual_args: list[Type], direction: int
1549
+ ) -> list[Constraint]:
1550
+ """Infer constraints between two lists of types with variadic items.
1551
+
1552
+ This function is only supposed to be called when a variadic item is present in templates.
1553
+ If there is no variadic item the actuals, we simply use split_with_prefix_and_suffix()
1554
+ and infer prefix <: prefix, suffix <: suffix, variadic <: middle. If there is a variadic
1555
+ item in the actuals we need to be more careful, only common prefix/suffix can generate
1556
+ constraints, also we can only infer constraints for variadic template item, if template
1557
+ prefix/suffix are shorter that actual ones, otherwise there may be partial overlap
1558
+ between variadic items, for example if template prefix is longer:
1559
+
1560
+ templates: T1, T2, Ts, Ts, Ts, ...
1561
+ actuals: A1, As, As, As, ...
1562
+
1563
+ Note: this function can only be called for builtin variadic constructors: Tuple and Callable.
1564
+ For instances, you should first find correct type argument mapping.
1565
+ """
1566
+ template_unpack = find_unpack_in_list(template_args)
1567
+ assert template_unpack is not None
1568
+ template_prefix = template_unpack
1569
+ template_suffix = len(template_args) - template_prefix - 1
1570
+
1571
+ t_unpack = None
1572
+ res = []
1573
+
1574
+ actual_unpack = find_unpack_in_list(actual_args)
1575
+ if actual_unpack is None:
1576
+ t_unpack = template_args[template_unpack]
1577
+ if template_prefix + template_suffix > len(actual_args):
1578
+ # These can't be subtypes of each-other, return fast.
1579
+ assert isinstance(t_unpack, UnpackType)
1580
+ if isinstance(t_unpack.type, TypeVarTupleType):
1581
+ # Set TypeVarTuple to empty to improve error messages.
1582
+ return [
1583
+ Constraint(
1584
+ t_unpack.type, direction, TupleType([], t_unpack.type.tuple_fallback)
1585
+ )
1586
+ ]
1587
+ else:
1588
+ return []
1589
+ common_prefix = template_prefix
1590
+ common_suffix = template_suffix
1591
+ else:
1592
+ actual_prefix = actual_unpack
1593
+ actual_suffix = len(actual_args) - actual_prefix - 1
1594
+ common_prefix = min(template_prefix, actual_prefix)
1595
+ common_suffix = min(template_suffix, actual_suffix)
1596
+ if actual_prefix >= template_prefix and actual_suffix >= template_suffix:
1597
+ # This is the only case where we can guarantee there will be no partial overlap
1598
+ # (note however partial overlap is OK for variadic tuples, it is handled below).
1599
+ t_unpack = template_args[template_unpack]
1600
+ else:
1601
+ # A special case for a variadic actual tuple unpack, we can infer T <: X from
1602
+ # tuple[..., *tuple[T, ...], ...] <: tuple[..., *tuple[X, ...], ...] etc.
1603
+ actual_unpack_type = actual_args[actual_unpack]
1604
+ assert isinstance(actual_unpack_type, UnpackType)
1605
+ a_unpacked = get_proper_type(actual_unpack_type.type)
1606
+ if isinstance(a_unpacked, Instance) and a_unpacked.type.fullname == "builtins.tuple":
1607
+ t_unpack = template_args[template_unpack]
1608
+ # In this case we can "eat away" as much as we need.
1609
+ common_prefix = template_prefix
1610
+ common_suffix = template_suffix
1611
+
1612
+ # Handle constraints from prefixes/suffixes first.
1613
+ start, middle, end = split_with_prefix_and_suffix(
1614
+ tuple(actual_args), common_prefix, common_suffix
1615
+ )
1616
+ for t, a in zip(template_args[:common_prefix], start):
1617
+ res.extend(infer_constraints(t, a, direction))
1618
+ if common_suffix:
1619
+ for t, a in zip(template_args[-common_suffix:], end):
1620
+ res.extend(infer_constraints(t, a, direction))
1621
+
1622
+ if t_unpack is not None:
1623
+ # Add constraint(s) for variadic item when possible.
1624
+ assert isinstance(t_unpack, UnpackType)
1625
+ tp = get_proper_type(t_unpack.type)
1626
+ if isinstance(tp, Instance) and tp.type.fullname == "builtins.tuple":
1627
+ # Homogeneous case *tuple[T, ...] <: [X, Y, Z, ...].
1628
+ for a in middle:
1629
+ # TODO: should we use union instead of join here?
1630
+ if not isinstance(a, UnpackType):
1631
+ res.extend(infer_constraints(tp.args[0], a, direction))
1632
+ else:
1633
+ a_tp = get_proper_type(a.type)
1634
+ # This is the case *tuple[T, ...] <: *tuple[A, ...].
1635
+ if isinstance(a_tp, Instance) and a_tp.type.fullname == "builtins.tuple":
1636
+ res.extend(infer_constraints(tp.args[0], a_tp.args[0], direction))
1637
+ elif isinstance(tp, TypeVarTupleType):
1638
+ res.append(Constraint(tp, direction, TupleType(list(middle), tp.tuple_fallback)))
1639
+ return res
1640
+
1641
+
1642
+ def infer_directed_arg_constraints(left: Type, right: Type, direction: int) -> list[Constraint]:
1643
+ """Infer constraints between two arguments using direction between original callables."""
1644
+ if isinstance(left, (ParamSpecType, UnpackType)) or isinstance(
1645
+ right, (ParamSpecType, UnpackType)
1646
+ ):
1647
+ # This avoids bogus constraints like T <: P.args
1648
+ # TODO: can we infer something useful for *T vs P?
1649
+ return []
1650
+ if direction == SUBTYPE_OF:
1651
+ # We invert direction to account for argument contravariance.
1652
+ return infer_constraints(left, right, neg_op(direction))
1653
+ else:
1654
+ return infer_constraints(right, left, neg_op(direction))
1655
+
1656
+
1657
+ def infer_callable_arguments_constraints(
1658
+ template: NormalizedCallableType | Parameters,
1659
+ actual: NormalizedCallableType | Parameters,
1660
+ direction: int,
1661
+ ) -> list[Constraint]:
1662
+ """Infer constraints between argument types of two callables.
1663
+
1664
+ This function essentially extracts four steps from are_parameters_compatible() in
1665
+ subtypes.py that involve subtype checks between argument types. We keep the argument
1666
+ matching logic, but ignore various strictness flags present there, and checks that
1667
+ do not involve subtyping. Then in place of every subtype check we put an infer_constraints()
1668
+ call for the same types.
1669
+ """
1670
+ res = []
1671
+ if direction == SUBTYPE_OF:
1672
+ left, right = template, actual
1673
+ else:
1674
+ left, right = actual, template
1675
+ left_star = left.var_arg()
1676
+ left_star2 = left.kw_arg()
1677
+ right_star = right.var_arg()
1678
+ right_star2 = right.kw_arg()
1679
+
1680
+ # Numbering of steps below matches the one in are_parameters_compatible() for convenience.
1681
+ # Phase 1a: compare star vs star arguments.
1682
+ if left_star is not None and right_star is not None:
1683
+ res.extend(infer_directed_arg_constraints(left_star.typ, right_star.typ, direction))
1684
+ if left_star2 is not None and right_star2 is not None:
1685
+ res.extend(infer_directed_arg_constraints(left_star2.typ, right_star2.typ, direction))
1686
+
1687
+ # Phase 1b: compare left args with corresponding non-star right arguments.
1688
+ for right_arg in right.formal_arguments():
1689
+ left_arg = mypy.typeops.callable_corresponding_argument(left, right_arg)
1690
+ if left_arg is None:
1691
+ continue
1692
+ res.extend(infer_directed_arg_constraints(left_arg.typ, right_arg.typ, direction))
1693
+
1694
+ # Phase 1c: compare left args with right *args.
1695
+ if right_star is not None:
1696
+ right_by_position = right.try_synthesizing_arg_from_vararg(None)
1697
+ assert right_by_position is not None
1698
+ i = right_star.pos
1699
+ assert i is not None
1700
+ while i < len(left.arg_kinds) and left.arg_kinds[i].is_positional():
1701
+ left_by_position = left.argument_by_position(i)
1702
+ assert left_by_position is not None
1703
+ res.extend(
1704
+ infer_directed_arg_constraints(
1705
+ left_by_position.typ, right_by_position.typ, direction
1706
+ )
1707
+ )
1708
+ i += 1
1709
+
1710
+ # Phase 1d: compare left args with right **kwargs.
1711
+ if right_star2 is not None:
1712
+ right_names = {name for name in right.arg_names if name is not None}
1713
+ left_only_names = set()
1714
+ for name, kind in zip(left.arg_names, left.arg_kinds):
1715
+ if name is None or kind.is_star() or name in right_names:
1716
+ continue
1717
+ left_only_names.add(name)
1718
+
1719
+ right_by_name = right.try_synthesizing_arg_from_kwarg(None)
1720
+ assert right_by_name is not None
1721
+ for name in left_only_names:
1722
+ left_by_name = left.argument_by_name(name)
1723
+ assert left_by_name is not None
1724
+ res.extend(
1725
+ infer_directed_arg_constraints(left_by_name.typ, right_by_name.typ, direction)
1726
+ )
1727
+ return res
1728
+
1729
+
1730
+ def filter_imprecise_kinds(cs: list[Constraint]) -> list[Constraint]:
1731
+ """For each ParamSpec remove all imprecise constraints, if at least one precise available."""
1732
+ have_precise = set()
1733
+ for c in cs:
1734
+ if not isinstance(c.origin_type_var, ParamSpecType):
1735
+ continue
1736
+ if (
1737
+ isinstance(c.target, ParamSpecType)
1738
+ or isinstance(c.target, Parameters)
1739
+ and not c.target.imprecise_arg_kinds
1740
+ ):
1741
+ have_precise.add(c.type_var)
1742
+ new_cs = []
1743
+ for c in cs:
1744
+ if not isinstance(c.origin_type_var, ParamSpecType) or c.type_var not in have_precise:
1745
+ new_cs.append(c)
1746
+ if not isinstance(c.target, Parameters) or not c.target.imprecise_arg_kinds:
1747
+ new_cs.append(c)
1748
+ return new_cs