jaclang 0.6.0__py3-none-any.whl → 0.6.2__py3-none-any.whl

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 (913) hide show
  1. jaclang/cli/.gitignore +3 -0
  2. jaclang/cli/cli.md +190 -0
  3. jaclang/cli/cli.py +90 -3
  4. jaclang/cli/cmdreg.py +18 -6
  5. jaclang/compiler/.gitignore +1 -0
  6. jaclang/compiler/absyntree.py +1 -2
  7. jaclang/compiler/parser.py +1 -1
  8. jaclang/compiler/passes/main/def_impl_match_pass.py +4 -1
  9. jaclang/compiler/passes/main/fuse_typeinfo_pass.py +10 -7
  10. jaclang/compiler/passes/main/import_pass.py +39 -22
  11. jaclang/compiler/passes/main/pyast_gen_pass.py +6 -57
  12. jaclang/compiler/passes/main/pyjac_ast_link_pass.py +218 -0
  13. jaclang/compiler/passes/main/schedules.py +2 -0
  14. jaclang/compiler/passes/main/sym_tab_build_pass.py +9 -3
  15. jaclang/compiler/passes/main/tests/fixtures/autoimpl.impl/getme.impl.jac +3 -0
  16. jaclang/compiler/passes/main/tests/fixtures/autoimpl.impl.jac +3 -0
  17. jaclang/compiler/passes/main/tests/fixtures/autoimpl.jac +9 -0
  18. jaclang/compiler/passes/main/tests/fixtures/autoimpl.something.else.impl.jac +3 -0
  19. jaclang/compiler/passes/main/tests/fixtures/base.jac +13 -0
  20. jaclang/compiler/passes/main/tests/fixtures/base2.jac +14 -0
  21. jaclang/compiler/passes/main/tests/fixtures/blip.jac +2 -0
  22. jaclang/compiler/passes/main/tests/fixtures/codegentext.jac +31 -0
  23. jaclang/compiler/passes/main/tests/fixtures/decls.jac +10 -0
  24. jaclang/compiler/passes/main/tests/fixtures/defs_and_uses.jac +44 -0
  25. jaclang/compiler/passes/main/tests/fixtures/fstrings.jac +4 -0
  26. jaclang/compiler/passes/main/tests/fixtures/func.jac +18 -0
  27. jaclang/compiler/passes/main/tests/fixtures/func2.jac +8 -0
  28. jaclang/compiler/passes/main/tests/fixtures/game1.jac +15 -0
  29. jaclang/compiler/passes/main/tests/fixtures/impl/defs1.jac +8 -0
  30. jaclang/compiler/passes/main/tests/fixtures/impl/defs2.jac +8 -0
  31. jaclang/compiler/passes/main/tests/fixtures/impl/imps.jac +11 -0
  32. jaclang/compiler/passes/main/tests/fixtures/multi_def_err.jac +7 -0
  33. jaclang/compiler/passes/main/tests/fixtures/registry.jac +36 -0
  34. jaclang/compiler/passes/main/tests/test_import_pass.py +11 -0
  35. jaclang/compiler/passes/tool/tests/fixtures/corelib.jac +480 -0
  36. jaclang/compiler/passes/tool/tests/fixtures/corelib_fmt.jac +480 -0
  37. jaclang/compiler/passes/tool/tests/fixtures/genai/essay_review.jac +36 -0
  38. jaclang/compiler/passes/tool/tests/fixtures/genai/expert_answer.jac +17 -0
  39. jaclang/compiler/passes/tool/tests/fixtures/genai/joke_gen.jac +32 -0
  40. jaclang/compiler/passes/tool/tests/fixtures/genai/odd_word_out.jac +27 -0
  41. jaclang/compiler/passes/tool/tests/fixtures/genai/personality_finder.jac +35 -0
  42. jaclang/compiler/passes/tool/tests/fixtures/genai/text_to_type.jac +25 -0
  43. jaclang/compiler/passes/tool/tests/fixtures/genai/translator.jac +13 -0
  44. jaclang/compiler/passes/tool/tests/fixtures/genai/wikipedia.jac +63 -0
  45. jaclang/compiler/passes/tool/tests/fixtures/multi_def_err.dot +39 -0
  46. jaclang/compiler/passes/tool/tests/fixtures/multi_def_err.jac +7 -0
  47. jaclang/compiler/passes/tool/tests/fixtures/multi_def_err.txt +20 -0
  48. jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/ability_impl_long_comprehension.jac +15 -0
  49. jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/call_with_many_parameters.jac +24 -0
  50. jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/entry_main.jac +4 -0
  51. jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/long_line_nested_dict_access.jac +10 -0
  52. jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/multiline_fstrings.jac +16 -0
  53. jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/nested_dict.jac +15 -0
  54. jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/nested_loop_and_incrementer.jac +13 -0
  55. jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/simple_walker.jac +25 -0
  56. jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/try_block_and_walker_spawn_and_fstrings.jac +26 -0
  57. jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/tuple_iteration_and_not_negation.jac +20 -0
  58. jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/type_annotation.jac +3 -0
  59. jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/walker_decl_only.jac +12 -0
  60. jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/walker_with_default_values_types_and_docstrings.jac +18 -0
  61. jaclang/compiler/passes/tool/tests/fixtures/myca_formatted_code/walker_with_inline_ability_impl.jac +8 -0
  62. jaclang/compiler/passes/tool/tests/fixtures/simple_walk.jac +47 -0
  63. jaclang/compiler/passes/tool/tests/fixtures/simple_walk_fmt.jac +47 -0
  64. jaclang/compiler/tests/fixtures/fam.jac +67 -0
  65. jaclang/compiler/tests/fixtures/hello_world.jac +5 -0
  66. jaclang/compiler/tests/fixtures/kwesc.jac +5 -0
  67. jaclang/compiler/tests/fixtures/mod_doc_test.jac +1 -0
  68. jaclang/compiler/tests/fixtures/staticcheck.jac +20 -0
  69. jaclang/compiler/tests/fixtures/stuff.jac +6 -0
  70. jaclang/core/aott.py +10 -1
  71. jaclang/core/construct.py +157 -21
  72. jaclang/core/importer.py +6 -2
  73. jaclang/core/memory.py +48 -0
  74. jaclang/core/shelve_storage.py +55 -0
  75. jaclang/plugin/__init__.py +1 -2
  76. jaclang/plugin/builtin.py +1 -1
  77. jaclang/plugin/default.py +97 -4
  78. jaclang/plugin/feature.py +28 -9
  79. jaclang/plugin/spec.py +45 -10
  80. jaclang/plugin/tests/fixtures/impl_match.jac +9 -0
  81. jaclang/plugin/tests/fixtures/impl_match_impl.jac +3 -0
  82. jaclang/plugin/tests/fixtures/simple_node_connection.jac +55 -0
  83. jaclang/plugin/tests/fixtures/simple_persistent.jac +41 -0
  84. jaclang/plugin/tests/test_jaseci.py +219 -0
  85. jaclang/tests/fixtures/abc.jac +73 -0
  86. jaclang/tests/fixtures/access_checker.jac +19 -0
  87. jaclang/tests/fixtures/access_modifier.jac +49 -0
  88. jaclang/tests/fixtures/aott_raise.jac +25 -0
  89. jaclang/tests/fixtures/arithmetic_bug.jac +13 -0
  90. jaclang/tests/fixtures/assign_compr.jac +15 -0
  91. jaclang/tests/fixtures/assign_compr_dup.jac +15 -0
  92. jaclang/tests/fixtures/builtin_dotgen.jac +41 -0
  93. jaclang/tests/fixtures/chandra_bugs.jac +11 -0
  94. jaclang/tests/fixtures/chandra_bugs2.jac +26 -0
  95. jaclang/tests/fixtures/circle_pysolo.py +91 -0
  96. jaclang/tests/fixtures/deep/deeper/deep_outer_import.jac +9 -0
  97. jaclang/tests/fixtures/deep/deeper/deep_outer_import2.jac +9 -0
  98. jaclang/tests/fixtures/deep/deeper/snd_lev.jac +6 -0
  99. jaclang/tests/fixtures/deep/mycode.jac +4 -0
  100. jaclang/tests/fixtures/deep/one_lev.jac +6 -0
  101. jaclang/tests/fixtures/deep/one_lev_dup.jac +6 -0
  102. jaclang/tests/fixtures/deep/one_lev_dup_py.py +6 -0
  103. jaclang/tests/fixtures/deep_import.jac +7 -0
  104. jaclang/tests/fixtures/deferred_field.jac +13 -0
  105. jaclang/tests/fixtures/disconn.jac +29 -0
  106. jaclang/tests/fixtures/edge_node_walk.jac +46 -0
  107. jaclang/tests/fixtures/edge_ops.jac +45 -0
  108. jaclang/tests/fixtures/edges_walk.jac +38 -0
  109. jaclang/tests/fixtures/enum_inside_archtype.jac +20 -0
  110. jaclang/tests/fixtures/err.jac +5 -0
  111. jaclang/tests/fixtures/err2.jac +5 -0
  112. jaclang/tests/fixtures/game1.jac +15 -0
  113. jaclang/tests/fixtures/gendot_bubble_sort.jac +77 -0
  114. jaclang/tests/fixtures/guess_game.jac +47 -0
  115. jaclang/tests/fixtures/has_goodness.jac +15 -0
  116. jaclang/tests/fixtures/hashcheck.jac +12 -0
  117. jaclang/tests/fixtures/hashcheck_dup.jac +12 -0
  118. jaclang/tests/fixtures/hello.jac +5 -0
  119. jaclang/tests/fixtures/hello_nc.jac +5 -0
  120. jaclang/tests/fixtures/ignore.jac +43 -0
  121. jaclang/tests/fixtures/ignore_dup.jac +43 -0
  122. jaclang/tests/fixtures/impl_grab.impl.jac +4 -0
  123. jaclang/tests/fixtures/impl_grab.jac +2 -0
  124. jaclang/tests/fixtures/inherit_check.jac +33 -0
  125. jaclang/tests/fixtures/jacsamp.jac +6 -0
  126. jaclang/tests/fixtures/jp_importer.jac +17 -0
  127. jaclang/tests/fixtures/lambda.jac +6 -0
  128. jaclang/tests/fixtures/maxfail_run_test.jac +5 -0
  129. jaclang/tests/fixtures/mtest.impl.jac +6 -0
  130. jaclang/tests/fixtures/mtest.jac +6 -0
  131. jaclang/tests/fixtures/needs_import.jac +18 -0
  132. jaclang/tests/fixtures/needs_import_1.jac +6 -0
  133. jaclang/tests/fixtures/needs_import_2.jac +6 -0
  134. jaclang/tests/fixtures/needs_import_3.jac +6 -0
  135. jaclang/tests/fixtures/needs_import_dup.jac +18 -0
  136. jaclang/tests/fixtures/package_import.jac +6 -0
  137. jaclang/tests/fixtures/pyfunc.py +11 -0
  138. jaclang/tests/fixtures/pyfunc_1.py +311 -0
  139. jaclang/tests/fixtures/pyfunc_2.py +279 -0
  140. jaclang/tests/fixtures/pyfunc_3.py +310 -0
  141. jaclang/tests/fixtures/random_check.jac +70 -0
  142. jaclang/tests/fixtures/raw_byte_string.jac +18 -0
  143. jaclang/tests/fixtures/registry.jac +37 -0
  144. jaclang/tests/fixtures/run_test.jac +5 -0
  145. jaclang/tests/fixtures/semstr.jac +33 -0
  146. jaclang/tests/fixtures/simple_archs.jac +26 -0
  147. jaclang/tests/fixtures/slice_vals.jac +7 -0
  148. jaclang/tests/fixtures/sub_abil_sep.jac +15 -0
  149. jaclang/tests/fixtures/sub_abil_sep_multilev.jac +17 -0
  150. jaclang/tests/fixtures/try_finally.jac +34 -0
  151. jaclang/tests/fixtures/tupleunpack.jac +6 -0
  152. jaclang/tests/fixtures/tuplytuples.jac +8 -0
  153. jaclang/tests/fixtures/type_info.jac +19 -0
  154. jaclang/tests/fixtures/with_context.jac +30 -0
  155. jaclang/tests/fixtures/with_llm_function.jac +33 -0
  156. jaclang/tests/fixtures/with_llm_lower.jac +45 -0
  157. jaclang/tests/fixtures/with_llm_method.jac +51 -0
  158. jaclang/tests/fixtures/with_llm_type.jac +52 -0
  159. jaclang/tests/test_cli.py +239 -0
  160. jaclang/tests/test_language.py +807 -0
  161. jaclang/tests/test_man_code.py +148 -0
  162. jaclang/tests/test_reference.py +95 -0
  163. jaclang/tests/test_settings.py +46 -0
  164. jaclang/utils/treeprinter.py +7 -2
  165. jaclang/vendor/LICENSE +18 -0
  166. jaclang/vendor/mypy/stubgen.py +0 -0
  167. jaclang/vendor/mypy/stubgenc.py +0 -0
  168. jaclang/vendor/mypy/typeshed/LICENSE +237 -0
  169. jaclang/vendor/mypy/typeshed/stdlib/VERSIONS +308 -0
  170. jaclang/vendor/mypy/typeshed/stdlib/__future__.pyi +41 -0
  171. jaclang/vendor/mypy/typeshed/stdlib/__main__.pyi +3 -0
  172. jaclang/vendor/mypy/typeshed/stdlib/_ast.pyi +632 -0
  173. jaclang/vendor/mypy/typeshed/stdlib/_bisect.pyi +106 -0
  174. jaclang/vendor/mypy/typeshed/stdlib/_bootlocale.pyi +1 -0
  175. jaclang/vendor/mypy/typeshed/stdlib/_codecs.pyi +198 -0
  176. jaclang/vendor/mypy/typeshed/stdlib/_collections_abc.pyi +94 -0
  177. jaclang/vendor/mypy/typeshed/stdlib/_compat_pickle.pyi +8 -0
  178. jaclang/vendor/mypy/typeshed/stdlib/_compression.pyi +25 -0
  179. jaclang/vendor/mypy/typeshed/stdlib/_csv.pyi +90 -0
  180. jaclang/vendor/mypy/typeshed/stdlib/_ctypes.pyi +219 -0
  181. jaclang/vendor/mypy/typeshed/stdlib/_curses.pyi +600 -0
  182. jaclang/vendor/mypy/typeshed/stdlib/_decimal.pyi +316 -0
  183. jaclang/vendor/mypy/typeshed/stdlib/_dummy_thread.pyi +43 -0
  184. jaclang/vendor/mypy/typeshed/stdlib/_dummy_threading.pyi +185 -0
  185. jaclang/vendor/mypy/typeshed/stdlib/_heapq.pyi +11 -0
  186. jaclang/vendor/mypy/typeshed/stdlib/_imp.pyi +32 -0
  187. jaclang/vendor/mypy/typeshed/stdlib/_json.pyi +49 -0
  188. jaclang/vendor/mypy/typeshed/stdlib/_locale.pyi +100 -0
  189. jaclang/vendor/mypy/typeshed/stdlib/_markupbase.pyi +16 -0
  190. jaclang/vendor/mypy/typeshed/stdlib/_msi.pyi +92 -0
  191. jaclang/vendor/mypy/typeshed/stdlib/_operator.pyi +172 -0
  192. jaclang/vendor/mypy/typeshed/stdlib/_osx_support.pyi +55 -0
  193. jaclang/vendor/mypy/typeshed/stdlib/_posixsubprocess.pyi +32 -0
  194. jaclang/vendor/mypy/typeshed/stdlib/_py_abc.pyi +17 -0
  195. jaclang/vendor/mypy/typeshed/stdlib/_pydecimal.pyi +43 -0
  196. jaclang/vendor/mypy/typeshed/stdlib/_random.pyi +12 -0
  197. jaclang/vendor/mypy/typeshed/stdlib/_sitebuiltins.pyi +18 -0
  198. jaclang/vendor/mypy/typeshed/stdlib/_socket.pyi +851 -0
  199. jaclang/vendor/mypy/typeshed/stdlib/_stat.pyi +103 -0
  200. jaclang/vendor/mypy/typeshed/stdlib/_thread.pyi +63 -0
  201. jaclang/vendor/mypy/typeshed/stdlib/_threading_local.pyi +17 -0
  202. jaclang/vendor/mypy/typeshed/stdlib/_tkinter.pyi +120 -0
  203. jaclang/vendor/mypy/typeshed/stdlib/_tracemalloc.pyi +17 -0
  204. jaclang/vendor/mypy/typeshed/stdlib/_typeshed/README.md +34 -0
  205. jaclang/vendor/mypy/typeshed/stdlib/_typeshed/__init__.pyi +374 -0
  206. jaclang/vendor/mypy/typeshed/stdlib/_typeshed/dbapi.pyi +45 -0
  207. jaclang/vendor/mypy/typeshed/stdlib/_typeshed/wsgi.pyi +51 -0
  208. jaclang/vendor/mypy/typeshed/stdlib/_typeshed/xml.pyi +13 -0
  209. jaclang/vendor/mypy/typeshed/stdlib/_warnings.pyi +65 -0
  210. jaclang/vendor/mypy/typeshed/stdlib/_weakref.pyi +45 -0
  211. jaclang/vendor/mypy/typeshed/stdlib/_weakrefset.pyi +51 -0
  212. jaclang/vendor/mypy/typeshed/stdlib/_winapi.pyi +275 -0
  213. jaclang/vendor/mypy/typeshed/stdlib/abc.pyi +61 -0
  214. jaclang/vendor/mypy/typeshed/stdlib/aifc.pyi +99 -0
  215. jaclang/vendor/mypy/typeshed/stdlib/antigravity.pyi +3 -0
  216. jaclang/vendor/mypy/typeshed/stdlib/argparse.pyi +675 -0
  217. jaclang/vendor/mypy/typeshed/stdlib/array.pyi +111 -0
  218. jaclang/vendor/mypy/typeshed/stdlib/ast.pyi +287 -0
  219. jaclang/vendor/mypy/typeshed/stdlib/asynchat.pyi +21 -0
  220. jaclang/vendor/mypy/typeshed/stdlib/asyncio/__init__.pyi +41 -0
  221. jaclang/vendor/mypy/typeshed/stdlib/asyncio/base_events.pyi +519 -0
  222. jaclang/vendor/mypy/typeshed/stdlib/asyncio/base_futures.pyi +21 -0
  223. jaclang/vendor/mypy/typeshed/stdlib/asyncio/base_subprocess.pyi +71 -0
  224. jaclang/vendor/mypy/typeshed/stdlib/asyncio/base_tasks.pyi +13 -0
  225. jaclang/vendor/mypy/typeshed/stdlib/asyncio/constants.pyi +20 -0
  226. jaclang/vendor/mypy/typeshed/stdlib/asyncio/coroutines.pyi +32 -0
  227. jaclang/vendor/mypy/typeshed/stdlib/asyncio/events.pyi +669 -0
  228. jaclang/vendor/mypy/typeshed/stdlib/asyncio/exceptions.pyi +43 -0
  229. jaclang/vendor/mypy/typeshed/stdlib/asyncio/format_helpers.pyi +26 -0
  230. jaclang/vendor/mypy/typeshed/stdlib/asyncio/futures.pyi +61 -0
  231. jaclang/vendor/mypy/typeshed/stdlib/asyncio/locks.pyi +131 -0
  232. jaclang/vendor/mypy/typeshed/stdlib/asyncio/log.pyi +3 -0
  233. jaclang/vendor/mypy/typeshed/stdlib/asyncio/mixins.pyi +9 -0
  234. jaclang/vendor/mypy/typeshed/stdlib/asyncio/proactor_events.pyi +72 -0
  235. jaclang/vendor/mypy/typeshed/stdlib/asyncio/protocols.pyi +40 -0
  236. jaclang/vendor/mypy/typeshed/stdlib/asyncio/queues.pyi +49 -0
  237. jaclang/vendor/mypy/typeshed/stdlib/asyncio/runners.pyi +44 -0
  238. jaclang/vendor/mypy/typeshed/stdlib/asyncio/selector_events.pyi +8 -0
  239. jaclang/vendor/mypy/typeshed/stdlib/asyncio/sslproto.pyi +189 -0
  240. jaclang/vendor/mypy/typeshed/stdlib/asyncio/staggered.pyi +13 -0
  241. jaclang/vendor/mypy/typeshed/stdlib/asyncio/streams.pyi +172 -0
  242. jaclang/vendor/mypy/typeshed/stdlib/asyncio/subprocess.pyi +234 -0
  243. jaclang/vendor/mypy/typeshed/stdlib/asyncio/taskgroups.pyi +36 -0
  244. jaclang/vendor/mypy/typeshed/stdlib/asyncio/tasks.pyi +566 -0
  245. jaclang/vendor/mypy/typeshed/stdlib/asyncio/threads.pyi +11 -0
  246. jaclang/vendor/mypy/typeshed/stdlib/asyncio/timeouts.pyi +22 -0
  247. jaclang/vendor/mypy/typeshed/stdlib/asyncio/transports.pyi +64 -0
  248. jaclang/vendor/mypy/typeshed/stdlib/asyncio/trsock.pyi +140 -0
  249. jaclang/vendor/mypy/typeshed/stdlib/asyncio/unix_events.pyi +268 -0
  250. jaclang/vendor/mypy/typeshed/stdlib/asyncio/windows_events.pyi +108 -0
  251. jaclang/vendor/mypy/typeshed/stdlib/asyncio/windows_utils.pyi +59 -0
  252. jaclang/vendor/mypy/typeshed/stdlib/asyncore.pyi +99 -0
  253. jaclang/vendor/mypy/typeshed/stdlib/atexit.pyi +14 -0
  254. jaclang/vendor/mypy/typeshed/stdlib/audioop.pyi +50 -0
  255. jaclang/vendor/mypy/typeshed/stdlib/base64.pyi +76 -0
  256. jaclang/vendor/mypy/typeshed/stdlib/bdb.pyi +133 -0
  257. jaclang/vendor/mypy/typeshed/stdlib/binascii.pyi +45 -0
  258. jaclang/vendor/mypy/typeshed/stdlib/binhex.pyi +47 -0
  259. jaclang/vendor/mypy/typeshed/stdlib/bisect.pyi +4 -0
  260. jaclang/vendor/mypy/typeshed/stdlib/builtins.pyi +2310 -0
  261. jaclang/vendor/mypy/typeshed/stdlib/bz2.pyi +177 -0
  262. jaclang/vendor/mypy/typeshed/stdlib/cProfile.pyi +49 -0
  263. jaclang/vendor/mypy/typeshed/stdlib/calendar.pyi +248 -0
  264. jaclang/vendor/mypy/typeshed/stdlib/cgi.pyi +122 -0
  265. jaclang/vendor/mypy/typeshed/stdlib/cgitb.pyi +44 -0
  266. jaclang/vendor/mypy/typeshed/stdlib/chunk.pyi +26 -0
  267. jaclang/vendor/mypy/typeshed/stdlib/cmath.pyi +38 -0
  268. jaclang/vendor/mypy/typeshed/stdlib/cmd.pyi +52 -0
  269. jaclang/vendor/mypy/typeshed/stdlib/code.pyi +46 -0
  270. jaclang/vendor/mypy/typeshed/stdlib/codecs.pyi +344 -0
  271. jaclang/vendor/mypy/typeshed/stdlib/codeop.pyi +17 -0
  272. jaclang/vendor/mypy/typeshed/stdlib/collections/__init__.pyi +571 -0
  273. jaclang/vendor/mypy/typeshed/stdlib/collections/abc.pyi +2 -0
  274. jaclang/vendor/mypy/typeshed/stdlib/colorsys.pyi +20 -0
  275. jaclang/vendor/mypy/typeshed/stdlib/compileall.pyi +111 -0
  276. jaclang/vendor/mypy/typeshed/stdlib/concurrent/futures/__init__.pyi +32 -0
  277. jaclang/vendor/mypy/typeshed/stdlib/concurrent/futures/_base.pyi +137 -0
  278. jaclang/vendor/mypy/typeshed/stdlib/concurrent/futures/process.pyi +272 -0
  279. jaclang/vendor/mypy/typeshed/stdlib/concurrent/futures/thread.pyi +86 -0
  280. jaclang/vendor/mypy/typeshed/stdlib/configparser.pyi +449 -0
  281. jaclang/vendor/mypy/typeshed/stdlib/contextlib.pyi +274 -0
  282. jaclang/vendor/mypy/typeshed/stdlib/contextvars.pyi +67 -0
  283. jaclang/vendor/mypy/typeshed/stdlib/copy.pyi +16 -0
  284. jaclang/vendor/mypy/typeshed/stdlib/copyreg.pyi +32 -0
  285. jaclang/vendor/mypy/typeshed/stdlib/crypt.pyi +12 -0
  286. jaclang/vendor/mypy/typeshed/stdlib/csv.pyi +147 -0
  287. jaclang/vendor/mypy/typeshed/stdlib/ctypes/__init__.pyi +211 -0
  288. jaclang/vendor/mypy/typeshed/stdlib/ctypes/_endian.pyi +29 -0
  289. jaclang/vendor/mypy/typeshed/stdlib/ctypes/util.pyi +6 -0
  290. jaclang/vendor/mypy/typeshed/stdlib/ctypes/wintypes.pyi +298 -0
  291. jaclang/vendor/mypy/typeshed/stdlib/curses/__init__.pyi +25 -0
  292. jaclang/vendor/mypy/typeshed/stdlib/curses/ascii.pyi +63 -0
  293. jaclang/vendor/mypy/typeshed/stdlib/curses/has_key.pyi +4 -0
  294. jaclang/vendor/mypy/typeshed/stdlib/curses/panel.pyi +25 -0
  295. jaclang/vendor/mypy/typeshed/stdlib/curses/textpad.pyi +15 -0
  296. jaclang/vendor/mypy/typeshed/stdlib/dataclasses.pyi +323 -0
  297. jaclang/vendor/mypy/typeshed/stdlib/datetime.pyi +334 -0
  298. jaclang/vendor/mypy/typeshed/stdlib/dbm/__init__.pyi +98 -0
  299. jaclang/vendor/mypy/typeshed/stdlib/dbm/dumb.pyi +34 -0
  300. jaclang/vendor/mypy/typeshed/stdlib/dbm/gnu.pyi +44 -0
  301. jaclang/vendor/mypy/typeshed/stdlib/dbm/ndbm.pyi +40 -0
  302. jaclang/vendor/mypy/typeshed/stdlib/decimal.pyi +5 -0
  303. jaclang/vendor/mypy/typeshed/stdlib/difflib.pyi +169 -0
  304. jaclang/vendor/mypy/typeshed/stdlib/dis.pyi +190 -0
  305. jaclang/vendor/mypy/typeshed/stdlib/distutils/__init__.pyi +5 -0
  306. jaclang/vendor/mypy/typeshed/stdlib/distutils/archive_util.pyi +22 -0
  307. jaclang/vendor/mypy/typeshed/stdlib/distutils/bcppcompiler.pyi +3 -0
  308. jaclang/vendor/mypy/typeshed/stdlib/distutils/ccompiler.pyi +183 -0
  309. jaclang/vendor/mypy/typeshed/stdlib/distutils/cmd.pyi +88 -0
  310. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/__init__.pyi +0 -0
  311. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/bdist.pyi +25 -0
  312. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/bdist_dumb.pyi +21 -0
  313. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/bdist_msi.pyi +45 -0
  314. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/bdist_packager.pyi +0 -0
  315. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/bdist_rpm.pyi +52 -0
  316. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/bdist_wininst.pyi +21 -0
  317. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/build.pyi +31 -0
  318. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/build_clib.pyi +27 -0
  319. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/build_ext.pyi +50 -0
  320. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/build_py.pyi +44 -0
  321. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/build_scripts.pyi +24 -0
  322. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/check.pyi +39 -0
  323. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/clean.pyi +17 -0
  324. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/config.pyi +91 -0
  325. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install.pyi +63 -0
  326. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install_data.pyi +19 -0
  327. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install_egg_info.pyi +18 -0
  328. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install_headers.pyi +16 -0
  329. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install_lib.pyi +25 -0
  330. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/install_scripts.pyi +18 -0
  331. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/register.pyi +18 -0
  332. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/sdist.pyi +42 -0
  333. jaclang/vendor/mypy/typeshed/stdlib/distutils/command/upload.pyi +17 -0
  334. jaclang/vendor/mypy/typeshed/stdlib/distutils/config.pyi +17 -0
  335. jaclang/vendor/mypy/typeshed/stdlib/distutils/core.pyi +59 -0
  336. jaclang/vendor/mypy/typeshed/stdlib/distutils/cygwinccompiler.pyi +20 -0
  337. jaclang/vendor/mypy/typeshed/stdlib/distutils/debug.pyi +1 -0
  338. jaclang/vendor/mypy/typeshed/stdlib/distutils/dep_util.pyi +3 -0
  339. jaclang/vendor/mypy/typeshed/stdlib/distutils/dir_util.pyi +21 -0
  340. jaclang/vendor/mypy/typeshed/stdlib/distutils/dist.pyi +155 -0
  341. jaclang/vendor/mypy/typeshed/stdlib/distutils/errors.pyi +19 -0
  342. jaclang/vendor/mypy/typeshed/stdlib/distutils/extension.pyi +36 -0
  343. jaclang/vendor/mypy/typeshed/stdlib/distutils/fancy_getopt.pyi +37 -0
  344. jaclang/vendor/mypy/typeshed/stdlib/distutils/file_util.pyi +14 -0
  345. jaclang/vendor/mypy/typeshed/stdlib/distutils/filelist.pyi +78 -0
  346. jaclang/vendor/mypy/typeshed/stdlib/distutils/log.pyi +25 -0
  347. jaclang/vendor/mypy/typeshed/stdlib/distutils/msvccompiler.pyi +3 -0
  348. jaclang/vendor/mypy/typeshed/stdlib/distutils/spawn.pyi +4 -0
  349. jaclang/vendor/mypy/typeshed/stdlib/distutils/sysconfig.pyi +24 -0
  350. jaclang/vendor/mypy/typeshed/stdlib/distutils/text_file.pyi +23 -0
  351. jaclang/vendor/mypy/typeshed/stdlib/distutils/unixccompiler.pyi +3 -0
  352. jaclang/vendor/mypy/typeshed/stdlib/distutils/util.pyi +50 -0
  353. jaclang/vendor/mypy/typeshed/stdlib/distutils/version.pyi +36 -0
  354. jaclang/vendor/mypy/typeshed/stdlib/doctest.pyi +282 -0
  355. jaclang/vendor/mypy/typeshed/stdlib/dummy_threading.pyi +2 -0
  356. jaclang/vendor/mypy/typeshed/stdlib/email/__init__.pyi +37 -0
  357. jaclang/vendor/mypy/typeshed/stdlib/email/_header_value_parser.pyi +392 -0
  358. jaclang/vendor/mypy/typeshed/stdlib/email/_policybase.pyi +51 -0
  359. jaclang/vendor/mypy/typeshed/stdlib/email/base64mime.pyi +22 -0
  360. jaclang/vendor/mypy/typeshed/stdlib/email/charset.pyi +39 -0
  361. jaclang/vendor/mypy/typeshed/stdlib/email/contentmanager.pyi +11 -0
  362. jaclang/vendor/mypy/typeshed/stdlib/email/encoders.pyi +8 -0
  363. jaclang/vendor/mypy/typeshed/stdlib/email/errors.pyi +39 -0
  364. jaclang/vendor/mypy/typeshed/stdlib/email/feedparser.pyi +31 -0
  365. jaclang/vendor/mypy/typeshed/stdlib/email/generator.pyi +42 -0
  366. jaclang/vendor/mypy/typeshed/stdlib/email/header.pyi +41 -0
  367. jaclang/vendor/mypy/typeshed/stdlib/email/headerregistry.pyi +214 -0
  368. jaclang/vendor/mypy/typeshed/stdlib/email/iterators.pyi +19 -0
  369. jaclang/vendor/mypy/typeshed/stdlib/email/message.pyi +220 -0
  370. jaclang/vendor/mypy/typeshed/stdlib/email/mime/__init__.pyi +0 -0
  371. jaclang/vendor/mypy/typeshed/stdlib/email/mime/application.pyi +17 -0
  372. jaclang/vendor/mypy/typeshed/stdlib/email/mime/audio.pyi +17 -0
  373. jaclang/vendor/mypy/typeshed/stdlib/email/mime/base.pyi +15 -0
  374. jaclang/vendor/mypy/typeshed/stdlib/email/mime/image.pyi +17 -0
  375. jaclang/vendor/mypy/typeshed/stdlib/email/mime/message.pyi +10 -0
  376. jaclang/vendor/mypy/typeshed/stdlib/email/mime/multipart.pyi +18 -0
  377. jaclang/vendor/mypy/typeshed/stdlib/email/mime/nonmultipart.pyi +5 -0
  378. jaclang/vendor/mypy/typeshed/stdlib/email/mime/text.pyi +14 -0
  379. jaclang/vendor/mypy/typeshed/stdlib/email/parser.pyi +44 -0
  380. jaclang/vendor/mypy/typeshed/stdlib/email/policy.pyi +51 -0
  381. jaclang/vendor/mypy/typeshed/stdlib/email/quoprimime.pyi +30 -0
  382. jaclang/vendor/mypy/typeshed/stdlib/email/utils.pyi +84 -0
  383. jaclang/vendor/mypy/typeshed/stdlib/encodings/__init__.pyi +10 -0
  384. jaclang/vendor/mypy/typeshed/stdlib/encodings/utf_8.pyi +25 -0
  385. jaclang/vendor/mypy/typeshed/stdlib/encodings/utf_8_sig.pyi +28 -0
  386. jaclang/vendor/mypy/typeshed/stdlib/ensurepip/__init__.pyi +12 -0
  387. jaclang/vendor/mypy/typeshed/stdlib/enum.pyi +347 -0
  388. jaclang/vendor/mypy/typeshed/stdlib/errno.pyi +222 -0
  389. jaclang/vendor/mypy/typeshed/stdlib/faulthandler.pyi +20 -0
  390. jaclang/vendor/mypy/typeshed/stdlib/fcntl.pyi +155 -0
  391. jaclang/vendor/mypy/typeshed/stdlib/filecmp.pyi +62 -0
  392. jaclang/vendor/mypy/typeshed/stdlib/fileinput.pyi +246 -0
  393. jaclang/vendor/mypy/typeshed/stdlib/fnmatch.pyi +9 -0
  394. jaclang/vendor/mypy/typeshed/stdlib/formatter.pyi +92 -0
  395. jaclang/vendor/mypy/typeshed/stdlib/fractions.pyi +152 -0
  396. jaclang/vendor/mypy/typeshed/stdlib/ftplib.pyi +214 -0
  397. jaclang/vendor/mypy/typeshed/stdlib/functools.pyi +261 -0
  398. jaclang/vendor/mypy/typeshed/stdlib/gc.pyi +39 -0
  399. jaclang/vendor/mypy/typeshed/stdlib/genericpath.pyi +62 -0
  400. jaclang/vendor/mypy/typeshed/stdlib/getopt.pyi +15 -0
  401. jaclang/vendor/mypy/typeshed/stdlib/getpass.pyi +8 -0
  402. jaclang/vendor/mypy/typeshed/stdlib/gettext.pyi +200 -0
  403. jaclang/vendor/mypy/typeshed/stdlib/glob.pyi +50 -0
  404. jaclang/vendor/mypy/typeshed/stdlib/graphlib.pyi +28 -0
  405. jaclang/vendor/mypy/typeshed/stdlib/grp.pyi +22 -0
  406. jaclang/vendor/mypy/typeshed/stdlib/gzip.pyi +162 -0
  407. jaclang/vendor/mypy/typeshed/stdlib/hashlib.pyi +191 -0
  408. jaclang/vendor/mypy/typeshed/stdlib/heapq.pyi +36 -0
  409. jaclang/vendor/mypy/typeshed/stdlib/hmac.pyi +45 -0
  410. jaclang/vendor/mypy/typeshed/stdlib/html/__init__.pyi +6 -0
  411. jaclang/vendor/mypy/typeshed/stdlib/html/entities.pyi +6 -0
  412. jaclang/vendor/mypy/typeshed/stdlib/html/parser.pyi +40 -0
  413. jaclang/vendor/mypy/typeshed/stdlib/http/__init__.pyi +105 -0
  414. jaclang/vendor/mypy/typeshed/stdlib/http/client.pyi +283 -0
  415. jaclang/vendor/mypy/typeshed/stdlib/http/cookiejar.pyi +206 -0
  416. jaclang/vendor/mypy/typeshed/stdlib/http/cookies.pyi +67 -0
  417. jaclang/vendor/mypy/typeshed/stdlib/http/server.pyi +93 -0
  418. jaclang/vendor/mypy/typeshed/stdlib/imaplib.pyi +221 -0
  419. jaclang/vendor/mypy/typeshed/stdlib/imghdr.pyi +17 -0
  420. jaclang/vendor/mypy/typeshed/stdlib/imp.pyi +75 -0
  421. jaclang/vendor/mypy/typeshed/stdlib/importlib/__init__.pyi +24 -0
  422. jaclang/vendor/mypy/typeshed/stdlib/importlib/_abc.pyi +15 -0
  423. jaclang/vendor/mypy/typeshed/stdlib/importlib/abc.pyi +195 -0
  424. jaclang/vendor/mypy/typeshed/stdlib/importlib/machinery.pyi +214 -0
  425. jaclang/vendor/mypy/typeshed/stdlib/importlib/metadata/__init__.pyi +310 -0
  426. jaclang/vendor/mypy/typeshed/stdlib/importlib/metadata/_meta.pyi +40 -0
  427. jaclang/vendor/mypy/typeshed/stdlib/importlib/readers.pyi +68 -0
  428. jaclang/vendor/mypy/typeshed/stdlib/importlib/resources/__init__.pyi +66 -0
  429. jaclang/vendor/mypy/typeshed/stdlib/importlib/resources/abc.pyi +12 -0
  430. jaclang/vendor/mypy/typeshed/stdlib/importlib/resources/readers.pyi +14 -0
  431. jaclang/vendor/mypy/typeshed/stdlib/importlib/resources/simple.pyi +55 -0
  432. jaclang/vendor/mypy/typeshed/stdlib/importlib/simple.pyi +16 -0
  433. jaclang/vendor/mypy/typeshed/stdlib/importlib/util.pyi +57 -0
  434. jaclang/vendor/mypy/typeshed/stdlib/inspect.pyi +709 -0
  435. jaclang/vendor/mypy/typeshed/stdlib/io.pyi +222 -0
  436. jaclang/vendor/mypy/typeshed/stdlib/ipaddress.pyi +229 -0
  437. jaclang/vendor/mypy/typeshed/stdlib/itertools.pyi +394 -0
  438. jaclang/vendor/mypy/typeshed/stdlib/json/__init__.pyi +69 -0
  439. jaclang/vendor/mypy/typeshed/stdlib/json/decoder.pyi +34 -0
  440. jaclang/vendor/mypy/typeshed/stdlib/json/encoder.pyi +38 -0
  441. jaclang/vendor/mypy/typeshed/stdlib/json/tool.pyi +1 -0
  442. jaclang/vendor/mypy/typeshed/stdlib/keyword.pyi +21 -0
  443. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/__init__.pyi +0 -0
  444. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/btm_matcher.pyi +32 -0
  445. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixer_base.pyi +44 -0
  446. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/__init__.pyi +0 -0
  447. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_apply.pyi +8 -0
  448. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_asserts.pyi +10 -0
  449. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_basestring.pyi +8 -0
  450. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_buffer.pyi +8 -0
  451. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_dict.pyi +16 -0
  452. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_except.pyi +14 -0
  453. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_exec.pyi +8 -0
  454. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_execfile.pyi +8 -0
  455. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_exitfunc.pyi +13 -0
  456. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_filter.pyi +9 -0
  457. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_funcattrs.pyi +8 -0
  458. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_future.pyi +8 -0
  459. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_getcwdu.pyi +8 -0
  460. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_has_key.pyi +8 -0
  461. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_idioms.pyi +15 -0
  462. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_import.pyi +16 -0
  463. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_imports.pyi +21 -0
  464. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_imports2.pyi +6 -0
  465. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_input.pyi +11 -0
  466. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_intern.pyi +9 -0
  467. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_isinstance.pyi +8 -0
  468. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_itertools.pyi +9 -0
  469. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_itertools_imports.pyi +7 -0
  470. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_long.pyi +7 -0
  471. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_map.pyi +9 -0
  472. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_metaclass.pyi +17 -0
  473. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_methodattrs.pyi +10 -0
  474. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_ne.pyi +8 -0
  475. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_next.pyi +19 -0
  476. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_nonzero.pyi +8 -0
  477. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_numliterals.pyi +8 -0
  478. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_operator.pyi +12 -0
  479. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_paren.pyi +8 -0
  480. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_print.pyi +12 -0
  481. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_raise.pyi +8 -0
  482. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_raw_input.pyi +8 -0
  483. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_reduce.pyi +8 -0
  484. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_reload.pyi +9 -0
  485. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_renames.pyi +17 -0
  486. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_repr.pyi +8 -0
  487. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_set_literal.pyi +7 -0
  488. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_standarderror.pyi +8 -0
  489. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_sys_exc.pyi +9 -0
  490. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_throw.pyi +8 -0
  491. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_tuple_params.pyi +17 -0
  492. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_types.pyi +8 -0
  493. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_unicode.pyi +12 -0
  494. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_urllib.pyi +18 -0
  495. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_ws_comma.pyi +12 -0
  496. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_xrange.pyi +20 -0
  497. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_xreadlines.pyi +8 -0
  498. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/fixes/fix_zip.pyi +9 -0
  499. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/main.pyi +46 -0
  500. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/__init__.pyi +9 -0
  501. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/driver.pyi +40 -0
  502. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/grammar.pyi +24 -0
  503. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/literals.pyi +7 -0
  504. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/parse.pyi +36 -0
  505. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/pgen.pyi +52 -0
  506. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/token.pyi +67 -0
  507. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pgen2/tokenize.pyi +98 -0
  508. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pygram.pyi +114 -0
  509. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/pytree.pyi +142 -0
  510. jaclang/vendor/mypy/typeshed/stdlib/lib2to3/refactor.pyi +122 -0
  511. jaclang/vendor/mypy/typeshed/stdlib/linecache.pyi +29 -0
  512. jaclang/vendor/mypy/typeshed/stdlib/locale.pyi +165 -0
  513. jaclang/vendor/mypy/typeshed/stdlib/logging/__init__.pyi +685 -0
  514. jaclang/vendor/mypy/typeshed/stdlib/logging/config.pyi +161 -0
  515. jaclang/vendor/mypy/typeshed/stdlib/logging/handlers.pyi +315 -0
  516. jaclang/vendor/mypy/typeshed/stdlib/lzma.pyi +213 -0
  517. jaclang/vendor/mypy/typeshed/stdlib/mailbox.pyi +306 -0
  518. jaclang/vendor/mypy/typeshed/stdlib/mailcap.pyi +15 -0
  519. jaclang/vendor/mypy/typeshed/stdlib/marshal.pyi +35 -0
  520. jaclang/vendor/mypy/typeshed/stdlib/math.pyi +134 -0
  521. jaclang/vendor/mypy/typeshed/stdlib/mimetypes.pyi +50 -0
  522. jaclang/vendor/mypy/typeshed/stdlib/mmap.pyi +126 -0
  523. jaclang/vendor/mypy/typeshed/stdlib/modulefinder.pyi +84 -0
  524. jaclang/vendor/mypy/typeshed/stdlib/msilib/__init__.pyi +237 -0
  525. jaclang/vendor/mypy/typeshed/stdlib/msilib/schema.pyi +107 -0
  526. jaclang/vendor/mypy/typeshed/stdlib/msilib/sequence.pyi +13 -0
  527. jaclang/vendor/mypy/typeshed/stdlib/msilib/text.pyi +7 -0
  528. jaclang/vendor/mypy/typeshed/stdlib/msvcrt.pyi +32 -0
  529. jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/__init__.pyi +94 -0
  530. jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/connection.pyi +94 -0
  531. jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/context.pyi +235 -0
  532. jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/dummy/__init__.pyi +83 -0
  533. jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/dummy/connection.pyi +50 -0
  534. jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/forkserver.pyi +36 -0
  535. jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/heap.pyi +38 -0
  536. jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/managers.pyi +270 -0
  537. jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/pool.pyi +137 -0
  538. jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/popen_fork.pyi +23 -0
  539. jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/popen_forkserver.pyi +16 -0
  540. jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/popen_spawn_posix.pyi +20 -0
  541. jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/popen_spawn_win32.pyi +30 -0
  542. jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/process.pyi +39 -0
  543. jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/queues.pyi +43 -0
  544. jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/reduction.pyi +118 -0
  545. jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/resource_sharer.pyi +20 -0
  546. jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/resource_tracker.pyi +18 -0
  547. jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/shared_memory.pyi +44 -0
  548. jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/sharedctypes.pyi +140 -0
  549. jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/spawn.pyi +34 -0
  550. jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/synchronize.pyi +66 -0
  551. jaclang/vendor/mypy/typeshed/stdlib/multiprocessing/util.pyi +83 -0
  552. jaclang/vendor/mypy/typeshed/stdlib/netrc.pyi +28 -0
  553. jaclang/vendor/mypy/typeshed/stdlib/nis.pyi +9 -0
  554. jaclang/vendor/mypy/typeshed/stdlib/nntplib.pyi +151 -0
  555. jaclang/vendor/mypy/typeshed/stdlib/nt.pyi +114 -0
  556. jaclang/vendor/mypy/typeshed/stdlib/ntpath.pyi +119 -0
  557. jaclang/vendor/mypy/typeshed/stdlib/nturl2path.pyi +2 -0
  558. jaclang/vendor/mypy/typeshed/stdlib/numbers.pyi +154 -0
  559. jaclang/vendor/mypy/typeshed/stdlib/opcode.pyi +68 -0
  560. jaclang/vendor/mypy/typeshed/stdlib/operator.pyi +110 -0
  561. jaclang/vendor/mypy/typeshed/stdlib/optparse.pyi +290 -0
  562. jaclang/vendor/mypy/typeshed/stdlib/os/__init__.pyi +1317 -0
  563. jaclang/vendor/mypy/typeshed/stdlib/os/path.pyi +8 -0
  564. jaclang/vendor/mypy/typeshed/stdlib/ossaudiodev.pyi +131 -0
  565. jaclang/vendor/mypy/typeshed/stdlib/parser.pyi +28 -0
  566. jaclang/vendor/mypy/typeshed/stdlib/pathlib.pyi +282 -0
  567. jaclang/vendor/mypy/typeshed/stdlib/pdb.pyi +223 -0
  568. jaclang/vendor/mypy/typeshed/stdlib/pickle.pyi +286 -0
  569. jaclang/vendor/mypy/typeshed/stdlib/pickletools.pyi +173 -0
  570. jaclang/vendor/mypy/typeshed/stdlib/pipes.pyi +16 -0
  571. jaclang/vendor/mypy/typeshed/stdlib/pkgutil.pyi +61 -0
  572. jaclang/vendor/mypy/typeshed/stdlib/platform.pyi +56 -0
  573. jaclang/vendor/mypy/typeshed/stdlib/plistlib.pyi +176 -0
  574. jaclang/vendor/mypy/typeshed/stdlib/poplib.pyi +78 -0
  575. jaclang/vendor/mypy/typeshed/stdlib/posix.pyi +363 -0
  576. jaclang/vendor/mypy/typeshed/stdlib/posixpath.pyi +171 -0
  577. jaclang/vendor/mypy/typeshed/stdlib/pprint.pyi +122 -0
  578. jaclang/vendor/mypy/typeshed/stdlib/profile.pyi +43 -0
  579. jaclang/vendor/mypy/typeshed/stdlib/pstats.pyi +85 -0
  580. jaclang/vendor/mypy/typeshed/stdlib/pty.pyi +21 -0
  581. jaclang/vendor/mypy/typeshed/stdlib/pwd.pyi +36 -0
  582. jaclang/vendor/mypy/typeshed/stdlib/py_compile.pyi +40 -0
  583. jaclang/vendor/mypy/typeshed/stdlib/pyclbr.pyi +97 -0
  584. jaclang/vendor/mypy/typeshed/stdlib/pydoc.pyi +309 -0
  585. jaclang/vendor/mypy/typeshed/stdlib/pydoc_data/__init__.pyi +0 -0
  586. jaclang/vendor/mypy/typeshed/stdlib/pydoc_data/topics.pyi +1 -0
  587. jaclang/vendor/mypy/typeshed/stdlib/pyexpat/__init__.pyi +94 -0
  588. jaclang/vendor/mypy/typeshed/stdlib/pyexpat/errors.pyi +49 -0
  589. jaclang/vendor/mypy/typeshed/stdlib/pyexpat/model.pyi +11 -0
  590. jaclang/vendor/mypy/typeshed/stdlib/queue.pyi +62 -0
  591. jaclang/vendor/mypy/typeshed/stdlib/quopri.pyi +17 -0
  592. jaclang/vendor/mypy/typeshed/stdlib/random.pyi +160 -0
  593. jaclang/vendor/mypy/typeshed/stdlib/re.pyi +376 -0
  594. jaclang/vendor/mypy/typeshed/stdlib/readline.pyi +40 -0
  595. jaclang/vendor/mypy/typeshed/stdlib/reprlib.pyi +65 -0
  596. jaclang/vendor/mypy/typeshed/stdlib/resource.pyi +116 -0
  597. jaclang/vendor/mypy/typeshed/stdlib/rlcompleter.pyi +9 -0
  598. jaclang/vendor/mypy/typeshed/stdlib/runpy.pyi +31 -0
  599. jaclang/vendor/mypy/typeshed/stdlib/sched.pyi +56 -0
  600. jaclang/vendor/mypy/typeshed/stdlib/secrets.pyi +24 -0
  601. jaclang/vendor/mypy/typeshed/stdlib/select.pyi +162 -0
  602. jaclang/vendor/mypy/typeshed/stdlib/selectors.pyi +85 -0
  603. jaclang/vendor/mypy/typeshed/stdlib/shelve.pyi +64 -0
  604. jaclang/vendor/mypy/typeshed/stdlib/shlex.pyi +47 -0
  605. jaclang/vendor/mypy/typeshed/stdlib/shutil.pyi +239 -0
  606. jaclang/vendor/mypy/typeshed/stdlib/signal.pyi +208 -0
  607. jaclang/vendor/mypy/typeshed/stdlib/site.pyi +33 -0
  608. jaclang/vendor/mypy/typeshed/stdlib/smtpd.pyi +102 -0
  609. jaclang/vendor/mypy/typeshed/stdlib/smtplib.pyi +223 -0
  610. jaclang/vendor/mypy/typeshed/stdlib/sndhdr.pyi +14 -0
  611. jaclang/vendor/mypy/typeshed/stdlib/socket.pyi +881 -0
  612. jaclang/vendor/mypy/typeshed/stdlib/socketserver.pyi +195 -0
  613. jaclang/vendor/mypy/typeshed/stdlib/spwd.pyi +43 -0
  614. jaclang/vendor/mypy/typeshed/stdlib/sqlite3/__init__.pyi +1 -0
  615. jaclang/vendor/mypy/typeshed/stdlib/sqlite3/dbapi2.pyi +519 -0
  616. jaclang/vendor/mypy/typeshed/stdlib/sre_compile.pyi +11 -0
  617. jaclang/vendor/mypy/typeshed/stdlib/sre_constants.pyi +132 -0
  618. jaclang/vendor/mypy/typeshed/stdlib/sre_parse.pyi +110 -0
  619. jaclang/vendor/mypy/typeshed/stdlib/ssl.pyi +559 -0
  620. jaclang/vendor/mypy/typeshed/stdlib/stat.pyi +1 -0
  621. jaclang/vendor/mypy/typeshed/stdlib/statistics.pyi +151 -0
  622. jaclang/vendor/mypy/typeshed/stdlib/string.pyi +112 -0
  623. jaclang/vendor/mypy/typeshed/stdlib/stringprep.pyi +27 -0
  624. jaclang/vendor/mypy/typeshed/stdlib/struct.pyi +43 -0
  625. jaclang/vendor/mypy/typeshed/stdlib/subprocess.pyi +2638 -0
  626. jaclang/vendor/mypy/typeshed/stdlib/sunau.pyi +86 -0
  627. jaclang/vendor/mypy/typeshed/stdlib/symbol.pyi +93 -0
  628. jaclang/vendor/mypy/typeshed/stdlib/symtable.pyi +63 -0
  629. jaclang/vendor/mypy/typeshed/stdlib/sys/__init__.pyi +396 -0
  630. jaclang/vendor/mypy/typeshed/stdlib/sys/_monitoring.pyi +54 -0
  631. jaclang/vendor/mypy/typeshed/stdlib/sysconfig.pyi +52 -0
  632. jaclang/vendor/mypy/typeshed/stdlib/syslog.pyi +48 -0
  633. jaclang/vendor/mypy/typeshed/stdlib/tabnanny.pyi +18 -0
  634. jaclang/vendor/mypy/typeshed/stdlib/tarfile.pyi +486 -0
  635. jaclang/vendor/mypy/typeshed/stdlib/telnetlib.pyi +129 -0
  636. jaclang/vendor/mypy/typeshed/stdlib/tempfile.pyi +521 -0
  637. jaclang/vendor/mypy/typeshed/stdlib/termios.pyi +273 -0
  638. jaclang/vendor/mypy/typeshed/stdlib/textwrap.pyi +107 -0
  639. jaclang/vendor/mypy/typeshed/stdlib/this.pyi +2 -0
  640. jaclang/vendor/mypy/typeshed/stdlib/threading.pyi +212 -0
  641. jaclang/vendor/mypy/typeshed/stdlib/time.pyi +122 -0
  642. jaclang/vendor/mypy/typeshed/stdlib/timeit.pyi +46 -0
  643. jaclang/vendor/mypy/typeshed/stdlib/tkinter/__init__.pyi +3950 -0
  644. jaclang/vendor/mypy/typeshed/stdlib/tkinter/colorchooser.pyi +28 -0
  645. jaclang/vendor/mypy/typeshed/stdlib/tkinter/commondialog.pyi +16 -0
  646. jaclang/vendor/mypy/typeshed/stdlib/tkinter/constants.pyi +80 -0
  647. jaclang/vendor/mypy/typeshed/stdlib/tkinter/dialog.pyi +21 -0
  648. jaclang/vendor/mypy/typeshed/stdlib/tkinter/dnd.pyi +20 -0
  649. jaclang/vendor/mypy/typeshed/stdlib/tkinter/filedialog.pyi +173 -0
  650. jaclang/vendor/mypy/typeshed/stdlib/tkinter/font.pyi +148 -0
  651. jaclang/vendor/mypy/typeshed/stdlib/tkinter/messagebox.pyi +60 -0
  652. jaclang/vendor/mypy/typeshed/stdlib/tkinter/scrolledtext.pyi +10 -0
  653. jaclang/vendor/mypy/typeshed/stdlib/tkinter/simpledialog.pyi +54 -0
  654. jaclang/vendor/mypy/typeshed/stdlib/tkinter/tix.pyi +395 -0
  655. jaclang/vendor/mypy/typeshed/stdlib/tkinter/ttk.pyi +1276 -0
  656. jaclang/vendor/mypy/typeshed/stdlib/token.pyi +159 -0
  657. jaclang/vendor/mypy/typeshed/stdlib/tokenize.pyi +185 -0
  658. jaclang/vendor/mypy/typeshed/stdlib/tomllib.pyi +12 -0
  659. jaclang/vendor/mypy/typeshed/stdlib/trace.pyi +114 -0
  660. jaclang/vendor/mypy/typeshed/stdlib/traceback.pyi +297 -0
  661. jaclang/vendor/mypy/typeshed/stdlib/tracemalloc.pyi +142 -0
  662. jaclang/vendor/mypy/typeshed/stdlib/tty.pyi +30 -0
  663. jaclang/vendor/mypy/typeshed/stdlib/turtle.pyi +830 -0
  664. jaclang/vendor/mypy/typeshed/stdlib/types.pyi +647 -0
  665. jaclang/vendor/mypy/typeshed/stdlib/typing.pyi +1059 -0
  666. jaclang/vendor/mypy/typeshed/stdlib/typing_extensions.pyi +524 -0
  667. jaclang/vendor/mypy/typeshed/stdlib/unicodedata.pyi +71 -0
  668. jaclang/vendor/mypy/typeshed/stdlib/unittest/__init__.pyi +72 -0
  669. jaclang/vendor/mypy/typeshed/stdlib/unittest/_log.pyi +34 -0
  670. jaclang/vendor/mypy/typeshed/stdlib/unittest/async_case.pyi +28 -0
  671. jaclang/vendor/mypy/typeshed/stdlib/unittest/case.pyi +481 -0
  672. jaclang/vendor/mypy/typeshed/stdlib/unittest/loader.pyi +71 -0
  673. jaclang/vendor/mypy/typeshed/stdlib/unittest/main.pyi +75 -0
  674. jaclang/vendor/mypy/typeshed/stdlib/unittest/mock.pyi +468 -0
  675. jaclang/vendor/mypy/typeshed/stdlib/unittest/result.pyi +59 -0
  676. jaclang/vendor/mypy/typeshed/stdlib/unittest/runner.pyi +83 -0
  677. jaclang/vendor/mypy/typeshed/stdlib/unittest/signals.pyi +15 -0
  678. jaclang/vendor/mypy/typeshed/stdlib/unittest/suite.pyi +26 -0
  679. jaclang/vendor/mypy/typeshed/stdlib/unittest/util.pyi +31 -0
  680. jaclang/vendor/mypy/typeshed/stdlib/urllib/__init__.pyi +0 -0
  681. jaclang/vendor/mypy/typeshed/stdlib/urllib/error.pyi +27 -0
  682. jaclang/vendor/mypy/typeshed/stdlib/urllib/parse.pyi +245 -0
  683. jaclang/vendor/mypy/typeshed/stdlib/urllib/request.pyi +544 -0
  684. jaclang/vendor/mypy/typeshed/stdlib/urllib/response.pyi +50 -0
  685. jaclang/vendor/mypy/typeshed/stdlib/urllib/robotparser.pyi +20 -0
  686. jaclang/vendor/mypy/typeshed/stdlib/uu.pyi +23 -0
  687. jaclang/vendor/mypy/typeshed/stdlib/uuid.pyi +100 -0
  688. jaclang/vendor/mypy/typeshed/stdlib/warnings.pyi +144 -0
  689. jaclang/vendor/mypy/typeshed/stdlib/wave.pyi +87 -0
  690. jaclang/vendor/mypy/typeshed/stdlib/weakref.pyi +173 -0
  691. jaclang/vendor/mypy/typeshed/stdlib/webbrowser.pyi +80 -0
  692. jaclang/vendor/mypy/typeshed/stdlib/winreg.pyi +120 -0
  693. jaclang/vendor/mypy/typeshed/stdlib/winsound.pyi +28 -0
  694. jaclang/vendor/mypy/typeshed/stdlib/wsgiref/__init__.pyi +0 -0
  695. jaclang/vendor/mypy/typeshed/stdlib/wsgiref/handlers.pyi +109 -0
  696. jaclang/vendor/mypy/typeshed/stdlib/wsgiref/headers.pyi +28 -0
  697. jaclang/vendor/mypy/typeshed/stdlib/wsgiref/simple_server.pyi +49 -0
  698. jaclang/vendor/mypy/typeshed/stdlib/wsgiref/types.pyi +44 -0
  699. jaclang/vendor/mypy/typeshed/stdlib/wsgiref/util.pyi +31 -0
  700. jaclang/vendor/mypy/typeshed/stdlib/wsgiref/validate.pyi +52 -0
  701. jaclang/vendor/mypy/typeshed/stdlib/xdrlib.pyi +63 -0
  702. jaclang/vendor/mypy/typeshed/stdlib/xml/__init__.pyi +1 -0
  703. jaclang/vendor/mypy/typeshed/stdlib/xml/dom/NodeFilter.pyi +19 -0
  704. jaclang/vendor/mypy/typeshed/stdlib/xml/dom/__init__.pyi +72 -0
  705. jaclang/vendor/mypy/typeshed/stdlib/xml/dom/domreg.pyi +12 -0
  706. jaclang/vendor/mypy/typeshed/stdlib/xml/dom/expatbuilder.pyi +111 -0
  707. jaclang/vendor/mypy/typeshed/stdlib/xml/dom/minicompat.pyi +22 -0
  708. jaclang/vendor/mypy/typeshed/stdlib/xml/dom/minidom.pyi +467 -0
  709. jaclang/vendor/mypy/typeshed/stdlib/xml/dom/pulldom.pyi +101 -0
  710. jaclang/vendor/mypy/typeshed/stdlib/xml/dom/xmlbuilder.pyi +110 -0
  711. jaclang/vendor/mypy/typeshed/stdlib/xml/etree/ElementInclude.pyi +35 -0
  712. jaclang/vendor/mypy/typeshed/stdlib/xml/etree/ElementPath.pyi +49 -0
  713. jaclang/vendor/mypy/typeshed/stdlib/xml/etree/ElementTree.pyi +367 -0
  714. jaclang/vendor/mypy/typeshed/stdlib/xml/etree/__init__.pyi +0 -0
  715. jaclang/vendor/mypy/typeshed/stdlib/xml/etree/cElementTree.pyi +1 -0
  716. jaclang/vendor/mypy/typeshed/stdlib/xml/parsers/__init__.pyi +1 -0
  717. jaclang/vendor/mypy/typeshed/stdlib/xml/parsers/expat/__init__.pyi +1 -0
  718. jaclang/vendor/mypy/typeshed/stdlib/xml/parsers/expat/errors.pyi +1 -0
  719. jaclang/vendor/mypy/typeshed/stdlib/xml/parsers/expat/model.pyi +1 -0
  720. jaclang/vendor/mypy/typeshed/stdlib/xml/sax/__init__.pyi +34 -0
  721. jaclang/vendor/mypy/typeshed/stdlib/xml/sax/_exceptions.pyi +21 -0
  722. jaclang/vendor/mypy/typeshed/stdlib/xml/sax/handler.pyi +59 -0
  723. jaclang/vendor/mypy/typeshed/stdlib/xml/sax/saxutils.pyi +71 -0
  724. jaclang/vendor/mypy/typeshed/stdlib/xml/sax/xmlreader.pyi +89 -0
  725. jaclang/vendor/mypy/typeshed/stdlib/xmlrpc/__init__.pyi +0 -0
  726. jaclang/vendor/mypy/typeshed/stdlib/xmlrpc/client.pyi +348 -0
  727. jaclang/vendor/mypy/typeshed/stdlib/xmlrpc/server.pyi +186 -0
  728. jaclang/vendor/mypy/typeshed/stdlib/xxlimited.pyi +22 -0
  729. jaclang/vendor/mypy/typeshed/stdlib/zipapp.pyi +20 -0
  730. jaclang/vendor/mypy/typeshed/stdlib/zipfile/__init__.pyi +355 -0
  731. jaclang/vendor/mypy/typeshed/stdlib/zipfile/_path.pyi +105 -0
  732. jaclang/vendor/mypy/typeshed/stdlib/zipimport.pyi +40 -0
  733. jaclang/vendor/mypy/typeshed/stdlib/zlib.pyi +63 -0
  734. jaclang/vendor/mypy/typeshed/stdlib/zoneinfo/__init__.pyi +45 -0
  735. jaclang/vendor/mypy/typeshed/stubs/mypy-extensions/@tests/stubtest_allowlist.txt +2 -0
  736. jaclang/vendor/mypy/typeshed/stubs/mypy-extensions/METADATA.toml +4 -0
  737. jaclang/vendor/mypy/typeshed/stubs/mypy-extensions/mypy_extensions.pyi +238 -0
  738. jaclang/vendor/mypy/xml/mypy-html.css +104 -0
  739. jaclang/vendor/mypy/xml/mypy-html.xslt +81 -0
  740. jaclang/vendor/mypy/xml/mypy-txt.xslt +100 -0
  741. jaclang/vendor/mypy/xml/mypy.xsd +50 -0
  742. jaclang/vendor/mypyc/.readthedocs.yaml +18 -0
  743. jaclang/vendor/mypyc/README.md +133 -0
  744. jaclang/vendor/mypyc/doc/Makefile +20 -0
  745. jaclang/vendor/mypyc/doc/bool_operations.rst +27 -0
  746. jaclang/vendor/mypyc/doc/compilation_units.rst +20 -0
  747. jaclang/vendor/mypyc/doc/conf.py +59 -0
  748. jaclang/vendor/mypyc/doc/cpython-timings.md +25 -0
  749. jaclang/vendor/mypyc/doc/dev-intro.md +548 -0
  750. jaclang/vendor/mypyc/doc/dict_operations.rst +59 -0
  751. jaclang/vendor/mypyc/doc/differences_from_python.rst +332 -0
  752. jaclang/vendor/mypyc/doc/float_operations.rst +50 -0
  753. jaclang/vendor/mypyc/doc/future.md +42 -0
  754. jaclang/vendor/mypyc/doc/getting_started.rst +240 -0
  755. jaclang/vendor/mypyc/doc/index.rst +61 -0
  756. jaclang/vendor/mypyc/doc/int_operations.rst +162 -0
  757. jaclang/vendor/mypyc/doc/introduction.rst +150 -0
  758. jaclang/vendor/mypyc/doc/list_operations.rst +65 -0
  759. jaclang/vendor/mypyc/doc/make.bat +35 -0
  760. jaclang/vendor/mypyc/doc/native_classes.rst +206 -0
  761. jaclang/vendor/mypyc/doc/native_operations.rst +55 -0
  762. jaclang/vendor/mypyc/doc/performance_tips_and_tricks.rst +244 -0
  763. jaclang/vendor/mypyc/doc/set_operations.rst +47 -0
  764. jaclang/vendor/mypyc/doc/str_operations.rst +35 -0
  765. jaclang/vendor/mypyc/doc/tuple_operations.rst +33 -0
  766. jaclang/vendor/mypyc/doc/using_type_annotations.rst +398 -0
  767. jaclang/vendor/mypyc/external/googletest/LICENSE +28 -0
  768. jaclang/vendor/mypyc/external/googletest/README.md +280 -0
  769. jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-death-test.h +294 -0
  770. jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-message.h +250 -0
  771. jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-param-test.h +1444 -0
  772. jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-param-test.h.pump +510 -0
  773. jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-printers.h +993 -0
  774. jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-spi.h +232 -0
  775. jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-test-part.h +179 -0
  776. jaclang/vendor/mypyc/external/googletest/include/gtest/gtest-typed-test.h +263 -0
  777. jaclang/vendor/mypyc/external/googletest/include/gtest/gtest.h +2236 -0
  778. jaclang/vendor/mypyc/external/googletest/include/gtest/gtest_pred_impl.h +358 -0
  779. jaclang/vendor/mypyc/external/googletest/include/gtest/gtest_prod.h +58 -0
  780. jaclang/vendor/mypyc/external/googletest/include/gtest/internal/custom/gtest-port.h +69 -0
  781. jaclang/vendor/mypyc/external/googletest/include/gtest/internal/custom/gtest-printers.h +42 -0
  782. jaclang/vendor/mypyc/external/googletest/include/gtest/internal/custom/gtest.h +41 -0
  783. jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-death-test-internal.h +319 -0
  784. jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-filepath.h +206 -0
  785. jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-internal.h +1238 -0
  786. jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-linked_ptr.h +243 -0
  787. jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-param-util-generated.h +5146 -0
  788. jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +286 -0
  789. jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-param-util.h +731 -0
  790. jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-port-arch.h +93 -0
  791. jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-port.h +2560 -0
  792. jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-string.h +167 -0
  793. jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-tuple.h +1020 -0
  794. jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-tuple.h.pump +347 -0
  795. jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-type-util.h +3331 -0
  796. jaclang/vendor/mypyc/external/googletest/include/gtest/internal/gtest-type-util.h.pump +297 -0
  797. jaclang/vendor/mypyc/external/googletest/make/Makefile +61 -0
  798. jaclang/vendor/mypyc/external/googletest/src/gtest-all.cc +48 -0
  799. jaclang/vendor/mypyc/external/googletest/src/gtest-death-test.cc +1342 -0
  800. jaclang/vendor/mypyc/external/googletest/src/gtest-filepath.cc +387 -0
  801. jaclang/vendor/mypyc/external/googletest/src/gtest-internal-inl.h +1183 -0
  802. jaclang/vendor/mypyc/external/googletest/src/gtest-port.cc +1259 -0
  803. jaclang/vendor/mypyc/external/googletest/src/gtest-printers.cc +373 -0
  804. jaclang/vendor/mypyc/external/googletest/src/gtest-test-part.cc +110 -0
  805. jaclang/vendor/mypyc/external/googletest/src/gtest-typed-test.cc +118 -0
  806. jaclang/vendor/mypyc/external/googletest/src/gtest.cc +5388 -0
  807. jaclang/vendor/mypyc/external/googletest/src/gtest_main.cc +38 -0
  808. jaclang/vendor/mypyc/lib-rt/CPy.h +643 -0
  809. jaclang/vendor/mypyc/lib-rt/bytes_ops.c +143 -0
  810. jaclang/vendor/mypyc/lib-rt/dict_ops.c +446 -0
  811. jaclang/vendor/mypyc/lib-rt/exc_ops.c +259 -0
  812. jaclang/vendor/mypyc/lib-rt/float_ops.c +192 -0
  813. jaclang/vendor/mypyc/lib-rt/generic_ops.c +64 -0
  814. jaclang/vendor/mypyc/lib-rt/getargs.c +450 -0
  815. jaclang/vendor/mypyc/lib-rt/getargsfast.c +569 -0
  816. jaclang/vendor/mypyc/lib-rt/init.c +13 -0
  817. jaclang/vendor/mypyc/lib-rt/int_ops.c +803 -0
  818. jaclang/vendor/mypyc/lib-rt/list_ops.c +335 -0
  819. jaclang/vendor/mypyc/lib-rt/misc_ops.c +942 -0
  820. jaclang/vendor/mypyc/lib-rt/module_shim.tmpl +18 -0
  821. jaclang/vendor/mypyc/lib-rt/mypyc_util.h +118 -0
  822. jaclang/vendor/mypyc/lib-rt/pythoncapi_compat.h +497 -0
  823. jaclang/vendor/mypyc/lib-rt/pythonsupport.h +548 -0
  824. jaclang/vendor/mypyc/lib-rt/set_ops.c +17 -0
  825. jaclang/vendor/mypyc/lib-rt/setup.py +76 -0
  826. jaclang/vendor/mypyc/lib-rt/str_ops.c +241 -0
  827. jaclang/vendor/mypyc/lib-rt/test_capi.cc +585 -0
  828. jaclang/vendor/mypyc/lib-rt/tuple_ops.c +61 -0
  829. jaclang/vendor/mypyc/test-data/alwaysdefined.test +732 -0
  830. jaclang/vendor/mypyc/test-data/analysis.test +603 -0
  831. jaclang/vendor/mypyc/test-data/commandline.test +245 -0
  832. jaclang/vendor/mypyc/test-data/driver/driver.py +50 -0
  833. jaclang/vendor/mypyc/test-data/exceptions-freq.test +125 -0
  834. jaclang/vendor/mypyc/test-data/exceptions.test +713 -0
  835. jaclang/vendor/mypyc/test-data/fixtures/ir.py +850 -0
  836. jaclang/vendor/mypyc/test-data/fixtures/testutil.py +117 -0
  837. jaclang/vendor/mypyc/test-data/fixtures/typing-full.pyi +212 -0
  838. jaclang/vendor/mypyc/test-data/irbuild-any.test +238 -0
  839. jaclang/vendor/mypyc/test-data/irbuild-basic.test +3690 -0
  840. jaclang/vendor/mypyc/test-data/irbuild-bool.test +463 -0
  841. jaclang/vendor/mypyc/test-data/irbuild-bytes.test +184 -0
  842. jaclang/vendor/mypyc/test-data/irbuild-classes.test +1303 -0
  843. jaclang/vendor/mypyc/test-data/irbuild-constant-fold.test +480 -0
  844. jaclang/vendor/mypyc/test-data/irbuild-dict.test +585 -0
  845. jaclang/vendor/mypyc/test-data/irbuild-dunders.test +223 -0
  846. jaclang/vendor/mypyc/test-data/irbuild-float.test +497 -0
  847. jaclang/vendor/mypyc/test-data/irbuild-generics.test +151 -0
  848. jaclang/vendor/mypyc/test-data/irbuild-glue-methods.test +437 -0
  849. jaclang/vendor/mypyc/test-data/irbuild-i16.test +526 -0
  850. jaclang/vendor/mypyc/test-data/irbuild-i32.test +598 -0
  851. jaclang/vendor/mypyc/test-data/irbuild-i64.test +2164 -0
  852. jaclang/vendor/mypyc/test-data/irbuild-int.test +235 -0
  853. jaclang/vendor/mypyc/test-data/irbuild-isinstance.test +109 -0
  854. jaclang/vendor/mypyc/test-data/irbuild-lists.test +547 -0
  855. jaclang/vendor/mypyc/test-data/irbuild-match.test +1708 -0
  856. jaclang/vendor/mypyc/test-data/irbuild-math.test +64 -0
  857. jaclang/vendor/mypyc/test-data/irbuild-nested.test +807 -0
  858. jaclang/vendor/mypyc/test-data/irbuild-optional.test +536 -0
  859. jaclang/vendor/mypyc/test-data/irbuild-set.test +838 -0
  860. jaclang/vendor/mypyc/test-data/irbuild-singledispatch.test +257 -0
  861. jaclang/vendor/mypyc/test-data/irbuild-statements.test +1149 -0
  862. jaclang/vendor/mypyc/test-data/irbuild-str.test +314 -0
  863. jaclang/vendor/mypyc/test-data/irbuild-strip-asserts.test +12 -0
  864. jaclang/vendor/mypyc/test-data/irbuild-try.test +523 -0
  865. jaclang/vendor/mypyc/test-data/irbuild-tuple.test +462 -0
  866. jaclang/vendor/mypyc/test-data/irbuild-u8.test +543 -0
  867. jaclang/vendor/mypyc/test-data/irbuild-unreachable.test +241 -0
  868. jaclang/vendor/mypyc/test-data/irbuild-vectorcall.test +153 -0
  869. jaclang/vendor/mypyc/test-data/refcount.test +1588 -0
  870. jaclang/vendor/mypyc/test-data/run-async.test +145 -0
  871. jaclang/vendor/mypyc/test-data/run-attrs.test +318 -0
  872. jaclang/vendor/mypyc/test-data/run-bench.test +196 -0
  873. jaclang/vendor/mypyc/test-data/run-bools.test +229 -0
  874. jaclang/vendor/mypyc/test-data/run-bytes.test +302 -0
  875. jaclang/vendor/mypyc/test-data/run-classes.test +2505 -0
  876. jaclang/vendor/mypyc/test-data/run-dicts.test +334 -0
  877. jaclang/vendor/mypyc/test-data/run-dunders.test +945 -0
  878. jaclang/vendor/mypyc/test-data/run-exceptions.test +448 -0
  879. jaclang/vendor/mypyc/test-data/run-floats.test +516 -0
  880. jaclang/vendor/mypyc/test-data/run-functions.test +1310 -0
  881. jaclang/vendor/mypyc/test-data/run-generators.test +681 -0
  882. jaclang/vendor/mypyc/test-data/run-i16.test +338 -0
  883. jaclang/vendor/mypyc/test-data/run-i32.test +336 -0
  884. jaclang/vendor/mypyc/test-data/run-i64.test +1519 -0
  885. jaclang/vendor/mypyc/test-data/run-imports.test +265 -0
  886. jaclang/vendor/mypyc/test-data/run-integers.test +540 -0
  887. jaclang/vendor/mypyc/test-data/run-lists.test +411 -0
  888. jaclang/vendor/mypyc/test-data/run-loops.test +485 -0
  889. jaclang/vendor/mypyc/test-data/run-match.test +283 -0
  890. jaclang/vendor/mypyc/test-data/run-math.test +106 -0
  891. jaclang/vendor/mypyc/test-data/run-misc.test +1168 -0
  892. jaclang/vendor/mypyc/test-data/run-multimodule.test +887 -0
  893. jaclang/vendor/mypyc/test-data/run-mypy-sim.test +138 -0
  894. jaclang/vendor/mypyc/test-data/run-primitives.test +375 -0
  895. jaclang/vendor/mypyc/test-data/run-python37.test +159 -0
  896. jaclang/vendor/mypyc/test-data/run-python38.test +88 -0
  897. jaclang/vendor/mypyc/test-data/run-sets.test +150 -0
  898. jaclang/vendor/mypyc/test-data/run-singledispatch.test +698 -0
  899. jaclang/vendor/mypyc/test-data/run-strings.test +641 -0
  900. jaclang/vendor/mypyc/test-data/run-traits.test +411 -0
  901. jaclang/vendor/mypyc/test-data/run-tuples.test +258 -0
  902. jaclang/vendor/mypyc/test-data/run-u8.test +303 -0
  903. jaclang/vendor/pluggy/LICENSE +21 -0
  904. jaclang-0.6.2.dist-info/METADATA +110 -0
  905. jaclang-0.6.2.dist-info/RECORD +1305 -0
  906. {jaclang-0.6.0.dist-info → jaclang-0.6.2.dist-info}/WHEEL +1 -2
  907. jaclang-0.6.2.dist-info/entry_points.txt +3 -0
  908. jaclang/compiler/generated/jac_parser.py +0 -4069
  909. jaclang-0.6.0.dist-info/METADATA +0 -17
  910. jaclang-0.6.0.dist-info/RECORD +0 -426
  911. jaclang-0.6.0.dist-info/entry_points.txt +0 -2
  912. jaclang-0.6.0.dist-info/top_level.txt +0 -1
  913. /jaclang/{compiler/generated/__init__.py → vendor/mypy/typeshed/stdlib/concurrent/__init__.pyi} +0 -0
@@ -0,0 +1,1310 @@
1
+ # Test cases for functions and calls (compile and run)
2
+
3
+ [case testCallTrivialFunction]
4
+ def f(x: int) -> int:
5
+ return x
6
+ [file driver.py]
7
+ from native import f
8
+ print(f(3))
9
+ print(f(-157))
10
+ print(f(10**20))
11
+ print(f(-10**20))
12
+ [out]
13
+ 3
14
+ -157
15
+ 100000000000000000000
16
+ -100000000000000000000
17
+
18
+ [case testRecursiveFibonacci]
19
+ def fib(n: int) -> int:
20
+ if n <= 1:
21
+ return 1
22
+ else:
23
+ return fib(n - 1) + fib(n - 2)
24
+ [file driver.py]
25
+ from native import fib
26
+ print(fib(0))
27
+ print(fib(1))
28
+ print(fib(2))
29
+ print(fib(6))
30
+ [out]
31
+ 1
32
+ 1
33
+ 2
34
+ 13
35
+
36
+ [case testNestedFunctions]
37
+ from typing import Callable, List
38
+
39
+ def a() -> Callable[[], object]:
40
+ def inner() -> object:
41
+ return None
42
+ return inner
43
+
44
+ def b() -> Callable[[], Callable[[], str]]:
45
+ def first() -> Callable[[], str]:
46
+ def second() -> str:
47
+ return 'b.first.second: nested function'
48
+ return second
49
+ return first
50
+
51
+ def c(num: float) -> Callable[[str], str]:
52
+ def inner(s: str) -> str:
53
+ return s + '!'
54
+ return inner
55
+
56
+ def d(num: float) -> str:
57
+ def inner(s: str) -> str:
58
+ return s + '?'
59
+ a = inner('one')
60
+ b = inner('two')
61
+ return a
62
+
63
+ def e() -> int:
64
+ return 0
65
+
66
+ def f() -> int:
67
+ def inner() -> int:
68
+ return e()
69
+ return inner()
70
+
71
+ def g() -> Callable[[], Callable[[], int]]:
72
+ def inner() -> Callable[[], int]:
73
+ return e
74
+ return inner
75
+
76
+ def h(num: int) -> int:
77
+ def inner() -> int:
78
+ return num
79
+ return inner()
80
+
81
+ def i() -> int:
82
+ num = 3
83
+ def inner() -> int:
84
+ return num
85
+ return inner()
86
+
87
+ def j(num: int) -> int:
88
+ x = 1
89
+ y = 2
90
+ def inner() -> int:
91
+ nonlocal x
92
+ x = 3
93
+ return num + x + y
94
+ return inner()
95
+
96
+ def k() -> int:
97
+ num = 3
98
+ def inner() -> int:
99
+ nonlocal num
100
+ num = 5
101
+ return num
102
+ return inner() + num
103
+
104
+ def l() -> int:
105
+ num = 3
106
+ def inner() -> int:
107
+ num = 5
108
+ return num
109
+ return inner() + num
110
+
111
+ def m() -> Callable[[], int]:
112
+ num = 1
113
+ def inner() -> int:
114
+ num += 1
115
+ return num
116
+ num += 1
117
+ return inner
118
+
119
+ def n() -> int:
120
+ x = 1
121
+ def add_one() -> None:
122
+ x += 1
123
+ def add_two() -> None:
124
+ x += 2
125
+ add_one()
126
+ add_two()
127
+ return x
128
+
129
+ def triple(a: int) -> Callable[[], Callable[[int], int]]:
130
+ x = 1
131
+ def outer() -> Callable[[int], int]:
132
+ nonlocal x
133
+ x += 1
134
+ x += a
135
+ a += 1
136
+ def inner(b: int) -> int:
137
+ x += b
138
+ return x
139
+ return inner
140
+ return outer
141
+
142
+ def if_else(flag: int) -> str:
143
+ def dummy_funtion() -> str:
144
+ return 'if_else.dummy_function'
145
+
146
+ if flag < 0:
147
+ def inner() -> str:
148
+ return 'if_else.inner: first definition'
149
+ elif flag > 0:
150
+ def inner() -> str:
151
+ return 'if_else.inner: second definition'
152
+ else:
153
+ def inner() -> str:
154
+ return 'if_else.inner: third definition'
155
+ return inner()
156
+
157
+ def for_loop() -> int:
158
+ def dummy_funtion() -> str:
159
+ return 'for_loop.dummy_function'
160
+
161
+ for i in range(5):
162
+ def inner(i: int) -> int:
163
+ return i
164
+ if i == 3:
165
+ return inner(i)
166
+ return 0
167
+
168
+ def while_loop() -> int:
169
+ def dummy_funtion() -> str:
170
+ return 'while_loop.dummy_function'
171
+
172
+ i = 0
173
+ while i < 5:
174
+ def inner(i: int) -> int:
175
+ return i
176
+ if i == 3:
177
+ return inner(i)
178
+ i += 1
179
+ return 0
180
+
181
+ def free_vars(foo: int, bar: int) -> int:
182
+ x = 1
183
+ y = 2
184
+ def g(): # type: ignore # missing type annotation for testing
185
+ nonlocal y
186
+ y = 3
187
+ nonlocal bar
188
+ bar += y
189
+ z = 3
190
+ g()
191
+ return bar
192
+
193
+ def lambdas(x: int, y: int) -> int:
194
+ s = lambda a, b: a + b + x + y
195
+ return s(1, 2)
196
+
197
+ def outer() -> str:
198
+ return 'outer: normal function'
199
+
200
+ def inner() -> str:
201
+ return 'inner: normal function'
202
+
203
+ class A:
204
+ def __init__(self, x: int) -> None:
205
+ self.x = x
206
+
207
+ def outer(self, num: int) -> int:
208
+ y = 5
209
+ def inner() -> int:
210
+ return self.x + y + num
211
+ return inner()
212
+
213
+ def o() -> int:
214
+ a = [0, 0]
215
+ b = 0
216
+ def b_incr() -> List[int]:
217
+ b += 10
218
+ return a
219
+ c = 0
220
+ def c_incr() -> int:
221
+ c += 1
222
+ return c
223
+
224
+ # x = 1, y = 1
225
+ x = y = c_incr()
226
+
227
+ # a = [2, 2], b = 20
228
+ b_incr()[0] = b_incr()[1] = c_incr()
229
+ # Should return 26.
230
+ return x + y + a[0] + a[1] + b
231
+
232
+ global_upvar = 20
233
+
234
+ toplevel_lambda = lambda x: 10 + global_upvar + x
235
+
236
+ [file driver.py]
237
+ from native import (
238
+ a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, triple, if_else, for_loop, while_loop,
239
+ free_vars, lambdas, outer, inner, A, toplevel_lambda
240
+ )
241
+
242
+ assert a()() == None
243
+ assert b()()() == 'b.first.second: nested function'
244
+ assert c(5.0)('c') == 'c!'
245
+ assert d(4.0) == 'one?'
246
+ assert e() == 0
247
+ assert f() == 0
248
+ assert g()()() == 0
249
+ assert h(3) == 3
250
+ assert i() == 3
251
+ assert j(3) == 8
252
+ assert k() == 10
253
+ assert l() == 8
254
+ assert m()() == 3
255
+ assert n() == 4
256
+ assert o() == 26
257
+
258
+ triple_outer = triple(2)
259
+ triple_inner = triple_outer()
260
+
261
+ assert triple_inner(4) == 8
262
+ assert triple_inner(4) == 12
263
+ assert triple_outer()(4) == 20
264
+
265
+ assert if_else(-1) == 'if_else.inner: first definition'
266
+ assert if_else(1) == 'if_else.inner: second definition'
267
+ assert if_else(0) == 'if_else.inner: third definition'
268
+
269
+ assert for_loop() == 3
270
+ assert while_loop() == 3
271
+
272
+ assert free_vars(1, 2) == 5
273
+ assert lambdas(3, 4) == 10
274
+
275
+ assert outer() == 'outer: normal function'
276
+ assert inner() == 'inner: normal function'
277
+
278
+ assert A(3).outer(4) == 12
279
+
280
+ assert toplevel_lambda(5) == 35
281
+
282
+ [case testNestedFunctions2]
283
+ from typing import Callable
284
+
285
+ def outer() -> Callable[[], object]:
286
+ def inner() -> object:
287
+ return None
288
+ return inner
289
+
290
+ def first() -> Callable[[], Callable[[], str]]:
291
+ def second() -> Callable[[], str]:
292
+ def third() -> str:
293
+ return 'third: nested function'
294
+ return third
295
+ return second
296
+
297
+ def f1() -> int:
298
+ x = 1
299
+ def f2() -> int:
300
+ y = 2
301
+ def f3() -> int:
302
+ z = 3
303
+ return y
304
+ return f3()
305
+ return f2()
306
+
307
+ def outer_func() -> int:
308
+ def inner_func() -> int:
309
+ return x
310
+ x = 1
311
+ return inner_func()
312
+
313
+ def mutual_recursion(start : int) -> int:
314
+ def f1(k : int) -> int:
315
+ if k <= 0:
316
+ return 0
317
+ k -= 1
318
+ return f2(k)
319
+
320
+ def f2(k : int) -> int:
321
+ if k <= 0:
322
+ return 0
323
+ k -= 1
324
+ return f1(k)
325
+ return f1(start)
326
+
327
+ def topLayer() -> int:
328
+ def middleLayer() -> int:
329
+ def bottomLayer() -> int:
330
+ return x
331
+
332
+ return bottomLayer()
333
+
334
+ x = 1
335
+ return middleLayer()
336
+
337
+ def nest1() -> str:
338
+ def nest2() -> str:
339
+ def nest3() -> str:
340
+ def mut1(val: int) -> str:
341
+ if val <= 0:
342
+ return "bottomed"
343
+ val -= 1
344
+ return mut2(val)
345
+ def mut2(val: int) -> str:
346
+ if val <= 0:
347
+ return "bottomed"
348
+ val -= 1
349
+ return mut1(val)
350
+ return mut1(start)
351
+ return nest3()
352
+ start = 3
353
+ return nest2()
354
+
355
+ def uno(num: float) -> Callable[[str], str]:
356
+ def dos(s: str) -> str:
357
+ return s + '!'
358
+ return dos
359
+
360
+ def eins(num: float) -> str:
361
+ def zwei(s: str) -> str:
362
+ return s + '?'
363
+ a = zwei('eins')
364
+ b = zwei('zwei')
365
+ return a
366
+
367
+ def call_other_inner_func(a: int) -> int:
368
+ def foo() -> int:
369
+ return a + 1
370
+
371
+ def bar() -> int:
372
+ return foo()
373
+
374
+ def baz(n: int) -> int:
375
+ if n == 0:
376
+ return 0
377
+ return n + baz(n - 1)
378
+
379
+ return bar() + baz(a)
380
+
381
+ def inner() -> str:
382
+ return 'inner: normal function'
383
+
384
+ def second() -> str:
385
+ return 'second: normal function'
386
+
387
+ def third() -> str:
388
+ return 'third: normal function'
389
+
390
+ [file driver.py]
391
+ from native import (outer, inner, first, uno, eins, call_other_inner_func,
392
+ second, third, f1, outer_func, mutual_recursion, topLayer, nest1)
393
+
394
+ assert outer()() == None
395
+ assert inner() == 'inner: normal function'
396
+ assert first()()() == 'third: nested function'
397
+ assert uno(5.0)('uno') == 'uno!'
398
+ assert eins(4.0) == 'eins?'
399
+ assert call_other_inner_func(5) == 21
400
+ assert second() == 'second: normal function'
401
+ assert third() == 'third: normal function'
402
+ assert f1() == 2
403
+ assert outer_func() == 1
404
+ assert mutual_recursion(5) == 0
405
+ assert topLayer() == 1
406
+ assert nest1() == "bottomed"
407
+
408
+ [case testFunctionCallWithDefaultArgs]
409
+ from typing import Tuple, List, Optional, Callable, Any
410
+ def f(x: int, y: int = 3, s: str = "test", z: object = 5) -> Tuple[int, str]:
411
+ def inner() -> int:
412
+ return x + y
413
+ return inner(), s
414
+ def g() -> None:
415
+ assert f(2) == (5, "test")
416
+ assert f(s = "123", x = -2) == (1, "123")
417
+ def h(a: Optional[object] = None, b: Optional[str] = None) -> Tuple[object, Optional[str]]:
418
+ return (a, b)
419
+
420
+ def same(x: object = object()) -> object:
421
+ return x
422
+
423
+ a_lambda: Callable[..., Any] = lambda n=20: n
424
+
425
+ def nested_funcs(n: int) -> List[Callable[..., Any]]:
426
+ ls: List[Callable[..., Any]] = []
427
+ for i in range(n):
428
+ def f(i: int = i) -> int:
429
+ return i
430
+ ls.append(f)
431
+ return ls
432
+
433
+ def bool_default(x: bool = False, y: bool = True) -> str:
434
+ return str(x) + '-' + str(y)
435
+
436
+ [file driver.py]
437
+ from native import f, g, h, same, nested_funcs, a_lambda, bool_default
438
+ g()
439
+ assert f(2) == (5, "test")
440
+ assert f(s = "123", x = -2) == (1, "123")
441
+ assert h() == (None, None)
442
+ assert h(10) == (10, None)
443
+ assert h(b='a') == (None, 'a')
444
+ assert h(10, 'a') == (10, 'a')
445
+ assert same() == same()
446
+
447
+ assert [f() for f in nested_funcs(10)] == list(range(10))
448
+
449
+ assert a_lambda(10) == 10
450
+ assert a_lambda() == 20
451
+
452
+ assert bool_default() == 'False-True'
453
+ assert bool_default(True) == 'True-True'
454
+ assert bool_default(True, False) == 'True-False'
455
+
456
+ [case testMethodCallWithDefaultArgs]
457
+ from typing import Tuple, List
458
+ class A:
459
+ def f(self, x: int, y: int = 3, s: str = "test") -> Tuple[int, str]:
460
+ def inner() -> int:
461
+ return x + y
462
+ return inner(), s
463
+ def g() -> None:
464
+ a = A()
465
+ assert a.f(2) == (5, "test")
466
+ assert a.f(s = "123", x = -2) == (1, "123")
467
+ [file driver.py]
468
+ from native import A, g
469
+ g()
470
+ a = A()
471
+ assert a.f(2) == (5, "test")
472
+ assert a.f(s = "123", x = -2) == (1, "123")
473
+
474
+ [case testMethodCallOrdering]
475
+ class A:
476
+ def __init__(self, s: str) -> None:
477
+ print(s)
478
+ def f(self, x: 'A', y: 'A') -> None:
479
+ pass
480
+
481
+ def g() -> None:
482
+ A('A!').f(A('hello'), A('world'))
483
+ [file driver.py]
484
+ from native import g
485
+ g()
486
+ [out]
487
+ A!
488
+ hello
489
+ world
490
+
491
+ [case testPyMethodCall]
492
+ from typing import List
493
+ def f(x: List[int]) -> int:
494
+ return x.pop()
495
+ def g(x: List[int], y: List[int]) -> None:
496
+ x.extend(y)
497
+ [file driver.py]
498
+ from native import f, g
499
+ l = [1, 2]
500
+ assert f(l) == 2
501
+ g(l, [10])
502
+ assert l == [1, 10]
503
+ assert f(l) == 10
504
+ assert f(l) == 1
505
+ g(l, [11, 12])
506
+ assert l == [11, 12]
507
+
508
+ [case testMethodCallWithKeywordArgs]
509
+ from typing import Tuple
510
+ import testmodule
511
+ class A:
512
+ def echo(self, a: int, b: int, c: int) -> Tuple[int, int, int]:
513
+ return a, b, c
514
+ def test_native_method_call_with_kwargs() -> None:
515
+ a = A()
516
+ assert a.echo(1, c=3, b=2) == (1, 2, 3)
517
+ assert a.echo(c = 3, a = 1, b = 2) == (1, 2, 3)
518
+ def test_module_method_call_with_kwargs() -> None:
519
+ a = testmodule.A()
520
+ assert a.echo(1, c=3, b=2) == (1, 2, 3)
521
+ assert a.echo(c = 3, a = 1, b = 2) == (1, 2, 3)
522
+ [file testmodule.py]
523
+ from typing import Tuple
524
+ class A:
525
+ def echo(self, a: int, b: int, c: int) -> Tuple[int, int, int]:
526
+ return a, b, c
527
+ [file driver.py]
528
+ import native
529
+ native.test_native_method_call_with_kwargs()
530
+ native.test_module_method_call_with_kwargs()
531
+
532
+ [case testAnyCall]
533
+ from typing import Any
534
+ def call(f: Any) -> Any:
535
+ return f(1, 'x')
536
+ [file driver.py]
537
+ from native import call
538
+ def f(x, y):
539
+ return (x, y)
540
+ def g(x): pass
541
+
542
+ assert call(f) == (1, 'x')
543
+ for bad in g, 1:
544
+ try:
545
+ call(bad)
546
+ except TypeError:
547
+ pass
548
+ else:
549
+ assert False, bad
550
+
551
+ [case testCallableTypes]
552
+ from typing import Callable
553
+ def absolute_value(x: int) -> int:
554
+ return x if x > 0 else -x
555
+
556
+ def call_native_function(x: int) -> int:
557
+ return absolute_value(x)
558
+
559
+ def call_python_function(x: int) -> int:
560
+ return int(x)
561
+
562
+ def return_float() -> float:
563
+ return 5.0
564
+
565
+ def return_callable_type() -> Callable[[], float]:
566
+ return return_float
567
+
568
+ def call_callable_type() -> float:
569
+ f = return_callable_type()
570
+ return f()
571
+
572
+ def return_passed_in_callable_type(f: Callable[[], float]) -> Callable[[], float]:
573
+ return f
574
+
575
+ def call_passed_in_callable_type(f: Callable[[], float]) -> float:
576
+ return f()
577
+
578
+ [file driver.py]
579
+ from native import call_native_function, call_python_function, return_float, return_callable_type, call_callable_type, return_passed_in_callable_type, call_passed_in_callable_type
580
+ a = call_native_function(1)
581
+ b = call_python_function(1)
582
+ c = return_callable_type()
583
+ d = call_callable_type()
584
+ e = return_passed_in_callable_type(return_float)
585
+ f = call_passed_in_callable_type(return_float)
586
+ assert a == 1
587
+ assert b == 1
588
+ assert c() == 5.0
589
+ assert d == 5.0
590
+ assert e() == 5.0
591
+ assert f == 5.0
592
+
593
+ [case testKeywordArgs]
594
+ from typing import Tuple
595
+ import testmodule
596
+
597
+ def g(a: int, b: int, c: int) -> Tuple[int, int, int]:
598
+ return a, b, c
599
+
600
+ def test_call_native_function_with_keyword_args() -> None:
601
+ assert g(1, c = 3, b = 2) == (1, 2, 3)
602
+ assert g(c = 3, a = 1, b = 2) == (1, 2, 3)
603
+
604
+ def test_call_module_function_with_keyword_args() -> None:
605
+ assert testmodule.g(1, c = 3, b = 2) == (1, 2, 3)
606
+ assert testmodule.g(c = 3, a = 1, b = 2) == (1, 2, 3)
607
+
608
+ def test_call_python_function_with_keyword_args() -> None:
609
+ assert int("11", base=2) == 3
610
+
611
+ def test_call_lambda_function_with_keyword_args() -> None:
612
+ g = testmodule.get_lambda_function()
613
+ assert g(1, c = 3, b = 2) == (1, 2, 3)
614
+ assert g(c = 3, a = 1, b = 2) == (1, 2, 3)
615
+
616
+ [file testmodule.py]
617
+ from typing import Tuple
618
+
619
+ def g(a: int, b: int, c: int) -> Tuple[int, int, int]:
620
+ return a, b, c
621
+
622
+ def get_lambda_function():
623
+ return (lambda a, b, c: (a, b, c))
624
+
625
+ [file driver.py]
626
+ import native
627
+ native.test_call_native_function_with_keyword_args()
628
+ native.test_call_module_function_with_keyword_args()
629
+ native.test_call_python_function_with_keyword_args()
630
+ native.test_call_lambda_function_with_keyword_args()
631
+
632
+ [case testStarArgs]
633
+ from typing import Tuple
634
+
635
+ def g(a: int, b: int, c: int) -> Tuple[int, int, int]:
636
+ return a, b, c
637
+
638
+ def test_star_args() -> None:
639
+ assert g(*[1, 2, 3]) == (1, 2, 3)
640
+ assert g(*(1, 2, 3)) == (1, 2, 3)
641
+ assert g(*(1,), *[2, 3]) == (1, 2, 3)
642
+ assert g(*(), *(1,), *(), *(2,), *(3,), *()) == (1, 2, 3)
643
+ assert g(*range(3)) == (0, 1, 2)
644
+
645
+ [file driver.py]
646
+ import native
647
+ native.test_star_args()
648
+
649
+ [case testStar2Args]
650
+ from typing import Tuple
651
+
652
+ def g(a: int, b: int, c: int) -> Tuple[int, int, int]:
653
+ return a, b, c
654
+
655
+ def test_star2_args() -> None:
656
+ assert g(**{'a': 1, 'b': 2, 'c': 3}) == (1, 2, 3)
657
+ assert g(**{'c': 3, 'a': 1, 'b': 2}) == (1, 2, 3)
658
+ assert g(b=2, **{'a': 1, 'c': 3}) == (1, 2, 3)
659
+
660
+ def test_star2_args_bad(v: dict) -> bool:
661
+ return g(a=1, b=2, **v) == (1, 2, 3)
662
+ [file driver.py]
663
+ import native
664
+ native.test_star2_args()
665
+
666
+ # this should raise TypeError due to duplicate kwarg, but currently it doesn't
667
+ assert native.test_star2_args_bad({'b': 2, 'c': 3})
668
+
669
+ [case testStarAndStar2Args]
670
+ from typing import Tuple
671
+ def g(a: int, b: int, c: int) -> Tuple[int, int, int]:
672
+ return a, b, c
673
+
674
+ class C:
675
+ def g(self, a: int, b: int, c: int) -> Tuple[int, int, int]:
676
+ return a, b, c
677
+
678
+ def test_star_and_star2_args() -> None:
679
+ assert g(1, *(2,), **{'c': 3}) == (1, 2, 3)
680
+ assert g(*[1], **{'b': 2, 'c': 3}) == (1, 2, 3)
681
+ c = C()
682
+ assert c.g(1, *(2,), **{'c': 3}) == (1, 2, 3)
683
+ assert c.g(*[1], **{'b': 2, 'c': 3}) == (1, 2, 3)
684
+
685
+ [file driver.py]
686
+ import native
687
+ native.test_star_and_star2_args()
688
+
689
+ [case testAllTheArgCombinations]
690
+ from typing import Tuple
691
+ def g(a: int, b: int, c: int, d: int = -1) -> Tuple[int, int, int, int]:
692
+ return a, b, c, d
693
+
694
+ class C:
695
+ def g(self, a: int, b: int, c: int, d: int = -1) -> Tuple[int, int, int, int]:
696
+ return a, b, c, d
697
+
698
+ def test_all_the_arg_combinations() -> None:
699
+ assert g(1, *(2,), **{'c': 3}) == (1, 2, 3, -1)
700
+ assert g(*[1], **{'b': 2, 'c': 3, 'd': 4}) == (1, 2, 3, 4)
701
+ c = C()
702
+ assert c.g(1, *(2,), **{'c': 3}) == (1, 2, 3, -1)
703
+ assert c.g(*[1], **{'b': 2, 'c': 3, 'd': 4}) == (1, 2, 3, 4)
704
+
705
+ [file driver.py]
706
+ import native
707
+ native.test_all_the_arg_combinations()
708
+
709
+ [case testOverloads]
710
+ from typing import overload, Union, Tuple
711
+
712
+ @overload
713
+ def foo(x: int) -> int: ...
714
+
715
+ @overload
716
+ def foo(x: str) -> str: ...
717
+
718
+ def foo(x: Union[int, str]) -> Union[int, str]:
719
+ return x
720
+
721
+ class A:
722
+ @overload
723
+ def foo(self, x: int) -> int: ...
724
+
725
+ @overload
726
+ def foo(self, x: str) -> str: ...
727
+
728
+ def foo(self, x: Union[int, str]) -> Union[int, str]:
729
+ return x
730
+
731
+ def call1() -> Tuple[int, str]:
732
+ return (foo(10), foo('10'))
733
+ def call2() -> Tuple[int, str]:
734
+ x = A()
735
+ return (x.foo(10), x.foo('10'))
736
+
737
+ [file driver.py]
738
+ from native import *
739
+ assert call1() == (10, '10')
740
+ assert call2() == (10, '10')
741
+
742
+ [case testDecorators1]
743
+ from typing import Generator, Callable, Iterator
744
+ from contextlib import contextmanager
745
+
746
+ def a(f: Callable[[], None]) -> Callable[[], None]:
747
+ def g() -> None:
748
+ print('Entering')
749
+ f()
750
+ print('Exited')
751
+ return g
752
+
753
+ def b(f: Callable[[], None]) -> Callable[[], None]:
754
+ def g() -> None:
755
+ print('***')
756
+ f()
757
+ print('***')
758
+ return g
759
+
760
+ @contextmanager
761
+ def foo() -> Iterator[int]:
762
+ try:
763
+ print('started')
764
+ yield 0
765
+ finally:
766
+ print('finished')
767
+
768
+ @contextmanager
769
+ def catch() -> Iterator[None]:
770
+ try:
771
+ print('started')
772
+ yield
773
+ except IndexError:
774
+ print('index')
775
+ raise
776
+ except Exception:
777
+ print('lol')
778
+
779
+ def thing() -> None:
780
+ c()
781
+
782
+ @a
783
+ @b
784
+ def c() -> None:
785
+ @a
786
+ @b
787
+ def d() -> None:
788
+ print('d')
789
+ print('c')
790
+ d()
791
+
792
+ def hm() -> None:
793
+ x = [1]
794
+ with catch():
795
+ x[2]
796
+
797
+ [file driver.py]
798
+ from native import foo, c, thing, hm
799
+
800
+ with foo() as f:
801
+ print('hello')
802
+
803
+ c()
804
+ thing()
805
+ print('==')
806
+ try:
807
+ hm()
808
+ except IndexError:
809
+ pass
810
+ else:
811
+ assert False
812
+
813
+ [out]
814
+ started
815
+ hello
816
+ finished
817
+ Entering
818
+ ***
819
+ c
820
+ Entering
821
+ ***
822
+ d
823
+ ***
824
+ Exited
825
+ ***
826
+ Exited
827
+ Entering
828
+ ***
829
+ c
830
+ Entering
831
+ ***
832
+ d
833
+ ***
834
+ Exited
835
+ ***
836
+ Exited
837
+ ==
838
+ started
839
+ index
840
+
841
+ [case testDecoratorsMethods]
842
+ from typing import Any, Callable, Iterator, TypeVar
843
+ from contextlib import contextmanager
844
+
845
+ T = TypeVar('T')
846
+ def dec(f: T) -> T:
847
+ return f
848
+
849
+ def a(f: Callable[[Any], None]) -> Callable[[Any], None]:
850
+ def g(a: Any) -> None:
851
+ print('Entering')
852
+ f(a)
853
+ print('Exited')
854
+ return g
855
+
856
+ class A:
857
+ @a
858
+ def foo(self) -> None:
859
+ print('foo')
860
+
861
+ @contextmanager
862
+ def generator(self) -> Iterator[int]:
863
+ try:
864
+ print('contextmanager: entering')
865
+ yield 0
866
+ finally:
867
+ print('contextmanager: exited')
868
+
869
+ class Lol:
870
+ @staticmethod
871
+ def foo() -> None:
872
+ Lol.bar()
873
+ Lol.baz()
874
+
875
+ @staticmethod
876
+ @dec
877
+ def bar() -> None:
878
+ pass
879
+
880
+ @classmethod
881
+ @dec
882
+ def baz(cls) -> None:
883
+ pass
884
+
885
+ def inside() -> None:
886
+ with A().generator() as g:
887
+ print('hello!')
888
+
889
+ with A().generator() as g:
890
+ print('hello!')
891
+
892
+ def lol() -> None:
893
+ with A().generator() as g:
894
+ raise Exception
895
+
896
+ [file driver.py]
897
+ from native import A, lol
898
+
899
+ A.foo(A())
900
+ A().foo()
901
+ with A().generator() as g:
902
+ print('hello!')
903
+ try:
904
+ lol()
905
+ except:
906
+ pass
907
+ else:
908
+ assert False
909
+
910
+ [out]
911
+ contextmanager: entering
912
+ hello!
913
+ contextmanager: exited
914
+ Entering
915
+ foo
916
+ Exited
917
+ Entering
918
+ foo
919
+ Exited
920
+ contextmanager: entering
921
+ hello!
922
+ contextmanager: exited
923
+ contextmanager: entering
924
+ contextmanager: exited
925
+
926
+ [case testUnannotatedFunction]
927
+ def g(x: int) -> int:
928
+ return x * 2
929
+
930
+ def f(x):
931
+ return g(x)
932
+ [file driver.py]
933
+ from native import f
934
+ assert f(3) == 6
935
+
936
+ [case testUnannotatedModuleLevelInitFunction]
937
+ # Ensure that adding an implicit `-> None` annotation only applies to `__init__`
938
+ # _methods_ specifically (not module-level `__init__` functions).
939
+ def __init__():
940
+ return 42
941
+ [file driver.py]
942
+ from native import __init__
943
+ assert __init__() == 42
944
+
945
+ [case testDifferentArgCountsFromInterpreted]
946
+ # Test various signatures from interpreted code.
947
+ def noargs() -> int:
948
+ return 5
949
+
950
+ def onearg(x: int) -> int:
951
+ return x + 1
952
+
953
+ def twoargs(x: int, y: str) -> int:
954
+ return x + len(y)
955
+
956
+ def one_or_two(x: int, y: str = 'a') -> int:
957
+ return x + len(y)
958
+
959
+ [file driver.py]
960
+ from native import noargs, onearg, twoargs, one_or_two
961
+ from testutil import assertRaises
962
+
963
+ assert noargs() == 5
964
+ t = ()
965
+ assert noargs(*t) == 5
966
+ d = {}
967
+ assert noargs(**d) == 5
968
+ assert noargs(*t, **d) == 5
969
+
970
+ assert onearg(12) == 13
971
+ assert onearg(x=8) == 9
972
+ t = (1,)
973
+ assert onearg(*t) == 2
974
+ d = {'x': 5}
975
+ assert onearg(**d) == 6
976
+
977
+ # Test a bogus call to twoargs before any correct calls are made
978
+ with assertRaises(TypeError, "twoargs() missing required argument 'x' (pos 1)"):
979
+ twoargs()
980
+
981
+ assert twoargs(5, 'foo') == 8
982
+ assert twoargs(4, y='foo') == 7
983
+ assert twoargs(y='foo', x=7) == 10
984
+ t = (1, 'xy')
985
+ assert twoargs(*t) == 3
986
+ d = {'y': 'xy'}
987
+ assert twoargs(2, **d) == 4
988
+
989
+ assert one_or_two(5) == 6
990
+ assert one_or_two(x=3) == 4
991
+ assert one_or_two(6, 'xy') == 8
992
+ assert one_or_two(7, y='xy') == 9
993
+ assert one_or_two(y='xy', x=2) == 4
994
+ assert one_or_two(*t) == 3
995
+ d = {'x': 5}
996
+ assert one_or_two(**d) == 6
997
+ assert one_or_two(y='xx', **d) == 7
998
+ d = {'y': 'abc'}
999
+ assert one_or_two(1, **d) == 4
1000
+
1001
+ with assertRaises(TypeError, 'noargs() takes at most 0 arguments (1 given)'):
1002
+ noargs(1)
1003
+ with assertRaises(TypeError, 'noargs() takes at most 0 keyword arguments (1 given)'):
1004
+ noargs(x=1)
1005
+
1006
+ with assertRaises(TypeError, "onearg() missing required argument 'x' (pos 1)"):
1007
+ onearg()
1008
+ with assertRaises(TypeError, 'onearg() takes at most 1 argument (2 given)'):
1009
+ onearg(1, 2)
1010
+ with assertRaises(TypeError, "onearg() missing required argument 'x' (pos 1)"):
1011
+ onearg(y=1)
1012
+ with assertRaises(TypeError, "onearg() takes at most 1 argument (2 given)"):
1013
+ onearg(1, y=1)
1014
+
1015
+ with assertRaises(TypeError, "twoargs() missing required argument 'x' (pos 1)"):
1016
+ twoargs()
1017
+ with assertRaises(TypeError, "twoargs() missing required argument 'y' (pos 2)"):
1018
+ twoargs(1)
1019
+ with assertRaises(TypeError, 'twoargs() takes at most 2 arguments (3 given)'):
1020
+ twoargs(1, 'x', 2)
1021
+ with assertRaises(TypeError, 'twoargs() takes at most 2 arguments (3 given)'):
1022
+ twoargs(1, 'x', y=2)
1023
+
1024
+ with assertRaises(TypeError, "one_or_two() missing required argument 'x' (pos 1)"):
1025
+ one_or_two()
1026
+ with assertRaises(TypeError, 'one_or_two() takes at most 2 arguments (3 given)'):
1027
+ one_or_two(1, 'x', 2)
1028
+ with assertRaises(TypeError, 'one_or_two() takes at most 2 arguments (3 given)'):
1029
+ one_or_two(1, 'x', y=2)
1030
+
1031
+ [case testComplicatedArgs]
1032
+ from typing import Tuple, Dict
1033
+
1034
+ def kwonly1(x: int = 0, *, y: int) -> Tuple[int, int]:
1035
+ return x, y
1036
+
1037
+ def kwonly2(*, x: int = 0, y: int) -> Tuple[int, int]:
1038
+ return x, y
1039
+
1040
+ def kwonly3(a: int, b: int = 0, *, y: int, x: int = 1) -> Tuple[int, int, int, int]:
1041
+ return a, b, x, y
1042
+
1043
+ def kwonly4(*, x: int, y: int) -> Tuple[int, int]:
1044
+ return x, y
1045
+
1046
+ def varargs1(*args: int) -> Tuple[int, ...]:
1047
+ return args
1048
+
1049
+ def varargs2(*args: int, **kwargs: int) -> Tuple[Tuple[int, ...], Dict[str, int]]:
1050
+ return args, kwargs
1051
+
1052
+ def varargs3(**kwargs: int) -> Dict[str, int]:
1053
+ return kwargs
1054
+
1055
+ def varargs4(a: int, b: int = 0,
1056
+ *args: int, y: int, x: int = 1,
1057
+ **kwargs: int) -> Tuple[Tuple[int, ...], Dict[str, int]]:
1058
+ return (a, b, *args), {'x': x, 'y': y, **kwargs}
1059
+
1060
+ class A:
1061
+ def f(self, x: int) -> Tuple[int, ...]:
1062
+ return (x,)
1063
+ def g(self, x: int) -> Tuple[Tuple[int, ...], Dict[str, int]]:
1064
+ return (x,), {}
1065
+
1066
+ class B(A):
1067
+ def f(self, *args: int) -> Tuple[int, ...]:
1068
+ return args
1069
+ def g(self, *args: int, **kwargs: int) -> Tuple[Tuple[int, ...], Dict[str, int]]:
1070
+ return args, kwargs
1071
+
1072
+ [file other.py]
1073
+ # This file is imported in both compiled and interpreted mode in order to
1074
+ # test both native calls and calls via the C API.
1075
+
1076
+ from native import (
1077
+ kwonly1, kwonly2, kwonly3, kwonly4,
1078
+ varargs1, varargs2, varargs3, varargs4,
1079
+ A, B
1080
+ )
1081
+
1082
+ # kwonly arg tests
1083
+ assert kwonly1(10, y=20) == (10, 20)
1084
+ assert kwonly1(y=20) == (0, 20)
1085
+
1086
+ assert kwonly2(x=10, y=20) == (10, 20)
1087
+ assert kwonly2(y=20) == (0, 20)
1088
+
1089
+ assert kwonly3(10, y=20) == (10, 0, 1, 20)
1090
+ assert kwonly3(a=10, y=20) == (10, 0, 1, 20)
1091
+ assert kwonly3(10, 30, y=20) == (10, 30, 1, 20)
1092
+ assert kwonly3(10, b=30, y=20) == (10, 30, 1, 20)
1093
+ assert kwonly3(a=10, b=30, y=20) == (10, 30, 1, 20)
1094
+
1095
+ assert kwonly3(10, x=40, y=20) == (10, 0, 40, 20)
1096
+ assert kwonly3(a=10, x=40, y=20) == (10, 0, 40, 20)
1097
+ assert kwonly3(10, 30, x=40, y=20) == (10, 30, 40, 20)
1098
+ assert kwonly3(10, b=30, x=40, y=20) == (10, 30, 40, 20)
1099
+ assert kwonly3(a=10, b=30, x=40, y=20) == (10, 30, 40, 20)
1100
+
1101
+ assert kwonly4(x=1, y=2) == (1, 2)
1102
+ assert kwonly4(y=2, x=1) == (1, 2)
1103
+
1104
+ # varargs tests
1105
+ assert varargs1() == ()
1106
+ assert varargs1(1, 2, 3) == (1, 2, 3)
1107
+ assert varargs1(1, *[2, 3, 4], 5, *[6, 7, 8], 9) == (1, 2, 3, 4, 5, 6, 7, 8, 9)
1108
+ assert varargs2(1, 2, 3) == ((1, 2, 3), {})
1109
+ assert varargs2(1, 2, 3, x=4) == ((1, 2, 3), {'x': 4})
1110
+ assert varargs2(x=4) == ((), {'x': 4})
1111
+ assert varargs3() == {}
1112
+ assert varargs3(x=4) == {'x': 4}
1113
+ assert varargs3(x=4, y=5) == {'x': 4, 'y': 5}
1114
+
1115
+ assert varargs4(-1, y=2) == ((-1, 0), {'x': 1, 'y': 2})
1116
+ assert varargs4(-1, 2, y=2) == ((-1, 2), {'x': 1, 'y': 2})
1117
+ assert varargs4(-1, 2, 3, y=2) == ((-1, 2, 3), {'x': 1, 'y': 2})
1118
+ assert varargs4(-1, 2, 3, x=10, y=2) == ((-1, 2, 3), {'x': 10, 'y': 2})
1119
+ assert varargs4(-1, x=10, y=2) == ((-1, 0), {'x': 10, 'y': 2})
1120
+ assert varargs4(-1, y=2, z=20) == ((-1, 0), {'x': 1, 'y': 2, 'z': 20})
1121
+ assert varargs4(-1, 2, y=2, z=20) == ((-1, 2), {'x': 1, 'y': 2, 'z': 20})
1122
+ assert varargs4(-1, 2, 3, y=2, z=20) == ((-1, 2, 3), {'x': 1, 'y': 2, 'z': 20})
1123
+ assert varargs4(-1, 2, 3, x=10, y=2, z=20) == ((-1, 2, 3), {'x': 10, 'y': 2, 'z': 20})
1124
+ assert varargs4(-1, x=10, y=2, z=20) == ((-1, 0), {'x': 10, 'y': 2, 'z': 20})
1125
+
1126
+ x = B() # type: A
1127
+ assert x.f(1) == (1,)
1128
+ assert x.g(1) == ((1,), {})
1129
+ # This one is really funny! When we make native calls we lose
1130
+ # track of which arguments are positional or keyword, so the glue
1131
+ # calls them all positional unless they are keyword only...
1132
+ # It would be possible to fix this by dynamically tracking which
1133
+ # arguments were passed by keyword (for example, by passing a bitmask
1134
+ # to functions indicating this), but paying a speed, size, and complexity
1135
+ # cost for something so deeply marginal seems like a bad choice.
1136
+ # assert x.g(x=1) == ((), {'x': 1})
1137
+
1138
+ [file driver.py]
1139
+ from testutil import assertRaises
1140
+ from native import (
1141
+ kwonly1, kwonly2, kwonly3, kwonly4,
1142
+ varargs1, varargs2, varargs3, varargs4,
1143
+ )
1144
+
1145
+ # Run the non-exceptional tests in both interpreted and compiled mode
1146
+ import other
1147
+ import other_interpreted
1148
+
1149
+
1150
+ # And the tests for errors at the interfaces in interpreted only
1151
+ with assertRaises(TypeError, "missing required keyword-only argument 'y'"):
1152
+ kwonly1()
1153
+ with assertRaises(TypeError, "takes at most 1 positional argument (2 given)"):
1154
+ kwonly1(10, 20)
1155
+
1156
+ with assertRaises(TypeError, "missing required keyword-only argument 'y'"):
1157
+ kwonly2()
1158
+ with assertRaises(TypeError, "takes no positional arguments"):
1159
+ kwonly2(10, 20)
1160
+
1161
+ with assertRaises(TypeError, "missing required argument 'a'"):
1162
+ kwonly3(b=30, x=40, y=20)
1163
+ with assertRaises(TypeError, "missing required keyword-only argument 'y'"):
1164
+ kwonly3(10)
1165
+
1166
+ with assertRaises(TypeError, "missing required keyword-only argument 'y'"):
1167
+ kwonly4(x=1)
1168
+ with assertRaises(TypeError, "missing required keyword-only argument 'x'"):
1169
+ kwonly4(y=1)
1170
+ with assertRaises(TypeError, "missing required keyword-only argument 'x'"):
1171
+ kwonly4()
1172
+
1173
+ with assertRaises(TypeError, "'x' is an invalid keyword argument for varargs1()"):
1174
+ varargs1(x=10)
1175
+ with assertRaises(TypeError, "'x' is an invalid keyword argument for varargs1()"):
1176
+ varargs1(1, x=10)
1177
+ with assertRaises(TypeError, "varargs3() takes no positional arguments"):
1178
+ varargs3(10)
1179
+ with assertRaises(TypeError, "varargs3() takes no positional arguments"):
1180
+ varargs3(10, x=10)
1181
+
1182
+ with assertRaises(TypeError, "varargs4() missing required argument 'a' (pos 1)"):
1183
+ varargs4()
1184
+ with assertRaises(TypeError, "varargs4() missing required keyword-only argument 'y'"):
1185
+ varargs4(1, 2)
1186
+ with assertRaises(TypeError, "varargs4() missing required keyword-only argument 'y'"):
1187
+ varargs4(1, 2, x=1)
1188
+ with assertRaises(TypeError, "varargs4() missing required keyword-only argument 'y'"):
1189
+ varargs4(1, 2, 3)
1190
+ with assertRaises(TypeError, "varargs4() missing required argument 'a' (pos 1)"):
1191
+ varargs4(y=20)
1192
+
1193
+ [case testDecoratorName]
1194
+ def dec(f): return f
1195
+
1196
+ @dec
1197
+ def foo(): pass
1198
+
1199
+ def test_decorator_name():
1200
+ assert foo.__name__ == "foo"
1201
+
1202
+ [case testLambdaArgToOverloaded]
1203
+ from lib import sub
1204
+
1205
+ def test_str_overload() -> None:
1206
+ assert sub('x', lambda m: m) == 'x'
1207
+
1208
+ def test_bytes_overload() -> None:
1209
+ assert sub(b'x', lambda m: m) == b'x'
1210
+
1211
+ [file lib.py]
1212
+ from typing import overload, Callable, TypeVar, Generic
1213
+
1214
+ T = TypeVar("T")
1215
+
1216
+ class Match(Generic[T]):
1217
+ def __init__(self, x: T) -> None:
1218
+ self.x = x
1219
+
1220
+ def group(self, n: int) -> T:
1221
+ return self.x
1222
+
1223
+ @overload
1224
+ def sub(s: str, f: Callable[[str], str]) -> str: ...
1225
+ @overload
1226
+ def sub(s: bytes, f: Callable[[bytes], bytes]) -> bytes: ...
1227
+ def sub(s, f):
1228
+ return f(s)
1229
+
1230
+ [case testContextManagerSpecialCase]
1231
+ from typing import Generator, Callable, Iterator
1232
+ from contextlib import contextmanager
1233
+
1234
+ @contextmanager
1235
+ def f() -> Iterator[None]:
1236
+ yield
1237
+
1238
+ def g() -> None:
1239
+ a = ['']
1240
+ with f():
1241
+ a.pop()
1242
+
1243
+ g()
1244
+
1245
+ [case testUnpackKwargsCompiled]
1246
+ from typing_extensions import Unpack, TypedDict
1247
+
1248
+ class Person(TypedDict):
1249
+ name: str
1250
+ age: int
1251
+
1252
+ def foo(**kwargs: Unpack[Person]) -> None:
1253
+ print(kwargs["name"])
1254
+
1255
+ # This is not really supported yet, just test that we behave reasonably.
1256
+ foo(name='Jennifer', age=38)
1257
+ [out]
1258
+ Jennifer
1259
+
1260
+ [case testNestedFunctionDunderDict312]
1261
+ import sys
1262
+
1263
+ def foo() -> None:
1264
+ def inner() -> str: return "bar"
1265
+ print(inner.__dict__) # type: ignore[attr-defined]
1266
+ inner.__dict__.update({"x": 1}) # type: ignore[attr-defined]
1267
+ print(inner.__dict__) # type: ignore[attr-defined]
1268
+ print(inner.x) # type: ignore[attr-defined]
1269
+
1270
+ if sys.version_info >= (3, 12): # type: ignore
1271
+ foo()
1272
+ [out]
1273
+ [out version>=3.12]
1274
+ {}
1275
+ {'x': 1}
1276
+ 1
1277
+
1278
+ [case testFunctoolsUpdateWrapper]
1279
+ import functools
1280
+
1281
+ def bar() -> None:
1282
+ def inner() -> str: return "bar"
1283
+ functools.update_wrapper(inner, bar) # type: ignore
1284
+ print(inner.__dict__) # type: ignore
1285
+
1286
+ bar()
1287
+ [out]
1288
+ {'__module__': 'native', '__name__': 'bar', '__qualname__': 'bar', '__doc__': None, '__wrapped__': <built-in function bar>}
1289
+
1290
+ [case testCallNestedFunctionWithNamed]
1291
+ def f() -> None:
1292
+ def a() -> None:
1293
+ pass
1294
+ def b() -> None:
1295
+ a()
1296
+ b()
1297
+ [file driver.py]
1298
+ from native import f
1299
+ f()
1300
+
1301
+ [case testCallNestedFunctionWithLambda]
1302
+ def f(x: int) -> int:
1303
+ def inc(x: int) -> int:
1304
+ return x + 1
1305
+ return (lambda x: inc(x))(1)
1306
+ [file driver.py]
1307
+ from native import f
1308
+ print(f(1))
1309
+ [out]
1310
+ 2