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,410 @@
1
+ #ifndef Py_INTERNAL_DICT_H
2
+ #define Py_INTERNAL_DICT_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_object.h" // PyManagedDictPointer
12
+ #include "pycore_pyatomic_ft_wrappers.h" // FT_ATOMIC_LOAD_SSIZE_ACQUIRE
13
+ #include "pycore_stackref.h" // _PyStackRef
14
+ #include "pycore_stats.h"
15
+
16
+ // Unsafe flavor of PyDict_GetItemWithError(): no error checking
17
+ extern PyObject* _PyDict_GetItemWithError(PyObject *dp, PyObject *key);
18
+
19
+ // Delete an item from a dict if a predicate is true
20
+ // Returns -1 on error, 1 if the item was deleted, 0 otherwise
21
+ // Export for '_asyncio' shared extension
22
+ PyAPI_FUNC(int) _PyDict_DelItemIf(PyObject *mp, PyObject *key,
23
+ int (*predicate)(PyObject *value, void *arg),
24
+ void *arg);
25
+
26
+ // "KnownHash" variants
27
+ // Export for '_asyncio' shared extension
28
+ PyAPI_FUNC(int) _PyDict_SetItem_KnownHash(PyObject *mp, PyObject *key,
29
+ PyObject *item, Py_hash_t hash);
30
+ // Export for '_asyncio' shared extension
31
+ PyAPI_FUNC(int) _PyDict_DelItem_KnownHash(PyObject *mp, PyObject *key,
32
+ Py_hash_t hash);
33
+
34
+ extern int _PyDict_DelItem_KnownHash_LockHeld(PyObject *mp, PyObject *key,
35
+ Py_hash_t hash);
36
+
37
+ extern int _PyDict_Contains_KnownHash(PyObject *, PyObject *, Py_hash_t);
38
+
39
+ // "Id" variants
40
+ extern PyObject* _PyDict_GetItemIdWithError(PyObject *dp,
41
+ _Py_Identifier *key);
42
+ extern int _PyDict_ContainsId(PyObject *, _Py_Identifier *);
43
+ extern int _PyDict_SetItemId(PyObject *dp, _Py_Identifier *key, PyObject *item);
44
+ extern int _PyDict_DelItemId(PyObject *mp, _Py_Identifier *key);
45
+
46
+ extern int _PyDict_Next(
47
+ PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value, Py_hash_t *hash);
48
+
49
+ extern int _PyDict_HasOnlyStringKeys(PyObject *mp);
50
+
51
+ // Export for '_ctypes' shared extension
52
+ PyAPI_FUNC(Py_ssize_t) _PyDict_SizeOf(PyDictObject *);
53
+
54
+ extern Py_ssize_t _PyDict_SizeOf_LockHeld(PyDictObject *);
55
+
56
+ #define _PyDict_HasSplitTable(d) ((d)->ma_values != NULL)
57
+
58
+ /* Like PyDict_Merge, but override can be 0, 1 or 2. If override is 0,
59
+ the first occurrence of a key wins, if override is 1, the last occurrence
60
+ of a key wins, if override is 2, a KeyError with conflicting key as
61
+ argument is raised.
62
+ */
63
+ PyAPI_FUNC(int) _PyDict_MergeEx(PyObject *mp, PyObject *other, int override);
64
+
65
+ extern void _PyDict_DebugMallocStats(FILE *out);
66
+
67
+
68
+ /* _PyDictView */
69
+
70
+ typedef struct {
71
+ PyObject_HEAD
72
+ PyDictObject *dv_dict;
73
+ } _PyDictViewObject;
74
+
75
+ extern PyObject* _PyDictView_New(PyObject *, PyTypeObject *);
76
+ extern PyObject* _PyDictView_Intersect(PyObject* self, PyObject *other);
77
+
78
+ /* other API */
79
+
80
+ typedef struct {
81
+ /* Cached hash code of me_key. */
82
+ Py_hash_t me_hash;
83
+ PyObject *me_key;
84
+ PyObject *me_value; /* This field is only meaningful for combined tables */
85
+ } PyDictKeyEntry;
86
+
87
+ typedef struct {
88
+ PyObject *me_key; /* The key must be Unicode and have hash. */
89
+ PyObject *me_value; /* This field is only meaningful for combined tables */
90
+ } PyDictUnicodeEntry;
91
+
92
+ extern PyDictKeysObject *_PyDict_NewKeysForClass(PyHeapTypeObject *);
93
+ extern PyObject *_PyDict_FromKeys(PyObject *, PyObject *, PyObject *);
94
+
95
+ /* Gets a version number unique to the current state of the keys of dict, if possible.
96
+ * Returns the version number, or zero if it was not possible to get a version number. */
97
+ extern uint32_t _PyDictKeys_GetVersionForCurrentState(
98
+ PyInterpreterState *interp, PyDictKeysObject *dictkeys);
99
+
100
+ /* Gets a version number unique to the current state of the keys of dict, if possible.
101
+ *
102
+ * In free-threaded builds ensures that the dict can be used for lock-free
103
+ * reads if a version was assigned.
104
+ *
105
+ * The caller must hold the per-object lock on dict.
106
+ *
107
+ * Returns the version number, or zero if it was not possible to get a version number. */
108
+ extern uint32_t _PyDict_GetKeysVersionForCurrentState(
109
+ PyInterpreterState *interp, PyDictObject *dict);
110
+
111
+ extern size_t _PyDict_KeysSize(PyDictKeysObject *keys);
112
+
113
+ extern void _PyDictKeys_DecRef(PyDictKeysObject *keys);
114
+
115
+ /* _Py_dict_lookup() returns index of entry which can be used like DK_ENTRIES(dk)[index].
116
+ * -1 when no entry found, -3 when compare raises error.
117
+ */
118
+ extern Py_ssize_t _Py_dict_lookup(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject **value_addr);
119
+ extern Py_ssize_t _Py_dict_lookup_threadsafe(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject **value_addr);
120
+ extern Py_ssize_t _Py_dict_lookup_threadsafe_stackref(PyDictObject *mp, PyObject *key, Py_hash_t hash, _PyStackRef *value_addr);
121
+
122
+ extern Py_ssize_t _PyDict_LookupIndex(PyDictObject *, PyObject *);
123
+ extern Py_ssize_t _PyDictKeys_StringLookup(PyDictKeysObject* dictkeys, PyObject *key);
124
+
125
+ /* Look up a string key in an all unicode dict keys, assign the keys object a version, and
126
+ * store it in version.
127
+ *
128
+ * Returns DKIX_ERROR if key is not a string or if the keys object is not all
129
+ * strings.
130
+ *
131
+ * Returns DKIX_EMPTY if the key is not present.
132
+ */
133
+ extern Py_ssize_t _PyDictKeys_StringLookupAndVersion(PyDictKeysObject* dictkeys, PyObject *key, uint32_t *version);
134
+ extern Py_ssize_t _PyDictKeys_StringLookupSplit(PyDictKeysObject* dictkeys, PyObject *key);
135
+ PyAPI_FUNC(PyObject *)_PyDict_LoadGlobal(PyDictObject *, PyDictObject *, PyObject *);
136
+ PyAPI_FUNC(void) _PyDict_LoadGlobalStackRef(PyDictObject *, PyDictObject *, PyObject *, _PyStackRef *);
137
+
138
+ // Loads the __builtins__ object from the globals dict. Returns a new reference.
139
+ extern PyObject *_PyDict_LoadBuiltinsFromGlobals(PyObject *globals);
140
+
141
+ /* Consumes references to key and value */
142
+ PyAPI_FUNC(int) _PyDict_SetItem_Take2(PyDictObject *op, PyObject *key, PyObject *value);
143
+ extern int _PyDict_SetItem_LockHeld(PyDictObject *dict, PyObject *name, PyObject *value);
144
+ // Export for '_asyncio' shared extension
145
+ PyAPI_FUNC(int) _PyDict_SetItem_KnownHash_LockHeld(PyDictObject *mp, PyObject *key,
146
+ PyObject *value, Py_hash_t hash);
147
+ // Export for '_asyncio' shared extension
148
+ PyAPI_FUNC(int) _PyDict_GetItemRef_KnownHash_LockHeld(PyDictObject *op, PyObject *key, Py_hash_t hash, PyObject **result);
149
+ extern int _PyDict_GetItemRef_KnownHash(PyDictObject *op, PyObject *key, Py_hash_t hash, PyObject **result);
150
+ extern int _PyDict_GetItemRef_Unicode_LockHeld(PyDictObject *op, PyObject *key, PyObject **result);
151
+ extern int _PyObjectDict_SetItem(PyTypeObject *tp, PyObject *obj, PyObject **dictptr, PyObject *name, PyObject *value);
152
+
153
+ extern int _PyDict_Pop_KnownHash(
154
+ PyDictObject *dict,
155
+ PyObject *key,
156
+ Py_hash_t hash,
157
+ PyObject **result);
158
+
159
+ extern void _PyDict_Clear_LockHeld(PyObject *op);
160
+
161
+ #ifdef Py_GIL_DISABLED
162
+ PyAPI_FUNC(void) _PyDict_EnsureSharedOnRead(PyDictObject *mp);
163
+ #endif
164
+
165
+ #define DKIX_EMPTY (-1)
166
+ #define DKIX_DUMMY (-2) /* Used internally */
167
+ #define DKIX_ERROR (-3)
168
+ #define DKIX_KEY_CHANGED (-4) /* Used internally */
169
+
170
+ typedef enum {
171
+ DICT_KEYS_GENERAL = 0,
172
+ DICT_KEYS_UNICODE = 1,
173
+ DICT_KEYS_SPLIT = 2
174
+ } DictKeysKind;
175
+
176
+ /* See dictobject.c for actual layout of DictKeysObject */
177
+ struct _dictkeysobject {
178
+ Py_ssize_t dk_refcnt;
179
+
180
+ /* Size of the hash table (dk_indices). It must be a power of 2. */
181
+ uint8_t dk_log2_size;
182
+
183
+ /* Size of the hash table (dk_indices) by bytes. */
184
+ uint8_t dk_log2_index_bytes;
185
+
186
+ /* Kind of keys */
187
+ uint8_t dk_kind;
188
+
189
+ #ifdef Py_GIL_DISABLED
190
+ /* Lock used to protect shared keys */
191
+ PyMutex dk_mutex;
192
+ #endif
193
+
194
+ /* Version number -- Reset to 0 by any modification to keys */
195
+ uint32_t dk_version;
196
+
197
+ /* Number of usable entries in dk_entries. */
198
+ Py_ssize_t dk_usable;
199
+
200
+ /* Number of used entries in dk_entries. */
201
+ Py_ssize_t dk_nentries;
202
+
203
+
204
+ /* Actual hash table of dk_size entries. It holds indices in dk_entries,
205
+ or DKIX_EMPTY(-1) or DKIX_DUMMY(-2).
206
+
207
+ Indices must be: 0 <= indice < USABLE_FRACTION(dk_size).
208
+
209
+ The size in bytes of an indice depends on dk_size:
210
+
211
+ - 1 byte if dk_size <= 0xff (char*)
212
+ - 2 bytes if dk_size <= 0xffff (int16_t*)
213
+ - 4 bytes if dk_size <= 0xffffffff (int32_t*)
214
+ - 8 bytes otherwise (int64_t*)
215
+
216
+ Dynamically sized, SIZEOF_VOID_P is minimum. */
217
+ char dk_indices[]; /* char is required to avoid strict aliasing. */
218
+
219
+ /* "PyDictKeyEntry or PyDictUnicodeEntry dk_entries[USABLE_FRACTION(DK_SIZE(dk))];" array follows:
220
+ see the DK_ENTRIES() / DK_UNICODE_ENTRIES() functions below */
221
+ };
222
+
223
+ /* This must be no more than 250, for the prefix size to fit in one byte. */
224
+ #define SHARED_KEYS_MAX_SIZE 30
225
+ #define NEXT_LOG2_SHARED_KEYS_MAX_SIZE 6
226
+
227
+ /* Layout of dict values:
228
+ *
229
+ * The PyObject *values are preceded by an array of bytes holding
230
+ * the insertion order and size.
231
+ * [-1] = prefix size. [-2] = used size. size[-2-n...] = insertion order.
232
+ */
233
+ struct _dictvalues {
234
+ uint8_t capacity;
235
+ uint8_t size;
236
+ uint8_t embedded;
237
+ uint8_t valid;
238
+ PyObject *values[1];
239
+ };
240
+
241
+ #define DK_LOG_SIZE(dk) _Py_RVALUE((dk)->dk_log2_size)
242
+ #if SIZEOF_VOID_P > 4
243
+ #define DK_SIZE(dk) (((int64_t)1)<<DK_LOG_SIZE(dk))
244
+ #else
245
+ #define DK_SIZE(dk) (1<<DK_LOG_SIZE(dk))
246
+ #endif
247
+
248
+ static inline void* _DK_ENTRIES(PyDictKeysObject *dk) {
249
+ int8_t *indices = (int8_t*)(dk->dk_indices);
250
+ size_t index = (size_t)1 << dk->dk_log2_index_bytes;
251
+ return (&indices[index]);
252
+ }
253
+
254
+ static inline PyDictKeyEntry* DK_ENTRIES(PyDictKeysObject *dk) {
255
+ assert(dk->dk_kind == DICT_KEYS_GENERAL);
256
+ return (PyDictKeyEntry*)_DK_ENTRIES(dk);
257
+ }
258
+ static inline PyDictUnicodeEntry* DK_UNICODE_ENTRIES(PyDictKeysObject *dk) {
259
+ assert(dk->dk_kind != DICT_KEYS_GENERAL);
260
+ return (PyDictUnicodeEntry*)_DK_ENTRIES(dk);
261
+ }
262
+
263
+ #define DK_IS_UNICODE(dk) ((dk)->dk_kind != DICT_KEYS_GENERAL)
264
+
265
+ #define DICT_VERSION_INCREMENT (1 << (DICT_MAX_WATCHERS + DICT_WATCHED_MUTATION_BITS))
266
+ #define DICT_WATCHER_MASK ((1 << DICT_MAX_WATCHERS) - 1)
267
+ #define DICT_WATCHER_AND_MODIFICATION_MASK ((1 << (DICT_MAX_WATCHERS + DICT_WATCHED_MUTATION_BITS)) - 1)
268
+ #define DICT_UNIQUE_ID_SHIFT (32)
269
+ #define DICT_UNIQUE_ID_MAX ((UINT64_C(1) << (64 - DICT_UNIQUE_ID_SHIFT)) - 1)
270
+
271
+
272
+ PyAPI_FUNC(void)
273
+ _PyDict_SendEvent(int watcher_bits,
274
+ PyDict_WatchEvent event,
275
+ PyDictObject *mp,
276
+ PyObject *key,
277
+ PyObject *value);
278
+
279
+ static inline void
280
+ _PyDict_NotifyEvent(PyInterpreterState *interp,
281
+ PyDict_WatchEvent event,
282
+ PyDictObject *mp,
283
+ PyObject *key,
284
+ PyObject *value)
285
+ {
286
+ assert(Py_REFCNT((PyObject*)mp) > 0);
287
+ int watcher_bits = mp->_ma_watcher_tag & DICT_WATCHER_MASK;
288
+ if (watcher_bits) {
289
+ RARE_EVENT_STAT_INC(watched_dict_modification);
290
+ _PyDict_SendEvent(watcher_bits, event, mp, key, value);
291
+ }
292
+ }
293
+
294
+ extern PyDictObject *_PyObject_MaterializeManagedDict(PyObject *obj);
295
+
296
+ PyAPI_FUNC(PyObject *)_PyDict_FromItems(
297
+ PyObject *const *keys, Py_ssize_t keys_offset,
298
+ PyObject *const *values, Py_ssize_t values_offset,
299
+ Py_ssize_t length);
300
+
301
+ static inline uint8_t *
302
+ get_insertion_order_array(PyDictValues *values)
303
+ {
304
+ return (uint8_t *)&values->values[values->capacity];
305
+ }
306
+
307
+ static inline void
308
+ _PyDictValues_AddToInsertionOrder(PyDictValues *values, Py_ssize_t ix)
309
+ {
310
+ assert(ix < SHARED_KEYS_MAX_SIZE);
311
+ int size = values->size;
312
+ uint8_t *array = get_insertion_order_array(values);
313
+ assert(size < values->capacity);
314
+ assert(((uint8_t)ix) == ix);
315
+ array[size] = (uint8_t)ix;
316
+ values->size = size+1;
317
+ }
318
+
319
+ static inline size_t
320
+ shared_keys_usable_size(PyDictKeysObject *keys)
321
+ {
322
+ // dk_usable will decrease for each instance that is created and each
323
+ // value that is added. dk_nentries will increase for each value that
324
+ // is added. We want to always return the right value or larger.
325
+ // We therefore increase dk_nentries first and we decrease dk_usable
326
+ // second, and conversely here we read dk_usable first and dk_entries
327
+ // second (to avoid the case where we read entries before the increment
328
+ // and read usable after the decrement)
329
+ Py_ssize_t dk_usable = FT_ATOMIC_LOAD_SSIZE_ACQUIRE(keys->dk_usable);
330
+ Py_ssize_t dk_nentries = FT_ATOMIC_LOAD_SSIZE_ACQUIRE(keys->dk_nentries);
331
+ return dk_nentries + dk_usable;
332
+ }
333
+
334
+ static inline size_t
335
+ _PyInlineValuesSize(PyTypeObject *tp)
336
+ {
337
+ PyDictKeysObject *keys = ((PyHeapTypeObject*)tp)->ht_cached_keys;
338
+ assert(keys != NULL);
339
+ size_t size = shared_keys_usable_size(keys);
340
+ size_t prefix_size = _Py_SIZE_ROUND_UP(size, sizeof(PyObject *));
341
+ assert(prefix_size < 256);
342
+ return prefix_size + (size + 1) * sizeof(PyObject *);
343
+ }
344
+
345
+ int
346
+ _PyDict_DetachFromObject(PyDictObject *dict, PyObject *obj);
347
+
348
+ // Enables per-thread ref counting on this dict in the free threading build
349
+ extern void _PyDict_EnablePerThreadRefcounting(PyObject *op);
350
+
351
+ PyDictObject *_PyObject_MaterializeManagedDict_LockHeld(PyObject *);
352
+
353
+ // See `_Py_INCREF_TYPE()` in pycore_object.h
354
+ #ifndef Py_GIL_DISABLED
355
+ # define _Py_INCREF_DICT Py_INCREF
356
+ # define _Py_DECREF_DICT Py_DECREF
357
+ # define _Py_INCREF_BUILTINS Py_INCREF
358
+ # define _Py_DECREF_BUILTINS Py_DECREF
359
+ #else
360
+ static inline Py_ssize_t
361
+ _PyDict_UniqueId(PyDictObject *mp)
362
+ {
363
+ return (Py_ssize_t)(mp->_ma_watcher_tag >> DICT_UNIQUE_ID_SHIFT);
364
+ }
365
+
366
+ static inline void
367
+ _Py_INCREF_DICT(PyObject *op)
368
+ {
369
+ assert(PyDict_Check(op));
370
+ Py_ssize_t id = _PyDict_UniqueId((PyDictObject *)op);
371
+ _Py_THREAD_INCREF_OBJECT(op, id);
372
+ }
373
+
374
+ static inline void
375
+ _Py_DECREF_DICT(PyObject *op)
376
+ {
377
+ assert(PyDict_Check(op));
378
+ Py_ssize_t id = _PyDict_UniqueId((PyDictObject *)op);
379
+ _Py_THREAD_DECREF_OBJECT(op, id);
380
+ }
381
+
382
+ // Like `_Py_INCREF_DICT`, but also handles non-dict objects because builtins
383
+ // may not be a dict.
384
+ static inline void
385
+ _Py_INCREF_BUILTINS(PyObject *op)
386
+ {
387
+ if (PyDict_CheckExact(op)) {
388
+ _Py_INCREF_DICT(op);
389
+ }
390
+ else {
391
+ Py_INCREF(op);
392
+ }
393
+ }
394
+
395
+ static inline void
396
+ _Py_DECREF_BUILTINS(PyObject *op)
397
+ {
398
+ if (PyDict_CheckExact(op)) {
399
+ _Py_DECREF_DICT(op);
400
+ }
401
+ else {
402
+ Py_DECREF(op);
403
+ }
404
+ }
405
+ #endif
406
+
407
+ #ifdef __cplusplus
408
+ }
409
+ #endif
410
+ #endif /* !Py_INTERNAL_DICT_H */
@@ -0,0 +1,28 @@
1
+ #ifndef Py_INTERNAL_DICT_STATE_H
2
+ #define Py_INTERNAL_DICT_STATE_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
+ #define DICT_MAX_WATCHERS 8
12
+ #define DICT_WATCHED_MUTATION_BITS 4
13
+
14
+ struct _Py_dict_state {
15
+ uint32_t next_keys_version;
16
+ PyDict_WatchCallback watchers[DICT_MAX_WATCHERS];
17
+ };
18
+
19
+ #define _dict_state_INIT \
20
+ { \
21
+ .next_keys_version = 2, \
22
+ }
23
+
24
+
25
+ #ifdef __cplusplus
26
+ }
27
+ #endif
28
+ #endif /* !Py_INTERNAL_DICT_STATE_H */
@@ -0,0 +1,40 @@
1
+ #ifndef Py_INTERNAL_DTOA_H
2
+ #define Py_INTERNAL_DTOA_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_pymath.h" // _PY_SHORT_FLOAT_REPR
12
+
13
+
14
+ #if defined(Py_USING_MEMORY_DEBUGGER) || _PY_SHORT_FLOAT_REPR == 0
15
+
16
+ #define _dtoa_state_INIT(INTERP) \
17
+ {0}
18
+
19
+ #else
20
+
21
+ #define _dtoa_state_INIT(INTERP) \
22
+ { \
23
+ .preallocated_next = (INTERP)->dtoa.preallocated, \
24
+ }
25
+ #endif
26
+
27
+ extern double _Py_dg_strtod(const char *str, char **ptr);
28
+ extern char* _Py_dg_dtoa(double d, int mode, int ndigits,
29
+ int *decpt, int *sign, char **rve);
30
+ extern void _Py_dg_freedtoa(char *s);
31
+
32
+
33
+ extern PyStatus _PyDtoa_Init(PyInterpreterState *interp);
34
+ extern void _PyDtoa_Fini(PyInterpreterState *interp);
35
+
36
+
37
+ #ifdef __cplusplus
38
+ }
39
+ #endif
40
+ #endif /* !Py_INTERNAL_DTOA_H */
@@ -0,0 +1,30 @@
1
+ #ifndef Py_EMSCRIPTEN_SIGNAL_H
2
+ #define Py_EMSCRIPTEN_SIGNAL_H
3
+
4
+ #if defined(__EMSCRIPTEN__)
5
+
6
+ #ifndef Py_BUILD_CORE
7
+ # error "this header requires Py_BUILD_CORE define"
8
+ #endif
9
+
10
+ void
11
+ _Py_CheckEmscriptenSignals(void);
12
+
13
+ void
14
+ _Py_CheckEmscriptenSignalsPeriodically(void);
15
+
16
+ #define _Py_CHECK_EMSCRIPTEN_SIGNALS() _Py_CheckEmscriptenSignals()
17
+
18
+ #define _Py_CHECK_EMSCRIPTEN_SIGNALS_PERIODICALLY() _Py_CheckEmscriptenSignalsPeriodically()
19
+
20
+ extern int Py_EMSCRIPTEN_SIGNAL_HANDLING;
21
+ extern int _Py_emscripten_signal_clock;
22
+
23
+ #else
24
+
25
+ #define _Py_CHECK_EMSCRIPTEN_SIGNALS()
26
+ #define _Py_CHECK_EMSCRIPTEN_SIGNALS_PERIODICALLY()
27
+
28
+ #endif // defined(__EMSCRIPTEN__)
29
+
30
+ #endif // ndef Py_EMSCRIPTEN_SIGNAL_H
@@ -0,0 +1,70 @@
1
+ #ifndef Py_EMSCRIPTEN_TRAMPOLINE_H
2
+ #define Py_EMSCRIPTEN_TRAMPOLINE_H
3
+
4
+ #include "pycore_typedefs.h" // _PyRuntimeState
5
+
6
+ /**
7
+ * C function call trampolines to mitigate bad function pointer casts.
8
+ *
9
+ * Section 6.3.2.3, paragraph 8 reads:
10
+ *
11
+ * A pointer to a function of one type may be converted to a pointer to a
12
+ * function of another type and back again; the result shall compare equal to
13
+ * the original pointer. If a converted pointer is used to call a function
14
+ * whose type is not compatible with the pointed-to type, the behavior is
15
+ * undefined.
16
+ *
17
+ * Typical native ABIs ignore additional arguments or fill in missing values
18
+ * with 0/NULL in function pointer cast. Compilers do not show warnings when a
19
+ * function pointer is explicitly casted to an incompatible type.
20
+ *
21
+ * Bad fpcasts are an issue in WebAssembly. WASM's indirect_call has strict
22
+ * function signature checks. Argument count, types, and return type must match.
23
+ *
24
+ * Third party code unintentionally rely on problematic fpcasts. The call
25
+ * trampoline mitigates common occurrences of bad fpcasts on Emscripten.
26
+ */
27
+
28
+ #if defined(__EMSCRIPTEN__) && defined(PY_CALL_TRAMPOLINE)
29
+
30
+ void
31
+ _Py_EmscriptenTrampoline_Init(_PyRuntimeState *runtime);
32
+
33
+ PyObject*
34
+ _PyEM_TrampolineCall(PyCFunctionWithKeywords func,
35
+ PyObject* self,
36
+ PyObject* args,
37
+ PyObject* kw);
38
+
39
+ #define _PyCFunction_TrampolineCall(meth, self, args) \
40
+ _PyEM_TrampolineCall(*_PyCFunctionWithKeywords_CAST(meth), (self), (args), NULL)
41
+
42
+ #define _PyCFunctionWithKeywords_TrampolineCall(meth, self, args, kw) \
43
+ _PyEM_TrampolineCall((meth), (self), (args), (kw))
44
+
45
+ #define descr_set_trampoline_call(set, obj, value, closure) \
46
+ ((int)_PyEM_TrampolineCall(_PyCFunctionWithKeywords_CAST(set), (obj), \
47
+ (value), (PyObject*)(closure)))
48
+
49
+ #define descr_get_trampoline_call(get, obj, closure) \
50
+ _PyEM_TrampolineCall(_PyCFunctionWithKeywords_CAST(get), (obj), \
51
+ (PyObject*)(closure), NULL)
52
+
53
+
54
+ #else // defined(__EMSCRIPTEN__) && defined(PY_CALL_TRAMPOLINE)
55
+
56
+ #define _PyCFunction_TrampolineCall(meth, self, args) \
57
+ (meth)((self), (args))
58
+
59
+ #define _PyCFunctionWithKeywords_TrampolineCall(meth, self, args, kw) \
60
+ (meth)((self), (args), (kw))
61
+
62
+ #define descr_set_trampoline_call(set, obj, value, closure) \
63
+ (set)((obj), (value), (closure))
64
+
65
+ #define descr_get_trampoline_call(get, obj, closure) \
66
+ (get)((obj), (closure))
67
+
68
+ #endif // defined(__EMSCRIPTEN__) && defined(PY_CALL_TRAMPOLINE)
69
+
70
+ #endif // ndef Py_EMSCRIPTEN_SIGNAL_H
@@ -0,0 +1,40 @@
1
+ #ifndef Py_INTERNAL_EXCEPTIONS_H
2
+ #define Py_INTERNAL_EXCEPTIONS_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
+
12
+ /* runtime lifecycle */
13
+
14
+ extern PyStatus _PyExc_InitState(PyInterpreterState *);
15
+ extern PyStatus _PyExc_InitGlobalObjects(PyInterpreterState *);
16
+ extern int _PyExc_InitTypes(PyInterpreterState *);
17
+ extern void _PyExc_Fini(PyInterpreterState *);
18
+
19
+
20
+ /* other API */
21
+
22
+ struct _Py_exc_state {
23
+ // The dict mapping from errno codes to OSError subclasses
24
+ PyObject *errnomap;
25
+ PyBaseExceptionObject *memerrors_freelist;
26
+ int memerrors_numfree;
27
+ #ifdef Py_GIL_DISABLED
28
+ PyMutex memerrors_lock;
29
+ #endif
30
+ // The ExceptionGroup type
31
+ PyObject *PyExc_ExceptionGroup;
32
+ };
33
+
34
+ extern void _PyExc_ClearExceptionGroupType(PyInterpreterState *);
35
+
36
+
37
+ #ifdef __cplusplus
38
+ }
39
+ #endif
40
+ #endif /* !Py_INTERNAL_EXCEPTIONS_H */