pytron-kit 0.3.12__py3-none-macosx_11_0_universal2.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 (419) hide show
  1. pytron/__init__.py +112 -0
  2. pytron/application.py +562 -0
  3. pytron/apputils/__init__.py +0 -0
  4. pytron/apputils/chrome_ipc.py +203 -0
  5. pytron/apputils/codegen.py +261 -0
  6. pytron/apputils/config.py +303 -0
  7. pytron/apputils/deadmansswitch.py +47 -0
  8. pytron/apputils/extras.py +76 -0
  9. pytron/apputils/native.py +148 -0
  10. pytron/apputils/shell.py +73 -0
  11. pytron/apputils/windows.py +286 -0
  12. pytron/cli.py +384 -0
  13. pytron/commands/__init__.py +0 -0
  14. pytron/commands/android.py +28 -0
  15. pytron/commands/build.py +26 -0
  16. pytron/commands/doctor.py +221 -0
  17. pytron/commands/engine.py +23 -0
  18. pytron/commands/frontend.py +60 -0
  19. pytron/commands/harvest.py +112 -0
  20. pytron/commands/helpers.py +239 -0
  21. pytron/commands/info.py +50 -0
  22. pytron/commands/init.py +521 -0
  23. pytron/commands/install.py +294 -0
  24. pytron/commands/login.py +130 -0
  25. pytron/commands/package.py +228 -0
  26. pytron/commands/plugin.py +442 -0
  27. pytron/commands/run.py +312 -0
  28. pytron/commands/scan.py +210 -0
  29. pytron/commands/show.py +23 -0
  30. pytron/commands/uninstall.py +150 -0
  31. pytron/commands/utils.py +42 -0
  32. pytron/commands/workflow.py +95 -0
  33. pytron/console.py +133 -0
  34. pytron/core.py +18 -0
  35. pytron/dependencies/WebView2Loader.dll +0 -0
  36. pytron/dependencies/__init__.py +1 -0
  37. pytron/dependencies/pytron_native.so +0 -0
  38. pytron/engines/chrome/adapter.py +445 -0
  39. pytron/engines/chrome/engine.py +576 -0
  40. pytron/engines/chrome/forge.py +147 -0
  41. pytron/engines/chrome/shell/package.json +8 -0
  42. pytron/engines/chrome/shell/preload.js +12 -0
  43. pytron/engines/chrome/shell/shell.js +534 -0
  44. pytron/exceptions.py +36 -0
  45. pytron/inspector.py +201 -0
  46. pytron/inspector_ui.py +512 -0
  47. pytron/installer/Installation.nsi +236 -0
  48. pytron/installer/header.bmp +0 -0
  49. pytron/installer/pytron.ico +0 -0
  50. pytron/installer/sidebar.bmp +0 -0
  51. pytron/llms.md +98 -0
  52. pytron/manifests/README.md +29 -0
  53. pytron/manifests/windows-utf8.manifest +44 -0
  54. pytron/menu.py +128 -0
  55. pytron/nsis-setup.exe +0 -0
  56. pytron/pack/__init__.py +0 -0
  57. pytron/pack/assets.py +131 -0
  58. pytron/pack/compilers.py +289 -0
  59. pytron/pack/crystal.py +297 -0
  60. pytron/pack/graph.py +377 -0
  61. pytron/pack/inference.py +157 -0
  62. pytron/pack/installers.py +402 -0
  63. pytron/pack/introspect.py +357 -0
  64. pytron/pack/metadata.py +213 -0
  65. pytron/pack/modules.py +618 -0
  66. pytron/pack/nuitka.py +108 -0
  67. pytron/pack/pipeline.py +107 -0
  68. pytron/pack/pyinstaller.py +176 -0
  69. pytron/pack/rust_engine.py +273 -0
  70. pytron/pack/secure.py +309 -0
  71. pytron/pack/secure_loader/bin/pytron_rust_bootloader +0 -0
  72. pytron/pack/secure_loader/icon.ico +0 -0
  73. pytron/pack/utils.py +110 -0
  74. pytron/pack/virtual_root.py +124 -0
  75. pytron/platforms/__init__.py +0 -0
  76. pytron/platforms/android/__init__.py +3 -0
  77. pytron/platforms/android/android.py +103 -0
  78. pytron/platforms/android/builder.py +736 -0
  79. pytron/platforms/android/ops/build.py +79 -0
  80. pytron/platforms/android/ops/init.py +63 -0
  81. pytron/platforms/android/ops/run.py +79 -0
  82. pytron/platforms/android/ops/sync.py +770 -0
  83. pytron/platforms/android/ops/utils.py +8 -0
  84. pytron/platforms/android/shell/README.md +30 -0
  85. pytron/platforms/android/shell/app/build.gradle +64 -0
  86. pytron/platforms/android/shell/app/src/main/AndroidManifest.xml +29 -0
  87. pytron/platforms/android/shell/app/src/main/assets/python/main.py +86 -0
  88. pytron/platforms/android/shell/app/src/main/assets/python/python314.zip +0 -0
  89. pytron/platforms/android/shell/app/src/main/cpp/CMakeLists.txt +25 -0
  90. pytron/platforms/android/shell/app/src/main/cpp/include/Python.h +155 -0
  91. pytron/platforms/android/shell/app/src/main/cpp/include/abstract.h +915 -0
  92. pytron/platforms/android/shell/app/src/main/cpp/include/audit.h +30 -0
  93. pytron/platforms/android/shell/app/src/main/cpp/include/bltinmodule.h +14 -0
  94. pytron/platforms/android/shell/app/src/main/cpp/include/boolobject.h +54 -0
  95. pytron/platforms/android/shell/app/src/main/cpp/include/bytearrayobject.h +44 -0
  96. pytron/platforms/android/shell/app/src/main/cpp/include/bytesobject.h +66 -0
  97. pytron/platforms/android/shell/app/src/main/cpp/include/ceval.h +145 -0
  98. pytron/platforms/android/shell/app/src/main/cpp/include/codecs.h +176 -0
  99. pytron/platforms/android/shell/app/src/main/cpp/include/compile.h +22 -0
  100. pytron/platforms/android/shell/app/src/main/cpp/include/complexobject.h +30 -0
  101. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/abstract.h +104 -0
  102. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/audit.h +8 -0
  103. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/bytearrayobject.h +38 -0
  104. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/bytesobject.h +42 -0
  105. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/cellobject.h +50 -0
  106. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/ceval.h +43 -0
  107. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/classobject.h +71 -0
  108. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/code.h +340 -0
  109. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/compile.h +50 -0
  110. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/complexobject.h +33 -0
  111. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/context.h +107 -0
  112. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/critical_section.h +154 -0
  113. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/descrobject.h +62 -0
  114. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/dictobject.h +105 -0
  115. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/fileobject.h +16 -0
  116. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/fileutils.h +16 -0
  117. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/floatobject.h +27 -0
  118. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/frameobject.h +35 -0
  119. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/funcobject.h +185 -0
  120. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/genobject.h +56 -0
  121. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/import.h +30 -0
  122. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/initconfig.h +334 -0
  123. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/listobject.h +53 -0
  124. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/lock.h +74 -0
  125. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/longintrepr.h +184 -0
  126. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/longobject.h +89 -0
  127. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/memoryobject.h +50 -0
  128. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/methodobject.h +66 -0
  129. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/modsupport.h +26 -0
  130. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/monitoring.h +269 -0
  131. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/object.h +493 -0
  132. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/objimpl.h +104 -0
  133. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/odictobject.h +43 -0
  134. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/picklebufobject.h +31 -0
  135. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pthread_stubs.h +105 -0
  136. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic.h +614 -0
  137. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic_gcc.h +615 -0
  138. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic_msc.h +1197 -0
  139. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic_std.h +1112 -0
  140. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyctype.h +39 -0
  141. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pydebug.h +38 -0
  142. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyerrors.h +132 -0
  143. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyfpe.h +15 -0
  144. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyframe.h +45 -0
  145. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyhash.h +54 -0
  146. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pylifecycle.h +89 -0
  147. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pymem.h +84 -0
  148. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pystate.h +275 -0
  149. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pystats.h +194 -0
  150. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pythonrun.h +96 -0
  151. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pythread.h +43 -0
  152. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pytime.h +27 -0
  153. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/setobject.h +71 -0
  154. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/traceback.h +13 -0
  155. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/tracemalloc.h +32 -0
  156. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/tupleobject.h +40 -0
  157. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/unicodeobject.h +773 -0
  158. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/warnings.h +20 -0
  159. pytron/platforms/android/shell/app/src/main/cpp/include/cpython/weakrefobject.h +66 -0
  160. pytron/platforms/android/shell/app/src/main/cpp/include/critical_section.h +16 -0
  161. pytron/platforms/android/shell/app/src/main/cpp/include/datetime.h +267 -0
  162. pytron/platforms/android/shell/app/src/main/cpp/include/descrobject.h +100 -0
  163. pytron/platforms/android/shell/app/src/main/cpp/include/dictobject.h +108 -0
  164. pytron/platforms/android/shell/app/src/main/cpp/include/dynamic_annotations.h +499 -0
  165. pytron/platforms/android/shell/app/src/main/cpp/include/enumobject.h +17 -0
  166. pytron/platforms/android/shell/app/src/main/cpp/include/errcode.h +45 -0
  167. pytron/platforms/android/shell/app/src/main/cpp/include/exports.h +105 -0
  168. pytron/platforms/android/shell/app/src/main/cpp/include/fileobject.h +41 -0
  169. pytron/platforms/android/shell/app/src/main/cpp/include/fileutils.h +62 -0
  170. pytron/platforms/android/shell/app/src/main/cpp/include/floatobject.h +54 -0
  171. pytron/platforms/android/shell/app/src/main/cpp/include/frameobject.h +20 -0
  172. pytron/platforms/android/shell/app/src/main/cpp/include/genericaliasobject.h +14 -0
  173. pytron/platforms/android/shell/app/src/main/cpp/include/import.h +103 -0
  174. pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/atomic.h +392 -0
  175. pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/internal.h +969 -0
  176. pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/prim.h +329 -0
  177. pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/track.h +147 -0
  178. pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/types.h +721 -0
  179. pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc.h +565 -0
  180. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_abstract.h +61 -0
  181. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_asdl.h +112 -0
  182. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ast.h +945 -0
  183. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ast_state.h +271 -0
  184. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_atexit.h +31 -0
  185. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_audit.h +35 -0
  186. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_backoff.h +133 -0
  187. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_bitutils.h +186 -0
  188. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_blocks_output_buffer.h +321 -0
  189. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_brc.h +73 -0
  190. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_bytes_methods.h +82 -0
  191. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_bytesobject.h +149 -0
  192. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_c_array.h +39 -0
  193. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_call.h +206 -0
  194. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_capsule.h +17 -0
  195. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_cell.h +75 -0
  196. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ceval.h +390 -0
  197. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ceval_state.h +48 -0
  198. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_code.h +671 -0
  199. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_codecs.h +76 -0
  200. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_compile.h +230 -0
  201. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_complexobject.h +34 -0
  202. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_condvar.h +93 -0
  203. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_context.h +59 -0
  204. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_critical_section.h +237 -0
  205. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_crossinterp.h +406 -0
  206. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_crossinterp_data_registry.h +41 -0
  207. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_debug_offsets.h +379 -0
  208. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_descrobject.h +28 -0
  209. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_dict.h +410 -0
  210. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_dict_state.h +28 -0
  211. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_dtoa.h +40 -0
  212. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_emscripten_signal.h +30 -0
  213. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_emscripten_trampoline.h +70 -0
  214. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_exceptions.h +40 -0
  215. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_faulthandler.h +100 -0
  216. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_fileutils.h +320 -0
  217. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_fileutils_windows.h +98 -0
  218. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_floatobject.h +49 -0
  219. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_flowgraph.h +47 -0
  220. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_format.h +27 -0
  221. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_frame.h +61 -0
  222. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_freelist.h +111 -0
  223. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_freelist_state.h +70 -0
  224. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_function.h +53 -0
  225. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_gc.h +378 -0
  226. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_genobject.h +43 -0
  227. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_getopt.h +22 -0
  228. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_gil.h +66 -0
  229. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_global_objects.h +34 -0
  230. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_global_objects_fini_generated.h +1592 -0
  231. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_global_strings.h +854 -0
  232. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_hamt.h +113 -0
  233. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_hashtable.h +150 -0
  234. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_import.h +141 -0
  235. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_importdl.h +139 -0
  236. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_index_pool.h +36 -0
  237. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_initconfig.h +197 -0
  238. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_instruction_sequence.h +83 -0
  239. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_instruments.h +127 -0
  240. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interp.h +109 -0
  241. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interp_structs.h +977 -0
  242. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interpframe.h +401 -0
  243. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interpframe_structs.h +95 -0
  244. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interpolation.h +26 -0
  245. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_intrinsics.h +51 -0
  246. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_jit.h +29 -0
  247. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_list.h +81 -0
  248. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_llist.h +106 -0
  249. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_lock.h +236 -0
  250. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_long.h +319 -0
  251. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_magic_number.h +305 -0
  252. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_memoryobject.h +20 -0
  253. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_mimalloc.h +69 -0
  254. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_modsupport.h +99 -0
  255. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_moduleobject.h +62 -0
  256. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_namespace.h +21 -0
  257. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object.h +1029 -0
  258. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_alloc.h +71 -0
  259. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_deferred.h +32 -0
  260. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_stack.h +95 -0
  261. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_state.h +49 -0
  262. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_obmalloc.h +702 -0
  263. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_obmalloc_init.h +66 -0
  264. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_opcode_metadata.h +2117 -0
  265. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_opcode_utils.h +90 -0
  266. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_optimizer.h +318 -0
  267. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_parking_lot.h +97 -0
  268. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_parser.h +78 -0
  269. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pathconfig.h +26 -0
  270. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyarena.h +68 -0
  271. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyatomic_ft_wrappers.h +174 -0
  272. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pybuffer.h +21 -0
  273. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyerrors.h +213 -0
  274. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyhash.h +91 -0
  275. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pylifecycle.h +136 -0
  276. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pymath.h +205 -0
  277. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pymem.h +145 -0
  278. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pymem_init.h +103 -0
  279. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pystate.h +339 -0
  280. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pystats.h +21 -0
  281. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pythonrun.h +68 -0
  282. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pythread.h +172 -0
  283. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_qsbr.h +172 -0
  284. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_range.h +21 -0
  285. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime.h +63 -0
  286. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime_init.h +239 -0
  287. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime_init_generated.h +1589 -0
  288. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime_structs.h +310 -0
  289. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_semaphore.h +67 -0
  290. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_setobject.h +41 -0
  291. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_signal.h +108 -0
  292. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_sliceobject.h +20 -0
  293. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_stackref.h +791 -0
  294. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_stats.h +97 -0
  295. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_strhex.h +39 -0
  296. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_structs.h +88 -0
  297. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_structseq.h +40 -0
  298. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_symtable.h +201 -0
  299. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_sysmodule.h +32 -0
  300. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_template.h +26 -0
  301. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_time.h +334 -0
  302. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_token.h +110 -0
  303. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_traceback.h +111 -0
  304. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_tracemalloc.h +164 -0
  305. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_tstate.h +88 -0
  306. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_tuple.h +75 -0
  307. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_typedefs.h +18 -0
  308. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_typeobject.h +155 -0
  309. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_typevarobject.h +28 -0
  310. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ucnhash.h +36 -0
  311. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_unicodeobject.h +308 -0
  312. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_unicodeobject_generated.h +3132 -0
  313. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_unionobject.h +26 -0
  314. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_uniqueid.h +57 -0
  315. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_uop_ids.h +335 -0
  316. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_uop_metadata.h +1204 -0
  317. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_warnings.h +21 -0
  318. pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_weakref.h +133 -0
  319. pytron/platforms/android/shell/app/src/main/cpp/include/intrcheck.h +23 -0
  320. pytron/platforms/android/shell/app/src/main/cpp/include/iterobject.h +24 -0
  321. pytron/platforms/android/shell/app/src/main/cpp/include/listobject.h +55 -0
  322. pytron/platforms/android/shell/app/src/main/cpp/include/lock.h +16 -0
  323. pytron/platforms/android/shell/app/src/main/cpp/include/longobject.h +178 -0
  324. pytron/platforms/android/shell/app/src/main/cpp/include/marshal.h +31 -0
  325. pytron/platforms/android/shell/app/src/main/cpp/include/memoryobject.h +34 -0
  326. pytron/platforms/android/shell/app/src/main/cpp/include/methodobject.h +146 -0
  327. pytron/platforms/android/shell/app/src/main/cpp/include/modsupport.h +146 -0
  328. pytron/platforms/android/shell/app/src/main/cpp/include/moduleobject.h +122 -0
  329. pytron/platforms/android/shell/app/src/main/cpp/include/monitoring.h +18 -0
  330. pytron/platforms/android/shell/app/src/main/cpp/include/object.h +828 -0
  331. pytron/platforms/android/shell/app/src/main/cpp/include/objimpl.h +211 -0
  332. pytron/platforms/android/shell/app/src/main/cpp/include/opcode.h +43 -0
  333. pytron/platforms/android/shell/app/src/main/cpp/include/opcode_ids.h +259 -0
  334. pytron/platforms/android/shell/app/src/main/cpp/include/osdefs.h +57 -0
  335. pytron/platforms/android/shell/app/src/main/cpp/include/osmodule.h +17 -0
  336. pytron/platforms/android/shell/app/src/main/cpp/include/patchlevel.h +49 -0
  337. pytron/platforms/android/shell/app/src/main/cpp/include/py_curses.h +117 -0
  338. pytron/platforms/android/shell/app/src/main/cpp/include/pyatomic.h +16 -0
  339. pytron/platforms/android/shell/app/src/main/cpp/include/pybuffer.h +145 -0
  340. pytron/platforms/android/shell/app/src/main/cpp/include/pycapsule.h +58 -0
  341. pytron/platforms/android/shell/app/src/main/cpp/include/pyconfig.h +2088 -0
  342. pytron/platforms/android/shell/app/src/main/cpp/include/pydtrace.h +59 -0
  343. pytron/platforms/android/shell/app/src/main/cpp/include/pyerrors.h +335 -0
  344. pytron/platforms/android/shell/app/src/main/cpp/include/pyexpat.h +62 -0
  345. pytron/platforms/android/shell/app/src/main/cpp/include/pyframe.h +26 -0
  346. pytron/platforms/android/shell/app/src/main/cpp/include/pyhash.h +59 -0
  347. pytron/platforms/android/shell/app/src/main/cpp/include/pylifecycle.h +80 -0
  348. pytron/platforms/android/shell/app/src/main/cpp/include/pymacconfig.h +91 -0
  349. pytron/platforms/android/shell/app/src/main/cpp/include/pymacro.h +243 -0
  350. pytron/platforms/android/shell/app/src/main/cpp/include/pymath.h +65 -0
  351. pytron/platforms/android/shell/app/src/main/cpp/include/pymem.h +110 -0
  352. pytron/platforms/android/shell/app/src/main/cpp/include/pyport.h +710 -0
  353. pytron/platforms/android/shell/app/src/main/cpp/include/pystate.h +132 -0
  354. pytron/platforms/android/shell/app/src/main/cpp/include/pystats.h +28 -0
  355. pytron/platforms/android/shell/app/src/main/cpp/include/pystrcmp.h +23 -0
  356. pytron/platforms/android/shell/app/src/main/cpp/include/pystrtod.h +37 -0
  357. pytron/platforms/android/shell/app/src/main/cpp/include/pythonrun.h +42 -0
  358. pytron/platforms/android/shell/app/src/main/cpp/include/pythread.h +131 -0
  359. pytron/platforms/android/shell/app/src/main/cpp/include/pytypedefs.h +30 -0
  360. pytron/platforms/android/shell/app/src/main/cpp/include/rangeobject.h +27 -0
  361. pytron/platforms/android/shell/app/src/main/cpp/include/refcount.h +555 -0
  362. pytron/platforms/android/shell/app/src/main/cpp/include/setobject.h +49 -0
  363. pytron/platforms/android/shell/app/src/main/cpp/include/sliceobject.h +69 -0
  364. pytron/platforms/android/shell/app/src/main/cpp/include/structmember.h +56 -0
  365. pytron/platforms/android/shell/app/src/main/cpp/include/structseq.h +46 -0
  366. pytron/platforms/android/shell/app/src/main/cpp/include/sysmodule.h +27 -0
  367. pytron/platforms/android/shell/app/src/main/cpp/include/traceback.h +26 -0
  368. pytron/platforms/android/shell/app/src/main/cpp/include/tupleobject.h +46 -0
  369. pytron/platforms/android/shell/app/src/main/cpp/include/typeslots.h +96 -0
  370. pytron/platforms/android/shell/app/src/main/cpp/include/unicodeobject.h +1029 -0
  371. pytron/platforms/android/shell/app/src/main/cpp/include/warnings.h +45 -0
  372. pytron/platforms/android/shell/app/src/main/cpp/include/weakrefobject.h +46 -0
  373. pytron/platforms/android/shell/app/src/main/cpp/pytron_bridge.cpp +224 -0
  374. pytron/platforms/android/shell/app/src/main/java/com/pytron/shell/MainActivity.kt +208 -0
  375. pytron/platforms/android/shell/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  376. pytron/platforms/android/shell/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  377. pytron/platforms/android/shell/build.gradle +11 -0
  378. pytron/platforms/android/shell/gradle/wrapper/gradle-wrapper.jar +0 -0
  379. pytron/platforms/android/shell/gradle/wrapper/gradle-wrapper.properties +5 -0
  380. pytron/platforms/android/shell/gradle.properties +2 -0
  381. pytron/platforms/android/shell/gradlew.bat +85 -0
  382. pytron/platforms/android/shell/settings.gradle +16 -0
  383. pytron/platforms/darwin.py +82 -0
  384. pytron/platforms/darwin_ops/libs.py +31 -0
  385. pytron/platforms/darwin_ops/system.py +182 -0
  386. pytron/platforms/darwin_ops/utils.py +85 -0
  387. pytron/platforms/darwin_ops/webview.py +5 -0
  388. pytron/platforms/darwin_ops/window.py +102 -0
  389. pytron/platforms/interface.py +152 -0
  390. pytron/platforms/linux.py +82 -0
  391. pytron/platforms/linux_ops/libs.py +49 -0
  392. pytron/platforms/linux_ops/system.py +316 -0
  393. pytron/platforms/linux_ops/utils.py +19 -0
  394. pytron/platforms/linux_ops/webview.py +5 -0
  395. pytron/platforms/linux_ops/window.py +115 -0
  396. pytron/platforms/windows.py +136 -0
  397. pytron/platforms/windows_ops/__init__.py +0 -0
  398. pytron/platforms/windows_ops/constants.py +126 -0
  399. pytron/platforms/windows_ops/system.py +518 -0
  400. pytron/platforms/windows_ops/utils.py +3 -0
  401. pytron/platforms/windows_ops/webview.py +5 -0
  402. pytron/platforms/windows_ops/window.py +361 -0
  403. pytron/plugin.py +467 -0
  404. pytron/rcedit-x64.exe +0 -0
  405. pytron/router.py +146 -0
  406. pytron/serializer.py +240 -0
  407. pytron/shortcuts.py +279 -0
  408. pytron/state.py +76 -0
  409. pytron/tray.py +399 -0
  410. pytron/updater.py +181 -0
  411. pytron/utf8_hook.py +112 -0
  412. pytron/utils.py +44 -0
  413. pytron/webview.py +722 -0
  414. pytron_kit-0.3.12.dist-info/METADATA +131 -0
  415. pytron_kit-0.3.12.dist-info/RECORD +419 -0
  416. pytron_kit-0.3.12.dist-info/WHEEL +5 -0
  417. pytron_kit-0.3.12.dist-info/entry_points.txt +2 -0
  418. pytron_kit-0.3.12.dist-info/licenses/LICENSE +201 -0
  419. pytron_kit-0.3.12.dist-info/top_level.txt +1 -0
@@ -0,0 +1,401 @@
1
+ #ifndef Py_INTERNAL_INTERP_FRAME_H
2
+ #define Py_INTERNAL_INTERP_FRAME_H
3
+
4
+ #ifndef Py_BUILD_CORE
5
+ # error "this header requires Py_BUILD_CORE define"
6
+ #endif
7
+
8
+ #include "pycore_code.h" // _PyCode_CODE()
9
+ #include "pycore_interpframe_structs.h" // _PyInterpreterFrame
10
+ #include "pycore_stackref.h" // PyStackRef_AsPyObjectBorrow()
11
+ #include "pycore_stats.h" // CALL_STAT_INC()
12
+
13
+ #ifdef __cplusplus
14
+ extern "C" {
15
+ #endif
16
+
17
+ #define _PyInterpreterFrame_LASTI(IF) \
18
+ ((int)((IF)->instr_ptr - _PyFrame_GetBytecode((IF))))
19
+
20
+ static inline PyCodeObject *_PyFrame_GetCode(_PyInterpreterFrame *f) {
21
+ assert(!PyStackRef_IsNull(f->f_executable));
22
+ PyObject *executable = PyStackRef_AsPyObjectBorrow(f->f_executable);
23
+ assert(PyCode_Check(executable));
24
+ return (PyCodeObject *)executable;
25
+ }
26
+
27
+ // Similar to _PyFrame_GetCode(), but return NULL if the frame is invalid or
28
+ // freed. Used by dump_frame() in Python/traceback.c. The function uses
29
+ // heuristics to detect freed memory, it's not 100% reliable.
30
+ static inline PyCodeObject*
31
+ _PyFrame_SafeGetCode(_PyInterpreterFrame *f)
32
+ {
33
+ // globals and builtins may be NULL on a legit frame, but it's unlikely.
34
+ // It's more likely that it's a sign of an invalid frame.
35
+ if (f->f_globals == NULL || f->f_builtins == NULL) {
36
+ return NULL;
37
+ }
38
+
39
+ if (PyStackRef_IsNull(f->f_executable)) {
40
+ return NULL;
41
+ }
42
+ void *ptr;
43
+ memcpy(&ptr, &f->f_executable, sizeof(f->f_executable));
44
+ if (_PyMem_IsPtrFreed(ptr)) {
45
+ return NULL;
46
+ }
47
+ PyObject *executable = PyStackRef_AsPyObjectBorrow(f->f_executable);
48
+ if (_PyObject_IsFreed(executable)) {
49
+ return NULL;
50
+ }
51
+ if (!PyCode_Check(executable)) {
52
+ return NULL;
53
+ }
54
+ return (PyCodeObject *)executable;
55
+ }
56
+
57
+ static inline _Py_CODEUNIT *
58
+ _PyFrame_GetBytecode(_PyInterpreterFrame *f)
59
+ {
60
+ #ifdef Py_GIL_DISABLED
61
+ PyCodeObject *co = _PyFrame_GetCode(f);
62
+ _PyCodeArray *tlbc = _PyCode_GetTLBCArray(co);
63
+ assert(f->tlbc_index >= 0 && f->tlbc_index < tlbc->size);
64
+ return (_Py_CODEUNIT *)tlbc->entries[f->tlbc_index];
65
+ #else
66
+ return _PyCode_CODE(_PyFrame_GetCode(f));
67
+ #endif
68
+ }
69
+
70
+ // Similar to PyUnstable_InterpreterFrame_GetLasti(), but return NULL if the
71
+ // frame is invalid or freed. Used by dump_frame() in Python/traceback.c. The
72
+ // function uses heuristics to detect freed memory, it's not 100% reliable.
73
+ static inline int
74
+ _PyFrame_SafeGetLasti(struct _PyInterpreterFrame *f)
75
+ {
76
+ // Code based on _PyFrame_GetBytecode() but replace _PyFrame_GetCode()
77
+ // with _PyFrame_SafeGetCode().
78
+ PyCodeObject *co = _PyFrame_SafeGetCode(f);
79
+ if (co == NULL) {
80
+ return -1;
81
+ }
82
+
83
+ _Py_CODEUNIT *bytecode;
84
+ #ifdef Py_GIL_DISABLED
85
+ _PyCodeArray *tlbc = _PyCode_GetTLBCArray(co);
86
+ assert(f->tlbc_index >= 0 && f->tlbc_index < tlbc->size);
87
+ bytecode = (_Py_CODEUNIT *)tlbc->entries[f->tlbc_index];
88
+ #else
89
+ bytecode = _PyCode_CODE(co);
90
+ #endif
91
+
92
+ return (int)(f->instr_ptr - bytecode) * sizeof(_Py_CODEUNIT);
93
+ }
94
+
95
+ static inline PyFunctionObject *_PyFrame_GetFunction(_PyInterpreterFrame *f) {
96
+ PyObject *func = PyStackRef_AsPyObjectBorrow(f->f_funcobj);
97
+ assert(PyFunction_Check(func));
98
+ return (PyFunctionObject *)func;
99
+ }
100
+
101
+ static inline _PyStackRef *_PyFrame_Stackbase(_PyInterpreterFrame *f) {
102
+ return (f->localsplus + _PyFrame_GetCode(f)->co_nlocalsplus);
103
+ }
104
+
105
+ static inline _PyStackRef _PyFrame_StackPeek(_PyInterpreterFrame *f) {
106
+ assert(f->stackpointer > f->localsplus + _PyFrame_GetCode(f)->co_nlocalsplus);
107
+ assert(!PyStackRef_IsNull(f->stackpointer[-1]));
108
+ return f->stackpointer[-1];
109
+ }
110
+
111
+ static inline _PyStackRef _PyFrame_StackPop(_PyInterpreterFrame *f) {
112
+ assert(f->stackpointer > f->localsplus + _PyFrame_GetCode(f)->co_nlocalsplus);
113
+ f->stackpointer--;
114
+ return *f->stackpointer;
115
+ }
116
+
117
+ static inline void _PyFrame_StackPush(_PyInterpreterFrame *f, _PyStackRef value) {
118
+ *f->stackpointer = value;
119
+ f->stackpointer++;
120
+ }
121
+
122
+ #define FRAME_SPECIALS_SIZE ((int)((sizeof(_PyInterpreterFrame)-1)/sizeof(PyObject *)))
123
+
124
+ static inline int
125
+ _PyFrame_NumSlotsForCodeObject(PyCodeObject *code)
126
+ {
127
+ /* This function needs to remain in sync with the calculation of
128
+ * co_framesize in Tools/build/deepfreeze.py */
129
+ assert(code->co_framesize >= FRAME_SPECIALS_SIZE);
130
+ return code->co_framesize - FRAME_SPECIALS_SIZE;
131
+ }
132
+
133
+ static inline void _PyFrame_Copy(_PyInterpreterFrame *src, _PyInterpreterFrame *dest)
134
+ {
135
+ dest->f_executable = PyStackRef_MakeHeapSafe(src->f_executable);
136
+ // Don't leave a dangling pointer to the old frame when creating generators
137
+ // and coroutines:
138
+ dest->previous = NULL;
139
+ dest->f_funcobj = PyStackRef_MakeHeapSafe(src->f_funcobj);
140
+ dest->f_globals = src->f_globals;
141
+ dest->f_builtins = src->f_builtins;
142
+ dest->f_locals = src->f_locals;
143
+ dest->frame_obj = src->frame_obj;
144
+ dest->instr_ptr = src->instr_ptr;
145
+ #ifdef Py_GIL_DISABLED
146
+ dest->tlbc_index = src->tlbc_index;
147
+ #endif
148
+ assert(src->stackpointer != NULL);
149
+ int stacktop = (int)(src->stackpointer - src->localsplus);
150
+ assert(stacktop >= 0);
151
+ dest->stackpointer = dest->localsplus + stacktop;
152
+ for (int i = 0; i < stacktop; i++) {
153
+ dest->localsplus[i] = PyStackRef_MakeHeapSafe(src->localsplus[i]);
154
+ }
155
+ }
156
+
157
+ #ifdef Py_GIL_DISABLED
158
+ static inline void
159
+ _PyFrame_InitializeTLBC(PyThreadState *tstate, _PyInterpreterFrame *frame,
160
+ PyCodeObject *code)
161
+ {
162
+ _Py_CODEUNIT *tlbc = _PyCode_GetTLBCFast(tstate, code);
163
+ if (tlbc == NULL) {
164
+ // No thread-local bytecode exists for this thread yet; use the main
165
+ // thread's copy, deferring thread-local bytecode creation to the
166
+ // execution of RESUME.
167
+ frame->instr_ptr = _PyCode_CODE(code);
168
+ frame->tlbc_index = 0;
169
+ }
170
+ else {
171
+ frame->instr_ptr = tlbc;
172
+ frame->tlbc_index = ((_PyThreadStateImpl *)tstate)->tlbc_index;
173
+ }
174
+ }
175
+ #endif
176
+
177
+ /* Consumes reference to func and locals.
178
+ Does not initialize frame->previous, which happens
179
+ when frame is linked into the frame stack.
180
+ */
181
+ static inline void
182
+ _PyFrame_Initialize(
183
+ PyThreadState *tstate, _PyInterpreterFrame *frame, _PyStackRef func,
184
+ PyObject *locals, PyCodeObject *code, int null_locals_from, _PyInterpreterFrame *previous)
185
+ {
186
+ frame->previous = previous;
187
+ frame->f_funcobj = func;
188
+ frame->f_executable = PyStackRef_FromPyObjectNew(code);
189
+ PyFunctionObject *func_obj = (PyFunctionObject *)PyStackRef_AsPyObjectBorrow(func);
190
+ frame->f_builtins = func_obj->func_builtins;
191
+ frame->f_globals = func_obj->func_globals;
192
+ frame->f_locals = locals;
193
+ frame->stackpointer = frame->localsplus + code->co_nlocalsplus;
194
+ frame->frame_obj = NULL;
195
+ #ifdef Py_GIL_DISABLED
196
+ _PyFrame_InitializeTLBC(tstate, frame, code);
197
+ #else
198
+ (void)tstate;
199
+ frame->instr_ptr = _PyCode_CODE(code);
200
+ #endif
201
+ frame->return_offset = 0;
202
+ frame->owner = FRAME_OWNED_BY_THREAD;
203
+ frame->visited = 0;
204
+ #ifdef Py_DEBUG
205
+ frame->lltrace = 0;
206
+ #endif
207
+
208
+ for (int i = null_locals_from; i < code->co_nlocalsplus; i++) {
209
+ frame->localsplus[i] = PyStackRef_NULL;
210
+ }
211
+ }
212
+
213
+ /* Gets the pointer to the locals array
214
+ * that precedes this frame.
215
+ */
216
+ static inline _PyStackRef*
217
+ _PyFrame_GetLocalsArray(_PyInterpreterFrame *frame)
218
+ {
219
+ return frame->localsplus;
220
+ }
221
+
222
+ // Fetches the stack pointer, and (on debug builds) sets stackpointer to NULL.
223
+ // Having stackpointer == NULL makes it easier to catch missing stack pointer
224
+ // spills/restores (which could expose invalid values to the GC) using asserts.
225
+ static inline _PyStackRef*
226
+ _PyFrame_GetStackPointer(_PyInterpreterFrame *frame)
227
+ {
228
+ assert(frame->stackpointer != NULL);
229
+ _PyStackRef *sp = frame->stackpointer;
230
+ #ifndef NDEBUG
231
+ frame->stackpointer = NULL;
232
+ #endif
233
+ return sp;
234
+ }
235
+
236
+ static inline void
237
+ _PyFrame_SetStackPointer(_PyInterpreterFrame *frame, _PyStackRef *stack_pointer)
238
+ {
239
+ assert(frame->stackpointer == NULL);
240
+ frame->stackpointer = stack_pointer;
241
+ }
242
+
243
+ /* Determine whether a frame is incomplete.
244
+ * A frame is incomplete if it is part way through
245
+ * creating cell objects or a generator or coroutine.
246
+ *
247
+ * Frames on the frame stack are incomplete until the
248
+ * first RESUME instruction.
249
+ * Frames owned by a generator are always complete.
250
+ *
251
+ * NOTE: We allow racy accesses to the instruction pointer
252
+ * from other threads for sys._current_frames() and similar APIs.
253
+ */
254
+ static inline bool _Py_NO_SANITIZE_THREAD
255
+ _PyFrame_IsIncomplete(_PyInterpreterFrame *frame)
256
+ {
257
+ if (frame->owner >= FRAME_OWNED_BY_INTERPRETER) {
258
+ return true;
259
+ }
260
+ return frame->owner != FRAME_OWNED_BY_GENERATOR &&
261
+ frame->instr_ptr < _PyFrame_GetBytecode(frame) +
262
+ _PyFrame_GetCode(frame)->_co_firsttraceable;
263
+ }
264
+
265
+ static inline _PyInterpreterFrame *
266
+ _PyFrame_GetFirstComplete(_PyInterpreterFrame *frame)
267
+ {
268
+ while (frame && _PyFrame_IsIncomplete(frame)) {
269
+ frame = frame->previous;
270
+ }
271
+ return frame;
272
+ }
273
+
274
+ static inline _PyInterpreterFrame *
275
+ _PyThreadState_GetFrame(PyThreadState *tstate)
276
+ {
277
+ return _PyFrame_GetFirstComplete(tstate->current_frame);
278
+ }
279
+
280
+ /* For use by _PyFrame_GetFrameObject
281
+ Do not call directly. */
282
+ PyFrameObject *
283
+ _PyFrame_MakeAndSetFrameObject(_PyInterpreterFrame *frame);
284
+
285
+ /* Gets the PyFrameObject for this frame, lazily
286
+ * creating it if necessary.
287
+ * Returns a borrowed reference */
288
+ static inline PyFrameObject *
289
+ _PyFrame_GetFrameObject(_PyInterpreterFrame *frame)
290
+ {
291
+
292
+ assert(!_PyFrame_IsIncomplete(frame));
293
+ PyFrameObject *res = frame->frame_obj;
294
+ if (res != NULL) {
295
+ return res;
296
+ }
297
+ return _PyFrame_MakeAndSetFrameObject(frame);
298
+ }
299
+
300
+ void
301
+ _PyFrame_ClearLocals(_PyInterpreterFrame *frame);
302
+
303
+ /* Clears all references in the frame.
304
+ * If take is non-zero, then the _PyInterpreterFrame frame
305
+ * may be transferred to the frame object it references
306
+ * instead of being cleared. Either way
307
+ * the caller no longer owns the references
308
+ * in the frame.
309
+ * take should be set to 1 for heap allocated
310
+ * frames like the ones in generators and coroutines.
311
+ */
312
+ void
313
+ _PyFrame_ClearExceptCode(_PyInterpreterFrame * frame);
314
+
315
+ int
316
+ _PyFrame_Traverse(_PyInterpreterFrame *frame, visitproc visit, void *arg);
317
+
318
+ bool
319
+ _PyFrame_HasHiddenLocals(_PyInterpreterFrame *frame);
320
+
321
+ PyObject *
322
+ _PyFrame_GetLocals(_PyInterpreterFrame *frame);
323
+
324
+ static inline bool
325
+ _PyThreadState_HasStackSpace(PyThreadState *tstate, int size)
326
+ {
327
+ assert(
328
+ (tstate->datastack_top == NULL && tstate->datastack_limit == NULL)
329
+ ||
330
+ (tstate->datastack_top != NULL && tstate->datastack_limit != NULL)
331
+ );
332
+ return tstate->datastack_top != NULL &&
333
+ size < tstate->datastack_limit - tstate->datastack_top;
334
+ }
335
+
336
+ extern _PyInterpreterFrame *
337
+ _PyThreadState_PushFrame(PyThreadState *tstate, size_t size);
338
+
339
+ PyAPI_FUNC(void) _PyThreadState_PopFrame(PyThreadState *tstate, _PyInterpreterFrame *frame);
340
+
341
+ /* Pushes a frame without checking for space.
342
+ * Must be guarded by _PyThreadState_HasStackSpace()
343
+ * Consumes reference to func. */
344
+ static inline _PyInterpreterFrame *
345
+ _PyFrame_PushUnchecked(PyThreadState *tstate, _PyStackRef func, int null_locals_from, _PyInterpreterFrame * previous)
346
+ {
347
+ CALL_STAT_INC(frames_pushed);
348
+ PyFunctionObject *func_obj = (PyFunctionObject *)PyStackRef_AsPyObjectBorrow(func);
349
+ PyCodeObject *code = (PyCodeObject *)func_obj->func_code;
350
+ _PyInterpreterFrame *new_frame = (_PyInterpreterFrame *)tstate->datastack_top;
351
+ tstate->datastack_top += code->co_framesize;
352
+ assert(tstate->datastack_top < tstate->datastack_limit);
353
+ _PyFrame_Initialize(tstate, new_frame, func, NULL, code, null_locals_from,
354
+ previous);
355
+ return new_frame;
356
+ }
357
+
358
+ /* Pushes a trampoline frame without checking for space.
359
+ * Must be guarded by _PyThreadState_HasStackSpace() */
360
+ static inline _PyInterpreterFrame *
361
+ _PyFrame_PushTrampolineUnchecked(PyThreadState *tstate, PyCodeObject *code, int stackdepth, _PyInterpreterFrame * previous)
362
+ {
363
+ CALL_STAT_INC(frames_pushed);
364
+ _PyInterpreterFrame *frame = (_PyInterpreterFrame *)tstate->datastack_top;
365
+ tstate->datastack_top += code->co_framesize;
366
+ assert(tstate->datastack_top < tstate->datastack_limit);
367
+ frame->previous = previous;
368
+ frame->f_funcobj = PyStackRef_None;
369
+ frame->f_executable = PyStackRef_FromPyObjectNew(code);
370
+ #ifdef Py_DEBUG
371
+ frame->f_builtins = NULL;
372
+ frame->f_globals = NULL;
373
+ #endif
374
+ frame->f_locals = NULL;
375
+ assert(stackdepth <= code->co_stacksize);
376
+ frame->stackpointer = frame->localsplus + code->co_nlocalsplus + stackdepth;
377
+ frame->frame_obj = NULL;
378
+ #ifdef Py_GIL_DISABLED
379
+ _PyFrame_InitializeTLBC(tstate, frame, code);
380
+ #else
381
+ frame->instr_ptr = _PyCode_CODE(code);
382
+ #endif
383
+ frame->owner = FRAME_OWNED_BY_THREAD;
384
+ frame->visited = 0;
385
+ #ifdef Py_DEBUG
386
+ frame->lltrace = 0;
387
+ #endif
388
+ frame->return_offset = 0;
389
+ return frame;
390
+ }
391
+
392
+ PyAPI_FUNC(_PyInterpreterFrame *)
393
+ _PyEvalFramePushAndInit(PyThreadState *tstate, _PyStackRef func,
394
+ PyObject *locals, _PyStackRef const *args,
395
+ size_t argcount, PyObject *kwnames,
396
+ _PyInterpreterFrame *previous);
397
+
398
+ #ifdef __cplusplus
399
+ }
400
+ #endif
401
+ #endif // !Py_INTERNAL_INTERP_FRAME_H
@@ -0,0 +1,95 @@
1
+ /* Structures used by pycore_debug_offsets.h.
2
+ *
3
+ * See InternalDocs/frames.md for an explanation of the frame stack
4
+ * including explanation of the PyFrameObject and _PyInterpreterFrame
5
+ * structs.
6
+ */
7
+
8
+ #ifndef Py_INTERNAL_INTERP_FRAME_STRUCTS_H
9
+ #define Py_INTERNAL_INTERP_FRAME_STRUCTS_H
10
+
11
+ #ifndef Py_BUILD_CORE
12
+ # error "this header requires Py_BUILD_CORE define"
13
+ #endif
14
+
15
+ #include "pycore_structs.h" // _PyStackRef
16
+ #include "pycore_typedefs.h" // _PyInterpreterFrame
17
+
18
+ #ifdef __cplusplus
19
+ extern "C" {
20
+ #endif
21
+
22
+ enum _frameowner {
23
+ FRAME_OWNED_BY_THREAD = 0,
24
+ FRAME_OWNED_BY_GENERATOR = 1,
25
+ FRAME_OWNED_BY_FRAME_OBJECT = 2,
26
+ FRAME_OWNED_BY_INTERPRETER = 3,
27
+ FRAME_OWNED_BY_CSTACK = 4,
28
+ };
29
+
30
+ struct _PyInterpreterFrame {
31
+ _PyStackRef f_executable; /* Deferred or strong reference (code object or None) */
32
+ struct _PyInterpreterFrame *previous;
33
+ _PyStackRef f_funcobj; /* Deferred or strong reference. Only valid if not on C stack */
34
+ PyObject *f_globals; /* Borrowed reference. Only valid if not on C stack */
35
+ PyObject *f_builtins; /* Borrowed reference. Only valid if not on C stack */
36
+ PyObject *f_locals; /* Strong reference, may be NULL. Only valid if not on C stack */
37
+ PyFrameObject *frame_obj; /* Strong reference, may be NULL. Only valid if not on C stack */
38
+ _Py_CODEUNIT *instr_ptr; /* Instruction currently executing (or about to begin) */
39
+ _PyStackRef *stackpointer;
40
+ #ifdef Py_GIL_DISABLED
41
+ /* Index of thread-local bytecode containing instr_ptr. */
42
+ int32_t tlbc_index;
43
+ #endif
44
+ uint16_t return_offset; /* Only relevant during a function call */
45
+ char owner;
46
+ #ifdef Py_DEBUG
47
+ uint8_t visited:1;
48
+ uint8_t lltrace:7;
49
+ #else
50
+ uint8_t visited;
51
+ #endif
52
+ /* Locals and stack */
53
+ _PyStackRef localsplus[1];
54
+ };
55
+
56
+
57
+ /* _PyGenObject_HEAD defines the initial segment of generator
58
+ and coroutine objects. */
59
+ #define _PyGenObject_HEAD(prefix) \
60
+ PyObject_HEAD \
61
+ /* List of weak reference. */ \
62
+ PyObject *prefix##_weakreflist; \
63
+ /* Name of the generator. */ \
64
+ PyObject *prefix##_name; \
65
+ /* Qualified name of the generator. */ \
66
+ PyObject *prefix##_qualname; \
67
+ _PyErr_StackItem prefix##_exc_state; \
68
+ PyObject *prefix##_origin_or_finalizer; \
69
+ char prefix##_hooks_inited; \
70
+ char prefix##_closed; \
71
+ char prefix##_running_async; \
72
+ /* The frame */ \
73
+ int8_t prefix##_frame_state; \
74
+ _PyInterpreterFrame prefix##_iframe; \
75
+
76
+ struct _PyGenObject {
77
+ /* The gi_ prefix is intended to remind of generator-iterator. */
78
+ _PyGenObject_HEAD(gi)
79
+ };
80
+
81
+ struct _PyCoroObject {
82
+ _PyGenObject_HEAD(cr)
83
+ };
84
+
85
+ struct _PyAsyncGenObject {
86
+ _PyGenObject_HEAD(ag)
87
+ };
88
+
89
+ #undef _PyGenObject_HEAD
90
+
91
+
92
+ #ifdef __cplusplus
93
+ }
94
+ #endif
95
+ #endif // !Py_INTERNAL_INTERP_FRAME_STRUCTS_H
@@ -0,0 +1,26 @@
1
+ #ifndef Py_INTERNAL_INTERPOLATION_H
2
+ #define Py_INTERNAL_INTERPOLATION_H
3
+
4
+ #ifdef __cplusplus
5
+ extern "C" {
6
+ #endif
7
+
8
+ #ifndef Py_BUILD_CORE
9
+ # error "this header requires Py_BUILD_CORE define"
10
+ #endif
11
+
12
+ extern PyTypeObject _PyInterpolation_Type;
13
+
14
+ #define _PyInterpolation_CheckExact(op) Py_IS_TYPE((op), &_PyInterpolation_Type)
15
+
16
+ PyAPI_FUNC(PyObject *) _PyInterpolation_Build(PyObject *value, PyObject *str,
17
+ int conversion, PyObject *format_spec);
18
+
19
+ extern PyStatus _PyInterpolation_InitTypes(PyInterpreterState *interp);
20
+ extern PyObject *_PyInterpolation_GetValueRef(PyObject *interpolation);
21
+
22
+ #ifdef __cplusplus
23
+ }
24
+ #endif
25
+
26
+ #endif
@@ -0,0 +1,51 @@
1
+ #ifndef Py_INTERNAL_INTRINSIC_H
2
+ #define Py_INTERNAL_INTRINSIC_H
3
+
4
+ #ifndef Py_BUILD_CORE
5
+ # error "this header requires Py_BUILD_CORE define"
6
+ #endif
7
+
8
+ /* Unary Functions: */
9
+ #define INTRINSIC_1_INVALID 0
10
+ #define INTRINSIC_PRINT 1
11
+ #define INTRINSIC_IMPORT_STAR 2
12
+ #define INTRINSIC_STOPITERATION_ERROR 3
13
+ #define INTRINSIC_ASYNC_GEN_WRAP 4
14
+ #define INTRINSIC_UNARY_POSITIVE 5
15
+ #define INTRINSIC_LIST_TO_TUPLE 6
16
+ #define INTRINSIC_TYPEVAR 7
17
+ #define INTRINSIC_PARAMSPEC 8
18
+ #define INTRINSIC_TYPEVARTUPLE 9
19
+ #define INTRINSIC_SUBSCRIPT_GENERIC 10
20
+ #define INTRINSIC_TYPEALIAS 11
21
+
22
+ #define MAX_INTRINSIC_1 11
23
+
24
+
25
+ /* Binary Functions: */
26
+ #define INTRINSIC_2_INVALID 0
27
+ #define INTRINSIC_PREP_RERAISE_STAR 1
28
+ #define INTRINSIC_TYPEVAR_WITH_BOUND 2
29
+ #define INTRINSIC_TYPEVAR_WITH_CONSTRAINTS 3
30
+ #define INTRINSIC_SET_FUNCTION_TYPE_PARAMS 4
31
+ #define INTRINSIC_SET_TYPEPARAM_DEFAULT 5
32
+
33
+ #define MAX_INTRINSIC_2 5
34
+
35
+ typedef PyObject *(*intrinsic_func1)(PyThreadState* tstate, PyObject *value);
36
+ typedef PyObject *(*intrinsic_func2)(PyThreadState* tstate, PyObject *value1, PyObject *value2);
37
+
38
+ typedef struct {
39
+ intrinsic_func1 func;
40
+ const char *name;
41
+ } intrinsic_func1_info;
42
+
43
+ typedef struct {
44
+ intrinsic_func2 func;
45
+ const char *name;
46
+ } intrinsic_func2_info;
47
+
48
+ PyAPI_DATA(const intrinsic_func1_info) _PyIntrinsics_UnaryFunctions[];
49
+ PyAPI_DATA(const intrinsic_func2_info) _PyIntrinsics_BinaryFunctions[];
50
+
51
+ #endif // !Py_INTERNAL_INTRINSIC_H
@@ -0,0 +1,29 @@
1
+ #ifndef Py_INTERNAL_JIT_H
2
+ #define Py_INTERNAL_JIT_H
3
+
4
+ #ifdef __cplusplus
5
+ extern "C" {
6
+ #endif
7
+
8
+ #include "pycore_interp.h"
9
+ #include "pycore_optimizer.h"
10
+ #include "pycore_stackref.h"
11
+
12
+ #ifndef Py_BUILD_CORE
13
+ # error "this header requires Py_BUILD_CORE define"
14
+ #endif
15
+
16
+ #ifdef _Py_JIT
17
+
18
+ typedef _Py_CODEUNIT *(*jit_func)(_PyInterpreterFrame *frame, _PyStackRef *stack_pointer, PyThreadState *tstate);
19
+
20
+ int _PyJIT_Compile(_PyExecutorObject *executor, const _PyUOpInstruction *trace, size_t length);
21
+ void _PyJIT_Free(_PyExecutorObject *executor);
22
+
23
+ #endif // _Py_JIT
24
+
25
+ #ifdef __cplusplus
26
+ }
27
+ #endif
28
+
29
+ #endif // !Py_INTERNAL_JIT_H
@@ -0,0 +1,81 @@
1
+ #ifndef Py_INTERNAL_LIST_H
2
+ #define Py_INTERNAL_LIST_H
3
+ #ifdef __cplusplus
4
+ extern "C" {
5
+ #endif
6
+
7
+ #ifndef Py_BUILD_CORE
8
+ # error "this header requires Py_BUILD_CORE define"
9
+ #endif
10
+
11
+ #ifdef Py_GIL_DISABLED
12
+ #include "pycore_stackref.h"
13
+ #endif
14
+
15
+ PyAPI_FUNC(PyObject*) _PyList_Extend(PyListObject *, PyObject *);
16
+ PyAPI_FUNC(PyObject) *_PyList_SliceSubscript(PyObject*, PyObject*);
17
+ extern void _PyList_DebugMallocStats(FILE *out);
18
+ // _PyList_GetItemRef should be used only when the object is known as a list
19
+ // because it doesn't raise TypeError when the object is not a list, whereas PyList_GetItemRef does.
20
+ extern PyObject* _PyList_GetItemRef(PyListObject *, Py_ssize_t i);
21
+
22
+
23
+ #ifdef Py_GIL_DISABLED
24
+ // Returns -1 in case of races with other threads.
25
+ extern int _PyList_GetItemRefNoLock(PyListObject *, Py_ssize_t, _PyStackRef *);
26
+ #endif
27
+
28
+ #define _PyList_ITEMS(op) _Py_RVALUE(_PyList_CAST(op)->ob_item)
29
+
30
+ PyAPI_FUNC(int)
31
+ _PyList_AppendTakeRefListResize(PyListObject *self, PyObject *newitem);
32
+
33
+ // In free-threaded build: self should be locked by the caller, if it should be thread-safe.
34
+ static inline int
35
+ _PyList_AppendTakeRef(PyListObject *self, PyObject *newitem)
36
+ {
37
+ assert(self != NULL && newitem != NULL);
38
+ assert(PyList_Check(self));
39
+ Py_ssize_t len = Py_SIZE(self);
40
+ Py_ssize_t allocated = self->allocated;
41
+ assert((size_t)len + 1 < PY_SSIZE_T_MAX);
42
+ if (allocated > len) {
43
+ #ifdef Py_GIL_DISABLED
44
+ _Py_atomic_store_ptr_release(&self->ob_item[len], newitem);
45
+ #else
46
+ PyList_SET_ITEM(self, len, newitem);
47
+ #endif
48
+ Py_SET_SIZE(self, len + 1);
49
+ return 0;
50
+ }
51
+ return _PyList_AppendTakeRefListResize(self, newitem);
52
+ }
53
+
54
+ // Repeat the bytes of a buffer in place
55
+ static inline void
56
+ _Py_memory_repeat(char* dest, Py_ssize_t len_dest, Py_ssize_t len_src)
57
+ {
58
+ assert(len_src > 0);
59
+ Py_ssize_t copied = len_src;
60
+ while (copied < len_dest) {
61
+ Py_ssize_t bytes_to_copy = Py_MIN(copied, len_dest - copied);
62
+ memcpy(dest + copied, dest, (size_t)bytes_to_copy);
63
+ copied += bytes_to_copy;
64
+ }
65
+ }
66
+
67
+ typedef struct {
68
+ PyObject_HEAD
69
+ Py_ssize_t it_index;
70
+ PyListObject *it_seq; /* Set to NULL when iterator is exhausted */
71
+ } _PyListIterObject;
72
+
73
+ union _PyStackRef;
74
+
75
+ PyAPI_FUNC(PyObject *)_PyList_FromStackRefStealOnSuccess(const union _PyStackRef *src, Py_ssize_t n);
76
+ PyAPI_FUNC(PyObject *)_PyList_AsTupleAndClear(PyListObject *v);
77
+
78
+ #ifdef __cplusplus
79
+ }
80
+ #endif
81
+ #endif /* !Py_INTERNAL_LIST_H */