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,206 @@
1
+ #ifndef Py_INTERNAL_CALL_H
2
+ #define Py_INTERNAL_CALL_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
+ #include "pycore_code.h" // EVAL_CALL_STAT_INC_IF_FUNCTION()
12
+ #include "pycore_pystate.h" // _PyThreadState_GET()
13
+ #include "pycore_stats.h"
14
+
15
+ /* Suggested size (number of positional arguments) for arrays of PyObject*
16
+ allocated on a C stack to avoid allocating memory on the heap memory. Such
17
+ array is used to pass positional arguments to call functions of the
18
+ PyObject_Vectorcall() family.
19
+
20
+ The size is chosen to not abuse the C stack and so limit the risk of stack
21
+ overflow. The size is also chosen to allow using the small stack for most
22
+ function calls of the Python standard library. On 64-bit CPU, it allocates
23
+ 40 bytes on the stack. */
24
+ #define _PY_FASTCALL_SMALL_STACK 5
25
+
26
+
27
+ // Export for 'math' shared extension, used via _PyObject_VectorcallTstate()
28
+ // static inline function.
29
+ PyAPI_FUNC(PyObject*) _Py_CheckFunctionResult(
30
+ PyThreadState *tstate,
31
+ PyObject *callable,
32
+ PyObject *result,
33
+ const char *where);
34
+
35
+ extern PyObject* _PyObject_Call_Prepend(
36
+ PyThreadState *tstate,
37
+ PyObject *callable,
38
+ PyObject *obj,
39
+ PyObject *args,
40
+ PyObject *kwargs);
41
+
42
+ extern PyObject* _PyObject_VectorcallDictTstate(
43
+ PyThreadState *tstate,
44
+ PyObject *callable,
45
+ PyObject *const *args,
46
+ size_t nargsf,
47
+ PyObject *kwargs);
48
+
49
+ extern PyObject* _PyObject_Call(
50
+ PyThreadState *tstate,
51
+ PyObject *callable,
52
+ PyObject *args,
53
+ PyObject *kwargs);
54
+
55
+ extern PyObject * _PyObject_CallMethodFormat(
56
+ PyThreadState *tstate,
57
+ PyObject *callable,
58
+ const char *format,
59
+ ...);
60
+
61
+ // Export for 'array' shared extension
62
+ PyAPI_FUNC(PyObject*) _PyObject_CallMethod(
63
+ PyObject *obj,
64
+ PyObject *name,
65
+ const char *format, ...);
66
+
67
+ extern PyObject* _PyObject_CallMethodIdObjArgs(
68
+ PyObject *obj,
69
+ _Py_Identifier *name,
70
+ ...);
71
+
72
+ static inline PyObject *
73
+ _PyObject_VectorcallMethodId(
74
+ _Py_Identifier *name, PyObject *const *args,
75
+ size_t nargsf, PyObject *kwnames)
76
+ {
77
+ PyObject *oname = _PyUnicode_FromId(name); /* borrowed */
78
+ if (!oname) {
79
+ return _Py_NULL;
80
+ }
81
+ return PyObject_VectorcallMethod(oname, args, nargsf, kwnames);
82
+ }
83
+
84
+ static inline PyObject *
85
+ _PyObject_CallMethodIdNoArgs(PyObject *self, _Py_Identifier *name)
86
+ {
87
+ size_t nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET;
88
+ return _PyObject_VectorcallMethodId(name, &self, nargsf, _Py_NULL);
89
+ }
90
+
91
+ static inline PyObject *
92
+ _PyObject_CallMethodIdOneArg(PyObject *self, _Py_Identifier *name, PyObject *arg)
93
+ {
94
+ PyObject *args[2] = {self, arg};
95
+ size_t nargsf = 2 | PY_VECTORCALL_ARGUMENTS_OFFSET;
96
+ assert(arg != NULL);
97
+ return _PyObject_VectorcallMethodId(name, args, nargsf, _Py_NULL);
98
+ }
99
+
100
+
101
+ /* === Vectorcall protocol (PEP 590) ============================= */
102
+
103
+ // Call callable using tp_call. Arguments are like PyObject_Vectorcall(),
104
+ // except that nargs is plainly the number of arguments without flags.
105
+ //
106
+ // Export for 'math' shared extension, used via _PyObject_VectorcallTstate()
107
+ // static inline function.
108
+ PyAPI_FUNC(PyObject*) _PyObject_MakeTpCall(
109
+ PyThreadState *tstate,
110
+ PyObject *callable,
111
+ PyObject *const *args, Py_ssize_t nargs,
112
+ PyObject *keywords);
113
+
114
+ // Static inline variant of public PyVectorcall_Function().
115
+ static inline vectorcallfunc
116
+ _PyVectorcall_FunctionInline(PyObject *callable)
117
+ {
118
+ assert(callable != NULL);
119
+
120
+ PyTypeObject *tp = Py_TYPE(callable);
121
+ if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
122
+ return NULL;
123
+ }
124
+ assert(PyCallable_Check(callable));
125
+
126
+ Py_ssize_t offset = tp->tp_vectorcall_offset;
127
+ assert(offset > 0);
128
+
129
+ vectorcallfunc ptr;
130
+ memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
131
+ return ptr;
132
+ }
133
+
134
+
135
+ /* Call the callable object 'callable' with the "vectorcall" calling
136
+ convention.
137
+
138
+ args is a C array for positional arguments.
139
+
140
+ nargsf is the number of positional arguments plus optionally the flag
141
+ PY_VECTORCALL_ARGUMENTS_OFFSET which means that the caller is allowed to
142
+ modify args[-1].
143
+
144
+ kwnames is a tuple of keyword names. The values of the keyword arguments
145
+ are stored in "args" after the positional arguments (note that the number
146
+ of keyword arguments does not change nargsf). kwnames can also be NULL if
147
+ there are no keyword arguments.
148
+
149
+ keywords must only contain strings and all keys must be unique.
150
+
151
+ Return the result on success. Raise an exception and return NULL on
152
+ error. */
153
+ static inline PyObject *
154
+ _PyObject_VectorcallTstate(PyThreadState *tstate, PyObject *callable,
155
+ PyObject *const *args, size_t nargsf,
156
+ PyObject *kwnames)
157
+ {
158
+ vectorcallfunc func;
159
+ PyObject *res;
160
+
161
+ assert(kwnames == NULL || PyTuple_Check(kwnames));
162
+ assert(args != NULL || PyVectorcall_NARGS(nargsf) == 0);
163
+
164
+ func = _PyVectorcall_FunctionInline(callable);
165
+ if (func == NULL) {
166
+ Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
167
+ return _PyObject_MakeTpCall(tstate, callable, args, nargs, kwnames);
168
+ }
169
+ res = func(callable, args, nargsf, kwnames);
170
+ return _Py_CheckFunctionResult(tstate, callable, res, NULL);
171
+ }
172
+
173
+
174
+ static inline PyObject *
175
+ _PyObject_CallNoArgsTstate(PyThreadState *tstate, PyObject *func) {
176
+ return _PyObject_VectorcallTstate(tstate, func, NULL, 0, NULL);
177
+ }
178
+
179
+
180
+ // Private static inline function variant of public PyObject_CallNoArgs()
181
+ static inline PyObject *
182
+ _PyObject_CallNoArgs(PyObject *func) {
183
+ EVAL_CALL_STAT_INC_IF_FUNCTION(EVAL_CALL_API, func);
184
+ PyThreadState *tstate = _PyThreadState_GET();
185
+ return _PyObject_VectorcallTstate(tstate, func, NULL, 0, NULL);
186
+ }
187
+
188
+
189
+ extern PyObject *const *
190
+ _PyStack_UnpackDict(PyThreadState *tstate,
191
+ PyObject *const *args, Py_ssize_t nargs,
192
+ PyObject *kwargs, PyObject **p_kwnames);
193
+
194
+ extern void _PyStack_UnpackDict_Free(
195
+ PyObject *const *stack,
196
+ Py_ssize_t nargs,
197
+ PyObject *kwnames);
198
+
199
+ extern void _PyStack_UnpackDict_FreeNoDecRef(
200
+ PyObject *const *stack,
201
+ PyObject *kwnames);
202
+
203
+ #ifdef __cplusplus
204
+ }
205
+ #endif
206
+ #endif /* !Py_INTERNAL_CALL_H */
@@ -0,0 +1,17 @@
1
+ #ifndef Py_INTERNAL_PYCAPSULE_H
2
+ #define Py_INTERNAL_PYCAPSULE_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
+ // Export for '_socket' shared extension
12
+ PyAPI_FUNC(int) _PyCapsule_SetTraverse(PyObject *op, traverseproc traverse_func, inquiry clear_func);
13
+
14
+ #ifdef __cplusplus
15
+ }
16
+ #endif
17
+ #endif /* !Py_INTERNAL_PYCAPSULE_H */
@@ -0,0 +1,75 @@
1
+ #ifndef Py_INTERNAL_CELL_H
2
+ #define Py_INTERNAL_CELL_H
3
+
4
+ #include "pycore_critical_section.h"
5
+ #include "pycore_object.h"
6
+ #include "pycore_stackref.h"
7
+
8
+ #ifdef __cplusplus
9
+ extern "C" {
10
+ #endif
11
+
12
+ #ifndef Py_BUILD_CORE
13
+ # error "this header requires Py_BUILD_CORE define"
14
+ #endif
15
+
16
+ // Sets the cell contents to `value` and return previous contents. Steals a
17
+ // reference to `value`.
18
+ static inline PyObject *
19
+ PyCell_SwapTakeRef(PyCellObject *cell, PyObject *value)
20
+ {
21
+ PyObject *old_value;
22
+ Py_BEGIN_CRITICAL_SECTION(cell);
23
+ old_value = cell->ob_ref;
24
+ FT_ATOMIC_STORE_PTR_RELEASE(cell->ob_ref, value);
25
+ Py_END_CRITICAL_SECTION();
26
+ return old_value;
27
+ }
28
+
29
+ static inline void
30
+ PyCell_SetTakeRef(PyCellObject *cell, PyObject *value)
31
+ {
32
+ PyObject *old_value = PyCell_SwapTakeRef(cell, value);
33
+ Py_XDECREF(old_value);
34
+ }
35
+
36
+ // Gets the cell contents. Returns a new reference.
37
+ static inline PyObject *
38
+ PyCell_GetRef(PyCellObject *cell)
39
+ {
40
+ PyObject *res;
41
+ Py_BEGIN_CRITICAL_SECTION(cell);
42
+ #ifdef Py_GIL_DISABLED
43
+ res = _Py_XNewRefWithLock(cell->ob_ref);
44
+ #else
45
+ res = Py_XNewRef(cell->ob_ref);
46
+ #endif
47
+ Py_END_CRITICAL_SECTION();
48
+ return res;
49
+ }
50
+
51
+ static inline _PyStackRef
52
+ _PyCell_GetStackRef(PyCellObject *cell)
53
+ {
54
+ PyObject *value;
55
+ #ifdef Py_GIL_DISABLED
56
+ value = _Py_atomic_load_ptr(&cell->ob_ref);
57
+ if (value == NULL) {
58
+ return PyStackRef_NULL;
59
+ }
60
+ _PyStackRef ref;
61
+ if (_Py_TryIncrefCompareStackRef(&cell->ob_ref, value, &ref)) {
62
+ return ref;
63
+ }
64
+ #endif
65
+ value = PyCell_GetRef(cell);
66
+ if (value == NULL) {
67
+ return PyStackRef_NULL;
68
+ }
69
+ return PyStackRef_FromPyObjectSteal(value);
70
+ }
71
+
72
+ #ifdef __cplusplus
73
+ }
74
+ #endif
75
+ #endif /* !Py_INTERNAL_CELL_H */
@@ -0,0 +1,390 @@
1
+ #ifndef Py_INTERNAL_CEVAL_H
2
+ #define Py_INTERNAL_CEVAL_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
+ #include "dynamic_annotations.h" // _Py_ANNOTATE_RWLOCK_CREATE
12
+
13
+ #include "pycore_code.h" // _PyCode_GetTLBCFast()
14
+ #include "pycore_interp.h" // PyInterpreterState.eval_frame
15
+ #include "pycore_pystate.h" // _PyThreadState_GET()
16
+ #include "pycore_stats.h" // EVAL_CALL_STAT_INC()
17
+ #include "pycore_typedefs.h" // _PyInterpreterFrame
18
+
19
+
20
+ /* Forward declarations */
21
+ struct _ceval_runtime_state;
22
+
23
+ // Export for '_lsprof' shared extension
24
+ PyAPI_FUNC(int) _PyEval_SetProfile(PyThreadState *tstate, Py_tracefunc func, PyObject *arg);
25
+ extern int _PyEval_SetProfileAllThreads(PyInterpreterState *interp, Py_tracefunc func, PyObject *arg);
26
+
27
+ extern int _PyEval_SetTrace(PyThreadState *tstate, Py_tracefunc func, PyObject *arg);
28
+ extern int _PyEval_SetTraceAllThreads(PyInterpreterState *interp, Py_tracefunc func, PyObject *arg);
29
+
30
+ extern int _PyEval_SetOpcodeTrace(PyFrameObject *f, bool enable);
31
+
32
+ // Helper to look up a builtin object
33
+ // Export for 'array' shared extension
34
+ PyAPI_FUNC(PyObject*) _PyEval_GetBuiltin(PyObject *);
35
+
36
+ extern PyObject* _PyEval_GetBuiltinId(_Py_Identifier *);
37
+
38
+ extern void _PyEval_SetSwitchInterval(unsigned long microseconds);
39
+ extern unsigned long _PyEval_GetSwitchInterval(void);
40
+
41
+ // Export for '_queue' shared extension
42
+ PyAPI_FUNC(int) _PyEval_MakePendingCalls(PyThreadState *);
43
+
44
+ #ifndef Py_DEFAULT_RECURSION_LIMIT
45
+ # define Py_DEFAULT_RECURSION_LIMIT 1000
46
+ #endif
47
+
48
+ extern void _Py_FinishPendingCalls(PyThreadState *tstate);
49
+ extern void _PyEval_InitState(PyInterpreterState *);
50
+ extern void _PyEval_SignalReceived(void);
51
+
52
+ // bitwise flags:
53
+ #define _Py_PENDING_MAINTHREADONLY 1
54
+ #define _Py_PENDING_RAWFREE 2
55
+
56
+ typedef int _Py_add_pending_call_result;
57
+ #define _Py_ADD_PENDING_SUCCESS 0
58
+ #define _Py_ADD_PENDING_FULL -1
59
+
60
+ // Export for '_testinternalcapi' shared extension
61
+ PyAPI_FUNC(_Py_add_pending_call_result) _PyEval_AddPendingCall(
62
+ PyInterpreterState *interp,
63
+ _Py_pending_call_func func,
64
+ void *arg,
65
+ int flags);
66
+
67
+ #ifdef HAVE_FORK
68
+ extern PyStatus _PyEval_ReInitThreads(PyThreadState *tstate);
69
+ #endif
70
+
71
+ // Used by sys.call_tracing()
72
+ extern PyObject* _PyEval_CallTracing(PyObject *func, PyObject *args);
73
+
74
+ // Used by sys.get_asyncgen_hooks()
75
+ extern PyObject* _PyEval_GetAsyncGenFirstiter(void);
76
+ extern PyObject* _PyEval_GetAsyncGenFinalizer(void);
77
+
78
+ // Used by sys.set_asyncgen_hooks()
79
+ extern int _PyEval_SetAsyncGenFirstiter(PyObject *);
80
+ extern int _PyEval_SetAsyncGenFinalizer(PyObject *);
81
+
82
+ // Used by sys.get_coroutine_origin_tracking_depth()
83
+ // and sys.set_coroutine_origin_tracking_depth()
84
+ extern int _PyEval_GetCoroutineOriginTrackingDepth(void);
85
+ extern int _PyEval_SetCoroutineOriginTrackingDepth(int depth);
86
+
87
+ extern void _PyEval_Fini(void);
88
+
89
+
90
+ extern PyObject* _PyEval_GetBuiltins(PyThreadState *tstate);
91
+
92
+ // Trampoline API
93
+
94
+ typedef struct {
95
+ // Callback to initialize the trampoline state
96
+ void* (*init_state)(void);
97
+ // Callback to register every trampoline being created
98
+ void (*write_state)(void* state, const void *code_addr,
99
+ unsigned int code_size, PyCodeObject* code);
100
+ // Callback to free the trampoline state
101
+ int (*free_state)(void* state);
102
+ } _PyPerf_Callbacks;
103
+
104
+ extern int _PyPerfTrampoline_SetCallbacks(_PyPerf_Callbacks *);
105
+ extern void _PyPerfTrampoline_GetCallbacks(_PyPerf_Callbacks *);
106
+ extern int _PyPerfTrampoline_Init(int activate);
107
+ extern int _PyPerfTrampoline_Fini(void);
108
+ extern void _PyPerfTrampoline_FreeArenas(void);
109
+ extern int _PyIsPerfTrampolineActive(void);
110
+ extern PyStatus _PyPerfTrampoline_AfterFork_Child(void);
111
+ #ifdef PY_HAVE_PERF_TRAMPOLINE
112
+ extern _PyPerf_Callbacks _Py_perfmap_callbacks;
113
+ extern _PyPerf_Callbacks _Py_perfmap_jit_callbacks;
114
+ #endif
115
+
116
+ static inline PyObject*
117
+ _PyEval_EvalFrame(PyThreadState *tstate, _PyInterpreterFrame *frame, int throwflag)
118
+ {
119
+ EVAL_CALL_STAT_INC(EVAL_CALL_TOTAL);
120
+ if (tstate->interp->eval_frame == NULL) {
121
+ return _PyEval_EvalFrameDefault(tstate, frame, throwflag);
122
+ }
123
+ return tstate->interp->eval_frame(tstate, frame, throwflag);
124
+ }
125
+
126
+ extern PyObject*
127
+ _PyEval_Vector(PyThreadState *tstate,
128
+ PyFunctionObject *func, PyObject *locals,
129
+ PyObject* const* args, size_t argcount,
130
+ PyObject *kwnames);
131
+
132
+ extern int _PyEval_ThreadsInitialized(void);
133
+ extern void _PyEval_InitGIL(PyThreadState *tstate, int own_gil);
134
+ extern void _PyEval_FiniGIL(PyInterpreterState *interp);
135
+
136
+ extern void _PyEval_AcquireLock(PyThreadState *tstate);
137
+
138
+ extern void _PyEval_ReleaseLock(PyInterpreterState *, PyThreadState *,
139
+ int final_release);
140
+
141
+ #ifdef Py_GIL_DISABLED
142
+ // Returns 0 or 1 if the GIL for the given thread's interpreter is disabled or
143
+ // enabled, respectively.
144
+ //
145
+ // The enabled state of the GIL will not change while one or more threads are
146
+ // attached.
147
+ static inline int
148
+ _PyEval_IsGILEnabled(PyThreadState *tstate)
149
+ {
150
+ struct _gil_runtime_state *gil = tstate->interp->ceval.gil;
151
+ return _Py_atomic_load_int_relaxed(&gil->enabled) != 0;
152
+ }
153
+
154
+ // Enable or disable the GIL used by the interpreter that owns tstate, which
155
+ // must be the current thread. This may affect other interpreters, if the GIL
156
+ // is shared. All three functions will be no-ops (and return 0) if the
157
+ // interpreter's `enable_gil' config is not _PyConfig_GIL_DEFAULT.
158
+ //
159
+ // Every call to _PyEval_EnableGILTransient() must be paired with exactly one
160
+ // call to either _PyEval_EnableGILPermanent() or
161
+ // _PyEval_DisableGIL(). _PyEval_EnableGILPermanent() and _PyEval_DisableGIL()
162
+ // must only be called while the GIL is enabled from a call to
163
+ // _PyEval_EnableGILTransient().
164
+ //
165
+ // _PyEval_EnableGILTransient() returns 1 if it enabled the GIL, or 0 if the
166
+ // GIL was already enabled, whether transiently or permanently. The caller will
167
+ // hold the GIL upon return.
168
+ //
169
+ // _PyEval_EnableGILPermanent() returns 1 if it permanently enabled the GIL
170
+ // (which must already be enabled), or 0 if it was already permanently
171
+ // enabled. Once _PyEval_EnableGILPermanent() has been called once, all
172
+ // subsequent calls to any of the three functions will be no-ops.
173
+ //
174
+ // _PyEval_DisableGIL() returns 1 if it disabled the GIL, or 0 if the GIL was
175
+ // kept enabled because of another request, whether transient or permanent.
176
+ //
177
+ // All three functions must be called by an attached thread (this implies that
178
+ // if the GIL is enabled, the current thread must hold it).
179
+ extern int _PyEval_EnableGILTransient(PyThreadState *tstate);
180
+ extern int _PyEval_EnableGILPermanent(PyThreadState *tstate);
181
+ extern int _PyEval_DisableGIL(PyThreadState *state);
182
+
183
+
184
+ static inline _Py_CODEUNIT *
185
+ _PyEval_GetExecutableCode(PyThreadState *tstate, PyCodeObject *co)
186
+ {
187
+ _Py_CODEUNIT *bc = _PyCode_GetTLBCFast(tstate, co);
188
+ if (bc != NULL) {
189
+ return bc;
190
+ }
191
+ return _PyCode_GetTLBC(co);
192
+ }
193
+
194
+ #endif
195
+
196
+ extern void _PyEval_DeactivateOpCache(void);
197
+
198
+
199
+ /* --- _Py_EnterRecursiveCall() ----------------------------------------- */
200
+
201
+ static inline int _Py_MakeRecCheck(PyThreadState *tstate) {
202
+ uintptr_t here_addr = _Py_get_machine_stack_pointer();
203
+ _PyThreadStateImpl *_tstate = (_PyThreadStateImpl *)tstate;
204
+ // Overflow if stack pointer is between soft limit and the base of the hardware stack.
205
+ // If it is below the hardware stack base, assume that we have the wrong stack limits, and do nothing.
206
+ // We could have the wrong stack limits because of limited platform support, or user-space threads.
207
+ #if _Py_STACK_GROWS_DOWN
208
+ return here_addr < _tstate->c_stack_soft_limit && here_addr >= _tstate->c_stack_soft_limit - 2 * _PyOS_STACK_MARGIN_BYTES;
209
+ #else
210
+ return here_addr > _tstate->c_stack_soft_limit && here_addr <= _tstate->c_stack_soft_limit + 2 * _PyOS_STACK_MARGIN_BYTES;
211
+ #endif
212
+ }
213
+
214
+ // Export for '_json' shared extension, used via _Py_EnterRecursiveCall()
215
+ // static inline function.
216
+ PyAPI_FUNC(int) _Py_CheckRecursiveCall(
217
+ PyThreadState *tstate,
218
+ const char *where);
219
+
220
+ int _Py_CheckRecursiveCallPy(
221
+ PyThreadState *tstate);
222
+
223
+ static inline int _Py_EnterRecursiveCallTstate(PyThreadState *tstate,
224
+ const char *where) {
225
+ return (_Py_MakeRecCheck(tstate) && _Py_CheckRecursiveCall(tstate, where));
226
+ }
227
+
228
+ static inline int _Py_EnterRecursiveCall(const char *where) {
229
+ PyThreadState *tstate = _PyThreadState_GET();
230
+ return _Py_EnterRecursiveCallTstate(tstate, where);
231
+ }
232
+
233
+ static inline void _Py_LeaveRecursiveCallTstate(PyThreadState *tstate) {
234
+ (void)tstate;
235
+ }
236
+
237
+ PyAPI_FUNC(void) _Py_InitializeRecursionLimits(PyThreadState *tstate);
238
+
239
+ static inline int _Py_ReachedRecursionLimit(PyThreadState *tstate) {
240
+ uintptr_t here_addr = _Py_get_machine_stack_pointer();
241
+ _PyThreadStateImpl *_tstate = (_PyThreadStateImpl *)tstate;
242
+ assert(_tstate->c_stack_hard_limit != 0);
243
+ #if _Py_STACK_GROWS_DOWN
244
+ return here_addr <= _tstate->c_stack_soft_limit;
245
+ #else
246
+ return here_addr >= _tstate->c_stack_soft_limit;
247
+ #endif
248
+ }
249
+
250
+ static inline void _Py_LeaveRecursiveCall(void) {
251
+ }
252
+
253
+ extern _PyInterpreterFrame* _PyEval_GetFrame(void);
254
+
255
+ extern PyObject * _PyEval_GetGlobalsFromRunningMain(PyThreadState *);
256
+ extern int _PyEval_EnsureBuiltins(
257
+ PyThreadState *,
258
+ PyObject *,
259
+ PyObject **p_builtins);
260
+ extern int _PyEval_EnsureBuiltinsWithModule(
261
+ PyThreadState *,
262
+ PyObject *,
263
+ PyObject **p_builtins);
264
+
265
+ PyAPI_FUNC(PyObject *)_Py_MakeCoro(PyFunctionObject *func);
266
+
267
+ /* Handle signals, pending calls, GIL drop request
268
+ and asynchronous exception */
269
+ PyAPI_FUNC(int) _Py_HandlePending(PyThreadState *tstate);
270
+
271
+ extern PyObject * _PyEval_GetFrameLocals(void);
272
+
273
+ typedef PyObject *(*conversion_func)(PyObject *);
274
+
275
+ PyAPI_DATA(const binaryfunc) _PyEval_BinaryOps[];
276
+ PyAPI_DATA(const conversion_func) _PyEval_ConversionFuncs[];
277
+
278
+ typedef struct _special_method {
279
+ PyObject *name;
280
+ const char *error;
281
+ const char *error_suggestion; // improved optional suggestion
282
+ } _Py_SpecialMethod;
283
+
284
+ PyAPI_DATA(const _Py_SpecialMethod) _Py_SpecialMethods[];
285
+ PyAPI_DATA(const size_t) _Py_FunctionAttributeOffsets[];
286
+
287
+ PyAPI_FUNC(int) _PyEval_CheckExceptStarTypeValid(PyThreadState *tstate, PyObject* right);
288
+ PyAPI_FUNC(int) _PyEval_CheckExceptTypeValid(PyThreadState *tstate, PyObject* right);
289
+ PyAPI_FUNC(int) _PyEval_ExceptionGroupMatch(_PyInterpreterFrame *, PyObject* exc_value, PyObject *match_type, PyObject **match, PyObject **rest);
290
+ PyAPI_FUNC(void) _PyEval_FormatAwaitableError(PyThreadState *tstate, PyTypeObject *type, int oparg);
291
+ PyAPI_FUNC(void) _PyEval_FormatExcCheckArg(PyThreadState *tstate, PyObject *exc, const char *format_str, PyObject *obj);
292
+ PyAPI_FUNC(void) _PyEval_FormatExcUnbound(PyThreadState *tstate, PyCodeObject *co, int oparg);
293
+ PyAPI_FUNC(void) _PyEval_FormatKwargsError(PyThreadState *tstate, PyObject *func, PyObject *kwargs);
294
+ PyAPI_FUNC(PyObject *) _PyEval_ImportFrom(PyThreadState *, PyObject *, PyObject *);
295
+ PyAPI_FUNC(PyObject *) _PyEval_ImportName(PyThreadState *, _PyInterpreterFrame *, PyObject *, PyObject *, PyObject *);
296
+ PyAPI_FUNC(PyObject *)_PyEval_MatchClass(PyThreadState *tstate, PyObject *subject, PyObject *type, Py_ssize_t nargs, PyObject *kwargs);
297
+ PyAPI_FUNC(PyObject *)_PyEval_MatchKeys(PyThreadState *tstate, PyObject *map, PyObject *keys);
298
+ PyAPI_FUNC(void) _PyEval_MonitorRaise(PyThreadState *tstate, _PyInterpreterFrame *frame, _Py_CODEUNIT *instr);
299
+ PyAPI_FUNC(bool) _PyEval_NoToolsForUnwind(PyThreadState *tstate);
300
+ PyAPI_FUNC(int) _PyEval_UnpackIterableStackRef(PyThreadState *tstate, PyObject *v, int argcnt, int argcntafter, _PyStackRef *sp);
301
+ PyAPI_FUNC(void) _PyEval_FrameClearAndPop(PyThreadState *tstate, _PyInterpreterFrame *frame);
302
+ PyAPI_FUNC(PyObject **) _PyObjectArray_FromStackRefArray(_PyStackRef *input, Py_ssize_t nargs, PyObject **scratch);
303
+
304
+ PyAPI_FUNC(void) _PyObjectArray_Free(PyObject **array, PyObject **scratch);
305
+
306
+ PyAPI_FUNC(PyObject *) _PyEval_GetANext(PyObject *aiter);
307
+ PyAPI_FUNC(void) _PyEval_LoadGlobalStackRef(PyObject *globals, PyObject *builtins, PyObject *name, _PyStackRef *writeto);
308
+ PyAPI_FUNC(PyObject *) _PyEval_GetAwaitable(PyObject *iterable, int oparg);
309
+ PyAPI_FUNC(PyObject *) _PyEval_LoadName(PyThreadState *tstate, _PyInterpreterFrame *frame, PyObject *name);
310
+ PyAPI_FUNC(int)
311
+ _Py_Check_ArgsIterable(PyThreadState *tstate, PyObject *func, PyObject *args);
312
+
313
+ /*
314
+ * Indicate whether a special method of given 'oparg' can use the (improved)
315
+ * alternative error message instead. Only methods loaded by LOAD_SPECIAL
316
+ * support alternative error messages.
317
+ *
318
+ * Symbol is exported for the JIT (see discussion on GH-132218).
319
+ */
320
+ PyAPI_FUNC(int)
321
+ _PyEval_SpecialMethodCanSuggest(PyObject *self, int oparg);
322
+
323
+ /* Bits that can be set in PyThreadState.eval_breaker */
324
+ #define _PY_GIL_DROP_REQUEST_BIT (1U << 0)
325
+ #define _PY_SIGNALS_PENDING_BIT (1U << 1)
326
+ #define _PY_CALLS_TO_DO_BIT (1U << 2)
327
+ #define _PY_ASYNC_EXCEPTION_BIT (1U << 3)
328
+ #define _PY_GC_SCHEDULED_BIT (1U << 4)
329
+ #define _PY_EVAL_PLEASE_STOP_BIT (1U << 5)
330
+ #define _PY_EVAL_EXPLICIT_MERGE_BIT (1U << 6)
331
+ #define _PY_EVAL_JIT_INVALIDATE_COLD_BIT (1U << 7)
332
+
333
+ /* Reserve a few bits for future use */
334
+ #define _PY_EVAL_EVENTS_BITS 8
335
+ #define _PY_EVAL_EVENTS_MASK ((1 << _PY_EVAL_EVENTS_BITS)-1)
336
+
337
+ static inline void
338
+ _Py_set_eval_breaker_bit(PyThreadState *tstate, uintptr_t bit)
339
+ {
340
+ _Py_atomic_or_uintptr(&tstate->eval_breaker, bit);
341
+ }
342
+
343
+ static inline void
344
+ _Py_unset_eval_breaker_bit(PyThreadState *tstate, uintptr_t bit)
345
+ {
346
+ _Py_atomic_and_uintptr(&tstate->eval_breaker, ~bit);
347
+ }
348
+
349
+ static inline int
350
+ _Py_eval_breaker_bit_is_set(PyThreadState *tstate, uintptr_t bit)
351
+ {
352
+ uintptr_t b = _Py_atomic_load_uintptr_relaxed(&tstate->eval_breaker);
353
+ return (b & bit) != 0;
354
+ }
355
+
356
+ // Free-threaded builds use these functions to set or unset a bit on all
357
+ // threads in the given interpreter.
358
+ void _Py_set_eval_breaker_bit_all(PyInterpreterState *interp, uintptr_t bit);
359
+ void _Py_unset_eval_breaker_bit_all(PyInterpreterState *interp, uintptr_t bit);
360
+
361
+ PyAPI_FUNC(_PyStackRef) _PyFloat_FromDouble_ConsumeInputs(_PyStackRef left, _PyStackRef right, double value);
362
+
363
+ #ifndef Py_SUPPORTS_REMOTE_DEBUG
364
+ #if defined(__APPLE__)
365
+ #include <TargetConditionals.h>
366
+ # if !defined(TARGET_OS_OSX)
367
+ // Older macOS SDKs do not define TARGET_OS_OSX
368
+ # define TARGET_OS_OSX 1
369
+ # endif
370
+ #endif
371
+ #if ((defined(__APPLE__) && TARGET_OS_OSX) || defined(MS_WINDOWS) || (defined(__linux__) && HAVE_PROCESS_VM_READV))
372
+ # define Py_SUPPORTS_REMOTE_DEBUG 1
373
+ #endif
374
+ #endif
375
+
376
+ #if defined(Py_REMOTE_DEBUG) && defined(Py_SUPPORTS_REMOTE_DEBUG)
377
+ extern int _PyRunRemoteDebugger(PyThreadState *tstate);
378
+ #endif
379
+
380
+ /* Special methods used by LOAD_SPECIAL */
381
+ #define SPECIAL___ENTER__ 0
382
+ #define SPECIAL___EXIT__ 1
383
+ #define SPECIAL___AENTER__ 2
384
+ #define SPECIAL___AEXIT__ 3
385
+ #define SPECIAL_MAX 3
386
+
387
+ #ifdef __cplusplus
388
+ }
389
+ #endif
390
+ #endif /* !Py_INTERNAL_CEVAL_H */