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,493 @@
1
+ #ifndef Py_CPYTHON_OBJECT_H
2
+ # error "this header file must not be included directly"
3
+ #endif
4
+
5
+ PyAPI_FUNC(void) _Py_NewReference(PyObject *op);
6
+ PyAPI_FUNC(void) _Py_NewReferenceNoTotal(PyObject *op);
7
+ PyAPI_FUNC(void) _Py_ResurrectReference(PyObject *op);
8
+ PyAPI_FUNC(void) _Py_ForgetReference(PyObject *op);
9
+
10
+ #ifdef Py_REF_DEBUG
11
+ /* These are useful as debugging aids when chasing down refleaks. */
12
+ PyAPI_FUNC(Py_ssize_t) _Py_GetGlobalRefTotal(void);
13
+ # define _Py_GetRefTotal() _Py_GetGlobalRefTotal()
14
+ PyAPI_FUNC(Py_ssize_t) _Py_GetLegacyRefTotal(void);
15
+ PyAPI_FUNC(Py_ssize_t) _PyInterpreterState_GetRefTotal(PyInterpreterState *);
16
+ #endif
17
+
18
+
19
+ /********************* String Literals ****************************************/
20
+ /* This structure helps managing static strings. The basic usage goes like this:
21
+ Instead of doing
22
+
23
+ r = PyObject_CallMethod(o, "foo", "args", ...);
24
+
25
+ do
26
+
27
+ _Py_IDENTIFIER(foo);
28
+ ...
29
+ r = _PyObject_CallMethodId(o, &PyId_foo, "args", ...);
30
+
31
+ PyId_foo is a static variable, either on block level or file level. On first
32
+ usage, the string "foo" is interned, and the structures are linked. On interpreter
33
+ shutdown, all strings are released.
34
+
35
+ Alternatively, _Py_static_string allows choosing the variable name.
36
+ _PyUnicode_FromId returns a borrowed reference to the interned string.
37
+ _PyObject_{Get,Set,Has}AttrId are __getattr__ versions using _Py_Identifier*.
38
+ */
39
+ typedef struct _Py_Identifier {
40
+ const char* string;
41
+ // Index in PyInterpreterState.unicode.ids.array. It is process-wide
42
+ // unique and must be initialized to -1.
43
+ Py_ssize_t index;
44
+ // Hidden PyMutex struct for non free-threaded build.
45
+ struct {
46
+ uint8_t v;
47
+ } mutex;
48
+ } _Py_Identifier;
49
+
50
+ #ifndef Py_BUILD_CORE
51
+ // For now we are keeping _Py_IDENTIFIER for continued use
52
+ // in non-builtin extensions (and naughty PyPI modules).
53
+
54
+ #define _Py_static_string_init(value) { .string = (value), .index = -1 }
55
+ #define _Py_static_string(varname, value) static _Py_Identifier varname = _Py_static_string_init(value)
56
+ #define _Py_IDENTIFIER(varname) _Py_static_string(PyId_##varname, #varname)
57
+
58
+ #endif /* !Py_BUILD_CORE */
59
+
60
+
61
+ typedef struct {
62
+ /* Number implementations must check *both*
63
+ arguments for proper type and implement the necessary conversions
64
+ in the slot functions themselves. */
65
+
66
+ binaryfunc nb_add;
67
+ binaryfunc nb_subtract;
68
+ binaryfunc nb_multiply;
69
+ binaryfunc nb_remainder;
70
+ binaryfunc nb_divmod;
71
+ ternaryfunc nb_power;
72
+ unaryfunc nb_negative;
73
+ unaryfunc nb_positive;
74
+ unaryfunc nb_absolute;
75
+ inquiry nb_bool;
76
+ unaryfunc nb_invert;
77
+ binaryfunc nb_lshift;
78
+ binaryfunc nb_rshift;
79
+ binaryfunc nb_and;
80
+ binaryfunc nb_xor;
81
+ binaryfunc nb_or;
82
+ unaryfunc nb_int;
83
+ void *nb_reserved; /* the slot formerly known as nb_long */
84
+ unaryfunc nb_float;
85
+
86
+ binaryfunc nb_inplace_add;
87
+ binaryfunc nb_inplace_subtract;
88
+ binaryfunc nb_inplace_multiply;
89
+ binaryfunc nb_inplace_remainder;
90
+ ternaryfunc nb_inplace_power;
91
+ binaryfunc nb_inplace_lshift;
92
+ binaryfunc nb_inplace_rshift;
93
+ binaryfunc nb_inplace_and;
94
+ binaryfunc nb_inplace_xor;
95
+ binaryfunc nb_inplace_or;
96
+
97
+ binaryfunc nb_floor_divide;
98
+ binaryfunc nb_true_divide;
99
+ binaryfunc nb_inplace_floor_divide;
100
+ binaryfunc nb_inplace_true_divide;
101
+
102
+ unaryfunc nb_index;
103
+
104
+ binaryfunc nb_matrix_multiply;
105
+ binaryfunc nb_inplace_matrix_multiply;
106
+ } PyNumberMethods;
107
+
108
+ typedef struct {
109
+ lenfunc sq_length;
110
+ binaryfunc sq_concat;
111
+ ssizeargfunc sq_repeat;
112
+ ssizeargfunc sq_item;
113
+ void *was_sq_slice;
114
+ ssizeobjargproc sq_ass_item;
115
+ void *was_sq_ass_slice;
116
+ objobjproc sq_contains;
117
+
118
+ binaryfunc sq_inplace_concat;
119
+ ssizeargfunc sq_inplace_repeat;
120
+ } PySequenceMethods;
121
+
122
+ typedef struct {
123
+ lenfunc mp_length;
124
+ binaryfunc mp_subscript;
125
+ objobjargproc mp_ass_subscript;
126
+ } PyMappingMethods;
127
+
128
+ typedef PySendResult (*sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
129
+
130
+ typedef struct {
131
+ unaryfunc am_await;
132
+ unaryfunc am_aiter;
133
+ unaryfunc am_anext;
134
+ sendfunc am_send;
135
+ } PyAsyncMethods;
136
+
137
+ typedef struct {
138
+ getbufferproc bf_getbuffer;
139
+ releasebufferproc bf_releasebuffer;
140
+ } PyBufferProcs;
141
+
142
+ /* Allow printfunc in the tp_vectorcall_offset slot for
143
+ * backwards-compatibility */
144
+ typedef Py_ssize_t printfunc;
145
+
146
+ // If this structure is modified, Doc/includes/typestruct.h should be updated
147
+ // as well.
148
+ struct _typeobject {
149
+ PyObject_VAR_HEAD
150
+ const char *tp_name; /* For printing, in format "<module>.<name>" */
151
+ Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */
152
+
153
+ /* Methods to implement standard operations */
154
+
155
+ destructor tp_dealloc;
156
+ Py_ssize_t tp_vectorcall_offset;
157
+ getattrfunc tp_getattr;
158
+ setattrfunc tp_setattr;
159
+ PyAsyncMethods *tp_as_async; /* formerly known as tp_compare (Python 2)
160
+ or tp_reserved (Python 3) */
161
+ reprfunc tp_repr;
162
+
163
+ /* Method suites for standard classes */
164
+
165
+ PyNumberMethods *tp_as_number;
166
+ PySequenceMethods *tp_as_sequence;
167
+ PyMappingMethods *tp_as_mapping;
168
+
169
+ /* More standard operations (here for binary compatibility) */
170
+
171
+ hashfunc tp_hash;
172
+ ternaryfunc tp_call;
173
+ reprfunc tp_str;
174
+ getattrofunc tp_getattro;
175
+ setattrofunc tp_setattro;
176
+
177
+ /* Functions to access object as input/output buffer */
178
+ PyBufferProcs *tp_as_buffer;
179
+
180
+ /* Flags to define presence of optional/expanded features */
181
+ unsigned long tp_flags;
182
+
183
+ const char *tp_doc; /* Documentation string */
184
+
185
+ /* Assigned meaning in release 2.0 */
186
+ /* call function for all accessible objects */
187
+ traverseproc tp_traverse;
188
+
189
+ /* delete references to contained objects */
190
+ inquiry tp_clear;
191
+
192
+ /* Assigned meaning in release 2.1 */
193
+ /* rich comparisons */
194
+ richcmpfunc tp_richcompare;
195
+
196
+ /* weak reference enabler */
197
+ Py_ssize_t tp_weaklistoffset;
198
+
199
+ /* Iterators */
200
+ getiterfunc tp_iter;
201
+ iternextfunc tp_iternext;
202
+
203
+ /* Attribute descriptor and subclassing stuff */
204
+ PyMethodDef *tp_methods;
205
+ PyMemberDef *tp_members;
206
+ PyGetSetDef *tp_getset;
207
+ // Strong reference on a heap type, borrowed reference on a static type
208
+ PyTypeObject *tp_base;
209
+ PyObject *tp_dict;
210
+ descrgetfunc tp_descr_get;
211
+ descrsetfunc tp_descr_set;
212
+ Py_ssize_t tp_dictoffset;
213
+ initproc tp_init;
214
+ allocfunc tp_alloc;
215
+ newfunc tp_new;
216
+ freefunc tp_free; /* Low-level free-memory routine */
217
+ inquiry tp_is_gc; /* For PyObject_IS_GC */
218
+ PyObject *tp_bases;
219
+ PyObject *tp_mro; /* method resolution order */
220
+ PyObject *tp_cache; /* no longer used */
221
+ void *tp_subclasses; /* for static builtin types this is an index */
222
+ PyObject *tp_weaklist; /* not used for static builtin types */
223
+ destructor tp_del;
224
+
225
+ /* Type attribute cache version tag. Added in version 2.6.
226
+ * If zero, the cache is invalid and must be initialized.
227
+ */
228
+ unsigned int tp_version_tag;
229
+
230
+ destructor tp_finalize;
231
+ vectorcallfunc tp_vectorcall;
232
+
233
+ /* bitset of which type-watchers care about this type */
234
+ unsigned char tp_watched;
235
+
236
+ /* Number of tp_version_tag values used.
237
+ * Set to _Py_ATTR_CACHE_UNUSED if the attribute cache is
238
+ * disabled for this type (e.g. due to custom MRO entries).
239
+ * Otherwise, limited to MAX_VERSIONS_PER_CLASS (defined elsewhere).
240
+ */
241
+ uint16_t tp_versions_used;
242
+ };
243
+
244
+ #define _Py_ATTR_CACHE_UNUSED (30000) // (see tp_versions_used)
245
+
246
+ /* This struct is used by the specializer
247
+ * It should be treated as an opaque blob
248
+ * by code other than the specializer and interpreter. */
249
+ struct _specialization_cache {
250
+ // In order to avoid bloating the bytecode with lots of inline caches, the
251
+ // members of this structure have a somewhat unique contract. They are set
252
+ // by the specialization machinery, and are invalidated by PyType_Modified.
253
+ // The rules for using them are as follows:
254
+ // - If getitem is non-NULL, then it is the same Python function that
255
+ // PyType_Lookup(cls, "__getitem__") would return.
256
+ // - If getitem is NULL, then getitem_version is meaningless.
257
+ // - If getitem->func_version == getitem_version, then getitem can be called
258
+ // with two positional arguments and no keyword arguments, and has neither
259
+ // *args nor **kwargs (as required by BINARY_OP_SUBSCR_GETITEM):
260
+ PyObject *getitem;
261
+ uint32_t getitem_version;
262
+ PyObject *init;
263
+ };
264
+
265
+ /* The *real* layout of a type object when allocated on the heap */
266
+ typedef struct _heaptypeobject {
267
+ /* Note: there's a dependency on the order of these members
268
+ in slotptr() in typeobject.c . */
269
+ PyTypeObject ht_type;
270
+ PyAsyncMethods as_async;
271
+ PyNumberMethods as_number;
272
+ PyMappingMethods as_mapping;
273
+ PySequenceMethods as_sequence; /* as_sequence comes after as_mapping,
274
+ so that the mapping wins when both
275
+ the mapping and the sequence define
276
+ a given operator (e.g. __getitem__).
277
+ see add_operators() in typeobject.c . */
278
+ PyBufferProcs as_buffer;
279
+ PyObject *ht_name, *ht_slots, *ht_qualname;
280
+ struct _dictkeysobject *ht_cached_keys;
281
+ PyObject *ht_module;
282
+ char *_ht_tpname; // Storage for "tp_name"; see PyType_FromModuleAndSpec
283
+ void *ht_token; // Storage for the "Py_tp_token" slot
284
+ struct _specialization_cache _spec_cache; // For use by the specializer.
285
+ #ifdef Py_GIL_DISABLED
286
+ Py_ssize_t unique_id; // ID used for per-thread refcounting
287
+ #endif
288
+ /* here are optional user slots, followed by the members. */
289
+ } PyHeapTypeObject;
290
+
291
+ PyAPI_FUNC(const char *) _PyType_Name(PyTypeObject *);
292
+ PyAPI_FUNC(PyObject *) _PyType_Lookup(PyTypeObject *, PyObject *);
293
+ PyAPI_FUNC(PyObject *) _PyType_LookupRef(PyTypeObject *, PyObject *);
294
+ PyAPI_FUNC(PyObject *) PyType_GetDict(PyTypeObject *);
295
+
296
+ PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int);
297
+ PyAPI_FUNC(void) _Py_BreakPoint(void);
298
+ PyAPI_FUNC(void) _PyObject_Dump(PyObject *);
299
+
300
+ PyAPI_FUNC(PyObject*) _PyObject_GetAttrId(PyObject *, _Py_Identifier *);
301
+
302
+ PyAPI_FUNC(PyObject **) _PyObject_GetDictPtr(PyObject *);
303
+ PyAPI_FUNC(void) PyObject_CallFinalizer(PyObject *);
304
+ PyAPI_FUNC(int) PyObject_CallFinalizerFromDealloc(PyObject *);
305
+
306
+ PyAPI_FUNC(void) PyUnstable_Object_ClearWeakRefsNoCallbacks(PyObject *);
307
+
308
+ /* Same as PyObject_Generic{Get,Set}Attr, but passing the attributes
309
+ dict as the last parameter. */
310
+ PyAPI_FUNC(PyObject *)
311
+ _PyObject_GenericGetAttrWithDict(PyObject *, PyObject *, PyObject *, int);
312
+ PyAPI_FUNC(int)
313
+ _PyObject_GenericSetAttrWithDict(PyObject *, PyObject *,
314
+ PyObject *, PyObject *);
315
+
316
+ PyAPI_FUNC(PyObject *) _PyObject_FunctionStr(PyObject *);
317
+
318
+ /* Safely decref `dst` and set `dst` to `src`.
319
+ *
320
+ * As in case of Py_CLEAR "the obvious" code can be deadly:
321
+ *
322
+ * Py_DECREF(dst);
323
+ * dst = src;
324
+ *
325
+ * The safe way is:
326
+ *
327
+ * Py_SETREF(dst, src);
328
+ *
329
+ * That arranges to set `dst` to `src` _before_ decref'ing, so that any code
330
+ * triggered as a side-effect of `dst` getting torn down no longer believes
331
+ * `dst` points to a valid object.
332
+ *
333
+ * Temporary variables are used to only evaluate macro arguments once and so
334
+ * avoid the duplication of side effects. _Py_TYPEOF() or memcpy() is used to
335
+ * avoid a miscompilation caused by type punning. See Py_CLEAR() comment for
336
+ * implementation details about type punning.
337
+ *
338
+ * The memcpy() implementation does not emit a compiler warning if 'src' has
339
+ * not the same type than 'src': any pointer type is accepted for 'src'.
340
+ */
341
+ #ifdef _Py_TYPEOF
342
+ #define Py_SETREF(dst, src) \
343
+ do { \
344
+ _Py_TYPEOF(dst)* _tmp_dst_ptr = &(dst); \
345
+ _Py_TYPEOF(dst) _tmp_old_dst = (*_tmp_dst_ptr); \
346
+ *_tmp_dst_ptr = (src); \
347
+ Py_DECREF(_tmp_old_dst); \
348
+ } while (0)
349
+ #else
350
+ #define Py_SETREF(dst, src) \
351
+ do { \
352
+ PyObject **_tmp_dst_ptr = _Py_CAST(PyObject**, &(dst)); \
353
+ PyObject *_tmp_old_dst = (*_tmp_dst_ptr); \
354
+ PyObject *_tmp_src = _PyObject_CAST(src); \
355
+ memcpy(_tmp_dst_ptr, &_tmp_src, sizeof(PyObject*)); \
356
+ Py_DECREF(_tmp_old_dst); \
357
+ } while (0)
358
+ #endif
359
+
360
+ /* Py_XSETREF() is a variant of Py_SETREF() that uses Py_XDECREF() instead of
361
+ * Py_DECREF().
362
+ */
363
+ #ifdef _Py_TYPEOF
364
+ #define Py_XSETREF(dst, src) \
365
+ do { \
366
+ _Py_TYPEOF(dst)* _tmp_dst_ptr = &(dst); \
367
+ _Py_TYPEOF(dst) _tmp_old_dst = (*_tmp_dst_ptr); \
368
+ *_tmp_dst_ptr = (src); \
369
+ Py_XDECREF(_tmp_old_dst); \
370
+ } while (0)
371
+ #else
372
+ #define Py_XSETREF(dst, src) \
373
+ do { \
374
+ PyObject **_tmp_dst_ptr = _Py_CAST(PyObject**, &(dst)); \
375
+ PyObject *_tmp_old_dst = (*_tmp_dst_ptr); \
376
+ PyObject *_tmp_src = _PyObject_CAST(src); \
377
+ memcpy(_tmp_dst_ptr, &_tmp_src, sizeof(PyObject*)); \
378
+ Py_XDECREF(_tmp_old_dst); \
379
+ } while (0)
380
+ #endif
381
+
382
+
383
+ /* Define a pair of assertion macros:
384
+ _PyObject_ASSERT_FROM(), _PyObject_ASSERT_WITH_MSG() and _PyObject_ASSERT().
385
+
386
+ These work like the regular C assert(), in that they will abort the
387
+ process with a message on stderr if the given condition fails to hold,
388
+ but compile away to nothing if NDEBUG is defined.
389
+
390
+ However, before aborting, Python will also try to call _PyObject_Dump() on
391
+ the given object. This may be of use when investigating bugs in which a
392
+ particular object is corrupt (e.g. buggy a tp_visit method in an extension
393
+ module breaking the garbage collector), to help locate the broken objects.
394
+
395
+ The WITH_MSG variant allows you to supply an additional message that Python
396
+ will attempt to print to stderr, after the object dump. */
397
+ #ifdef NDEBUG
398
+ /* No debugging: compile away the assertions: */
399
+ # define _PyObject_ASSERT_FROM(obj, expr, msg, filename, lineno, func) \
400
+ ((void)0)
401
+ #else
402
+ /* With debugging: generate checks: */
403
+ # define _PyObject_ASSERT_FROM(obj, expr, msg, filename, lineno, func) \
404
+ ((expr) \
405
+ ? (void)(0) \
406
+ : _PyObject_AssertFailed((obj), Py_STRINGIFY(expr), \
407
+ (msg), (filename), (lineno), (func)))
408
+ #endif
409
+
410
+ #define _PyObject_ASSERT_WITH_MSG(obj, expr, msg) \
411
+ _PyObject_ASSERT_FROM((obj), expr, (msg), __FILE__, __LINE__, __func__)
412
+ #define _PyObject_ASSERT(obj, expr) \
413
+ _PyObject_ASSERT_WITH_MSG((obj), expr, NULL)
414
+
415
+ #define _PyObject_ASSERT_FAILED_MSG(obj, msg) \
416
+ _PyObject_AssertFailed((obj), NULL, (msg), __FILE__, __LINE__, __func__)
417
+
418
+ /* Declare and define _PyObject_AssertFailed() even when NDEBUG is defined,
419
+ to avoid causing compiler/linker errors when building extensions without
420
+ NDEBUG against a Python built with NDEBUG defined.
421
+
422
+ msg, expr and function can be NULL. */
423
+ PyAPI_FUNC(void) _Py_NO_RETURN _PyObject_AssertFailed(
424
+ PyObject *obj,
425
+ const char *expr,
426
+ const char *msg,
427
+ const char *file,
428
+ int line,
429
+ const char *function);
430
+
431
+
432
+ PyAPI_FUNC(void) _PyTrash_thread_deposit_object(PyThreadState *tstate, PyObject *op);
433
+ PyAPI_FUNC(void) _PyTrash_thread_destroy_chain(PyThreadState *tstate);
434
+
435
+ PyAPI_FUNC(int) _Py_ReachedRecursionLimitWithMargin(PyThreadState *tstate, int margin_count);
436
+
437
+ /* For backwards compatibility with the old trashcan mechanism */
438
+ #define Py_TRASHCAN_BEGIN(op, dealloc)
439
+ #define Py_TRASHCAN_END
440
+
441
+
442
+ PyAPI_FUNC(void *) PyObject_GetItemData(PyObject *obj);
443
+
444
+ PyAPI_FUNC(int) PyObject_VisitManagedDict(PyObject *obj, visitproc visit, void *arg);
445
+ PyAPI_FUNC(int) _PyObject_SetManagedDict(PyObject *obj, PyObject *new_dict);
446
+ PyAPI_FUNC(void) PyObject_ClearManagedDict(PyObject *obj);
447
+
448
+
449
+ typedef int(*PyType_WatchCallback)(PyTypeObject *);
450
+ PyAPI_FUNC(int) PyType_AddWatcher(PyType_WatchCallback callback);
451
+ PyAPI_FUNC(int) PyType_ClearWatcher(int watcher_id);
452
+ PyAPI_FUNC(int) PyType_Watch(int watcher_id, PyObject *type);
453
+ PyAPI_FUNC(int) PyType_Unwatch(int watcher_id, PyObject *type);
454
+
455
+ /* Attempt to assign a version tag to the given type.
456
+ *
457
+ * Returns 1 if the type already had a valid version tag or a new one was
458
+ * assigned, or 0 if a new tag could not be assigned.
459
+ */
460
+ PyAPI_FUNC(int) PyUnstable_Type_AssignVersionTag(PyTypeObject *type);
461
+
462
+
463
+ typedef enum {
464
+ PyRefTracer_CREATE = 0,
465
+ PyRefTracer_DESTROY = 1,
466
+ } PyRefTracerEvent;
467
+
468
+ typedef int (*PyRefTracer)(PyObject *, PyRefTracerEvent event, void *);
469
+ PyAPI_FUNC(int) PyRefTracer_SetTracer(PyRefTracer tracer, void *data);
470
+ PyAPI_FUNC(PyRefTracer) PyRefTracer_GetTracer(void**);
471
+
472
+ /* Enable PEP-703 deferred reference counting on the object.
473
+ *
474
+ * Returns 1 if deferred reference counting was successfully enabled, and
475
+ * 0 if the runtime ignored it. This function cannot fail.
476
+ */
477
+ PyAPI_FUNC(int) PyUnstable_Object_EnableDeferredRefcount(PyObject *);
478
+
479
+ /* Determine if the object exists as a unique temporary variable on the
480
+ * topmost frame of the interpreter.
481
+ */
482
+ PyAPI_FUNC(int) PyUnstable_Object_IsUniqueReferencedTemporary(PyObject *);
483
+
484
+ /* Check whether the object is immortal. This cannot fail. */
485
+ PyAPI_FUNC(int) PyUnstable_IsImmortal(PyObject *);
486
+
487
+ // Increments the reference count of the object, if it's not zero.
488
+ // PyUnstable_EnableTryIncRef() should be called on the object
489
+ // before calling this function in order to avoid spurious failures.
490
+ PyAPI_FUNC(int) PyUnstable_TryIncRef(PyObject *);
491
+ PyAPI_FUNC(void) PyUnstable_EnableTryIncRef(PyObject *);
492
+
493
+ PyAPI_FUNC(int) PyUnstable_Object_IsUniquelyReferenced(PyObject *);
@@ -0,0 +1,104 @@
1
+ #ifndef Py_CPYTHON_OBJIMPL_H
2
+ # error "this header file must not be included directly"
3
+ #endif
4
+
5
+ static inline size_t _PyObject_SIZE(PyTypeObject *type) {
6
+ return _Py_STATIC_CAST(size_t, type->tp_basicsize);
7
+ }
8
+
9
+ /* _PyObject_VAR_SIZE returns the number of bytes (as size_t) allocated for a
10
+ vrbl-size object with nitems items, exclusive of gc overhead (if any). The
11
+ value is rounded up to the closest multiple of sizeof(void *), in order to
12
+ ensure that pointer fields at the end of the object are correctly aligned
13
+ for the platform (this is of special importance for subclasses of, e.g.,
14
+ str or int, so that pointers can be stored after the embedded data).
15
+
16
+ Note that there's no memory wastage in doing this, as malloc has to
17
+ return (at worst) pointer-aligned memory anyway.
18
+ */
19
+ #if ((SIZEOF_VOID_P - 1) & SIZEOF_VOID_P) != 0
20
+ # error "_PyObject_VAR_SIZE requires SIZEOF_VOID_P be a power of 2"
21
+ #endif
22
+
23
+ static inline size_t _PyObject_VAR_SIZE(PyTypeObject *type, Py_ssize_t nitems) {
24
+ size_t size = _Py_STATIC_CAST(size_t, type->tp_basicsize);
25
+ size += _Py_STATIC_CAST(size_t, nitems) * _Py_STATIC_CAST(size_t, type->tp_itemsize);
26
+ return _Py_SIZE_ROUND_UP(size, SIZEOF_VOID_P);
27
+ }
28
+
29
+
30
+ /* This example code implements an object constructor with a custom
31
+ allocator, where PyObject_New is inlined, and shows the important
32
+ distinction between two steps (at least):
33
+ 1) the actual allocation of the object storage;
34
+ 2) the initialization of the Python specific fields
35
+ in this storage with PyObject_{Init, InitVar}.
36
+
37
+ PyObject *
38
+ YourObject_New(...)
39
+ {
40
+ PyObject *op;
41
+
42
+ op = (PyObject *) Your_Allocator(_PyObject_SIZE(YourTypeStruct));
43
+ if (op == NULL) {
44
+ return PyErr_NoMemory();
45
+ }
46
+
47
+ PyObject_Init(op, &YourTypeStruct);
48
+
49
+ op->ob_field = value;
50
+ ...
51
+ return op;
52
+ }
53
+
54
+ Note that in C++, the use of the new operator usually implies that
55
+ the 1st step is performed automatically for you, so in a C++ class
56
+ constructor you would start directly with PyObject_Init/InitVar. */
57
+
58
+
59
+ typedef struct {
60
+ /* user context passed as the first argument to the 2 functions */
61
+ void *ctx;
62
+
63
+ /* allocate an arena of size bytes */
64
+ void* (*alloc) (void *ctx, size_t size);
65
+
66
+ /* free an arena */
67
+ void (*free) (void *ctx, void *ptr, size_t size);
68
+ } PyObjectArenaAllocator;
69
+
70
+ /* Get the arena allocator. */
71
+ PyAPI_FUNC(void) PyObject_GetArenaAllocator(PyObjectArenaAllocator *allocator);
72
+
73
+ /* Set the arena allocator. */
74
+ PyAPI_FUNC(void) PyObject_SetArenaAllocator(PyObjectArenaAllocator *allocator);
75
+
76
+
77
+ /* Test if an object implements the garbage collector protocol */
78
+ PyAPI_FUNC(int) PyObject_IS_GC(PyObject *obj);
79
+
80
+
81
+ // Test if a type supports weak references
82
+ PyAPI_FUNC(int) PyType_SUPPORTS_WEAKREFS(PyTypeObject *type);
83
+
84
+ PyAPI_FUNC(PyObject **) PyObject_GET_WEAKREFS_LISTPTR(PyObject *op);
85
+
86
+ PyAPI_FUNC(PyObject *) PyUnstable_Object_GC_NewWithExtraData(PyTypeObject *,
87
+ size_t);
88
+
89
+
90
+ /* Visit all live GC-capable objects, similar to gc.get_objects(None). The
91
+ * supplied callback is called on every such object with the void* arg set
92
+ * to the supplied arg. Returning 0 from the callback ends iteration, returning
93
+ * 1 allows iteration to continue. Returning any other value may result in
94
+ * undefined behaviour.
95
+ *
96
+ * If new objects are (de)allocated by the callback it is undefined if they
97
+ * will be visited.
98
+
99
+ * Garbage collection is disabled during operation. Explicitly running a
100
+ * collection in the callback may lead to undefined behaviour e.g. visiting the
101
+ * same objects multiple times or not at all.
102
+ */
103
+ typedef int (*gcvisitobjects_t)(PyObject*, void*);
104
+ PyAPI_FUNC(void) PyUnstable_GC_VisitObjects(gcvisitobjects_t callback, void* arg);
@@ -0,0 +1,43 @@
1
+ #ifndef Py_ODICTOBJECT_H
2
+ #define Py_ODICTOBJECT_H
3
+ #ifdef __cplusplus
4
+ extern "C" {
5
+ #endif
6
+
7
+
8
+ /* OrderedDict */
9
+ /* This API is optional and mostly redundant. */
10
+
11
+ #ifndef Py_LIMITED_API
12
+
13
+ typedef struct _odictobject PyODictObject;
14
+
15
+ PyAPI_DATA(PyTypeObject) PyODict_Type;
16
+ PyAPI_DATA(PyTypeObject) PyODictIter_Type;
17
+ PyAPI_DATA(PyTypeObject) PyODictKeys_Type;
18
+ PyAPI_DATA(PyTypeObject) PyODictItems_Type;
19
+ PyAPI_DATA(PyTypeObject) PyODictValues_Type;
20
+
21
+ #define PyODict_Check(op) PyObject_TypeCheck((op), &PyODict_Type)
22
+ #define PyODict_CheckExact(op) Py_IS_TYPE((op), &PyODict_Type)
23
+ #define PyODict_SIZE(op) PyDict_GET_SIZE((op))
24
+
25
+ PyAPI_FUNC(PyObject *) PyODict_New(void);
26
+ PyAPI_FUNC(int) PyODict_SetItem(PyObject *od, PyObject *key, PyObject *item);
27
+ PyAPI_FUNC(int) PyODict_DelItem(PyObject *od, PyObject *key);
28
+
29
+ /* wrappers around PyDict* functions */
30
+ #define PyODict_GetItem(od, key) PyDict_GetItem(_PyObject_CAST(od), (key))
31
+ #define PyODict_GetItemWithError(od, key) \
32
+ PyDict_GetItemWithError(_PyObject_CAST(od), (key))
33
+ #define PyODict_Contains(od, key) PyDict_Contains(_PyObject_CAST(od), (key))
34
+ #define PyODict_Size(od) PyDict_Size(_PyObject_CAST(od))
35
+ #define PyODict_GetItemString(od, key) \
36
+ PyDict_GetItemString(_PyObject_CAST(od), (key))
37
+
38
+ #endif
39
+
40
+ #ifdef __cplusplus
41
+ }
42
+ #endif
43
+ #endif /* !Py_ODICTOBJECT_H */
@@ -0,0 +1,31 @@
1
+ /* PickleBuffer object. This is built-in for ease of use from third-party
2
+ * C extensions.
3
+ */
4
+
5
+ #ifndef Py_PICKLEBUFOBJECT_H
6
+ #define Py_PICKLEBUFOBJECT_H
7
+ #ifdef __cplusplus
8
+ extern "C" {
9
+ #endif
10
+
11
+ #ifndef Py_LIMITED_API
12
+
13
+ PyAPI_DATA(PyTypeObject) PyPickleBuffer_Type;
14
+
15
+ #define PyPickleBuffer_Check(op) Py_IS_TYPE((op), &PyPickleBuffer_Type)
16
+
17
+ /* Create a PickleBuffer redirecting to the given buffer-enabled object */
18
+ PyAPI_FUNC(PyObject *) PyPickleBuffer_FromObject(PyObject *);
19
+ /* Get the PickleBuffer's underlying view to the original object
20
+ * (NULL if released)
21
+ */
22
+ PyAPI_FUNC(const Py_buffer *) PyPickleBuffer_GetBuffer(PyObject *);
23
+ /* Release the PickleBuffer. Returns 0 on success, -1 on error. */
24
+ PyAPI_FUNC(int) PyPickleBuffer_Release(PyObject *);
25
+
26
+ #endif /* !Py_LIMITED_API */
27
+
28
+ #ifdef __cplusplus
29
+ }
30
+ #endif
31
+ #endif /* !Py_PICKLEBUFOBJECT_H */