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,710 @@
1
+ #ifndef Py_PYPORT_H
2
+ #define Py_PYPORT_H
3
+
4
+ #ifndef UCHAR_MAX
5
+ # error "<limits.h> header must define UCHAR_MAX"
6
+ #endif
7
+ #if UCHAR_MAX != 255
8
+ # error "Python's source code assumes C's unsigned char is an 8-bit type"
9
+ #endif
10
+
11
+
12
+ // Preprocessor check for a builtin preprocessor function. Always return 0
13
+ // if __has_builtin() macro is not defined.
14
+ //
15
+ // __has_builtin() is available on clang and GCC 10.
16
+ #ifdef __has_builtin
17
+ # define _Py__has_builtin(x) __has_builtin(x)
18
+ #else
19
+ # define _Py__has_builtin(x) 0
20
+ #endif
21
+
22
+ // Preprocessor check for a compiler __attribute__. Always return 0
23
+ // if __has_attribute() macro is not defined.
24
+ #ifdef __has_attribute
25
+ # define _Py__has_attribute(x) __has_attribute(x)
26
+ #else
27
+ # define _Py__has_attribute(x) 0
28
+ #endif
29
+
30
+ // Macro to use C++ static_cast<> in the Python C API.
31
+ #ifdef __cplusplus
32
+ # define _Py_STATIC_CAST(type, expr) static_cast<type>(expr)
33
+ #else
34
+ # define _Py_STATIC_CAST(type, expr) ((type)(expr))
35
+ #endif
36
+ // Macro to use the more powerful/dangerous C-style cast even in C++.
37
+ #define _Py_CAST(type, expr) ((type)(expr))
38
+
39
+ // Cast a function to another function type T.
40
+ //
41
+ // The macro first casts the function to the "void func(void)" type
42
+ // to prevent compiler warnings.
43
+ //
44
+ // Note that using this cast only prevents the compiler from emitting
45
+ // warnings, but does not prevent an undefined behavior at runtime if
46
+ // the original function signature is not respected.
47
+ #define _Py_FUNC_CAST(T, func) _Py_CAST(T, _Py_CAST(void(*)(void), (func)))
48
+
49
+ // Static inline functions should use _Py_NULL rather than using directly NULL
50
+ // to prevent C++ compiler warnings. On C23 and newer and on C++11 and newer,
51
+ // _Py_NULL is defined as nullptr.
52
+ #if !defined(_MSC_VER) && \
53
+ ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) \
54
+ || (defined(__cplusplus) && __cplusplus >= 201103))
55
+ # define _Py_NULL nullptr
56
+ #else
57
+ # define _Py_NULL NULL
58
+ #endif
59
+
60
+
61
+ /* Defines to build Python and its standard library:
62
+ *
63
+ * - Py_BUILD_CORE: Build Python core. Give access to Python internals, but
64
+ * should not be used by third-party modules.
65
+ * - Py_BUILD_CORE_BUILTIN: Build a Python stdlib module as a built-in module.
66
+ * - Py_BUILD_CORE_MODULE: Build a Python stdlib module as a dynamic library.
67
+ *
68
+ * Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE imply Py_BUILD_CORE.
69
+ *
70
+ * On Windows, Py_BUILD_CORE_MODULE exports "PyInit_xxx" symbol, whereas
71
+ * Py_BUILD_CORE_BUILTIN does not.
72
+ */
73
+ #if defined(Py_BUILD_CORE_BUILTIN) && !defined(Py_BUILD_CORE)
74
+ # define Py_BUILD_CORE
75
+ #endif
76
+ #if defined(Py_BUILD_CORE_MODULE) && !defined(Py_BUILD_CORE)
77
+ # define Py_BUILD_CORE
78
+ #endif
79
+
80
+
81
+ /**************************************************************************
82
+ Symbols and macros to supply platform-independent interfaces to basic
83
+ C language & library operations whose spellings vary across platforms.
84
+
85
+ Please try to make documentation here as clear as possible: by definition,
86
+ the stuff here is trying to illuminate C's darkest corners.
87
+
88
+ Config #defines referenced here:
89
+
90
+ SIGNED_RIGHT_SHIFT_ZERO_FILLS
91
+ Meaning: To be defined iff i>>j does not extend the sign bit when i is a
92
+ signed integral type and i < 0.
93
+ Used in: Py_ARITHMETIC_RIGHT_SHIFT
94
+
95
+ Py_DEBUG
96
+ Meaning: Extra checks compiled in for debug mode.
97
+ Used in: Py_SAFE_DOWNCAST
98
+
99
+ **************************************************************************/
100
+
101
+ /* typedefs for some C9X-defined synonyms for integral types.
102
+ *
103
+ * The names in Python are exactly the same as the C9X names, except with a
104
+ * Py_ prefix. Until C9X is universally implemented, this is the only way
105
+ * to ensure that Python gets reliable names that don't conflict with names
106
+ * in non-Python code that are playing their own tricks to define the C9X
107
+ * names.
108
+ *
109
+ * NOTE: don't go nuts here! Python has no use for *most* of the C9X
110
+ * integral synonyms. Only define the ones we actually need.
111
+ */
112
+
113
+ /* long long is required. Ensure HAVE_LONG_LONG is defined for compatibility. */
114
+ #ifndef HAVE_LONG_LONG
115
+ #define HAVE_LONG_LONG 1
116
+ #endif
117
+ #ifndef PY_LONG_LONG
118
+ #define PY_LONG_LONG long long
119
+ /* If LLONG_MAX is defined in limits.h, use that. */
120
+ #define PY_LLONG_MIN LLONG_MIN
121
+ #define PY_LLONG_MAX LLONG_MAX
122
+ #define PY_ULLONG_MAX ULLONG_MAX
123
+ #endif
124
+
125
+ #define PY_UINT32_T uint32_t
126
+ #define PY_UINT64_T uint64_t
127
+
128
+ /* Signed variants of the above */
129
+ #define PY_INT32_T int32_t
130
+ #define PY_INT64_T int64_t
131
+
132
+ /* PYLONG_BITS_IN_DIGIT describes the number of bits per "digit" (limb) in the
133
+ * PyLongObject implementation (longintrepr.h). It's currently either 30 or 15,
134
+ * defaulting to 30. The 15-bit digit option may be removed in the future.
135
+ */
136
+ #ifndef PYLONG_BITS_IN_DIGIT
137
+ #define PYLONG_BITS_IN_DIGIT 30
138
+ #endif
139
+
140
+ /* uintptr_t is the C9X name for an unsigned integral type such that a
141
+ * legitimate void* can be cast to uintptr_t and then back to void* again
142
+ * without loss of information. Similarly for intptr_t, wrt a signed
143
+ * integral type.
144
+ */
145
+ typedef uintptr_t Py_uintptr_t;
146
+ typedef intptr_t Py_intptr_t;
147
+
148
+ /* Py_ssize_t is a signed integral type such that sizeof(Py_ssize_t) ==
149
+ * sizeof(size_t). C99 doesn't define such a thing directly (size_t is an
150
+ * unsigned integral type). See PEP 353 for details.
151
+ * PY_SSIZE_T_MAX is the largest positive value of type Py_ssize_t.
152
+ */
153
+ #ifdef HAVE_PY_SSIZE_T
154
+
155
+ #elif HAVE_SSIZE_T
156
+ typedef ssize_t Py_ssize_t;
157
+ # define PY_SSIZE_T_MAX SSIZE_MAX
158
+ #elif SIZEOF_VOID_P == SIZEOF_SIZE_T
159
+ typedef Py_intptr_t Py_ssize_t;
160
+ # define PY_SSIZE_T_MAX INTPTR_MAX
161
+ #else
162
+ # error "Python needs a typedef for Py_ssize_t in pyport.h."
163
+ #endif
164
+
165
+ /* Smallest negative value of type Py_ssize_t. */
166
+ #define PY_SSIZE_T_MIN (-PY_SSIZE_T_MAX-1)
167
+
168
+ /* Py_hash_t is the same size as a pointer. */
169
+ #define SIZEOF_PY_HASH_T SIZEOF_SIZE_T
170
+ typedef Py_ssize_t Py_hash_t;
171
+ /* Py_uhash_t is the unsigned equivalent needed to calculate numeric hash. */
172
+ #define SIZEOF_PY_UHASH_T SIZEOF_SIZE_T
173
+ typedef size_t Py_uhash_t;
174
+
175
+ /* Now PY_SSIZE_T_CLEAN is mandatory. This is just for backward compatibility. */
176
+ typedef Py_ssize_t Py_ssize_clean_t;
177
+
178
+ /* Largest possible value of size_t. */
179
+ #define PY_SIZE_MAX SIZE_MAX
180
+
181
+ /* Macro kept for backward compatibility: use directly "z" in new code.
182
+ *
183
+ * PY_FORMAT_SIZE_T is a modifier for use in a printf format to convert an
184
+ * argument with the width of a size_t or Py_ssize_t: "z" (C99).
185
+ */
186
+ #ifndef PY_FORMAT_SIZE_T
187
+ # define PY_FORMAT_SIZE_T "z"
188
+ #endif
189
+
190
+ /* Py_LOCAL can be used instead of static to get the fastest possible calling
191
+ * convention for functions that are local to a given module.
192
+ *
193
+ * Py_LOCAL_INLINE does the same thing, and also explicitly requests inlining,
194
+ * for platforms that support that.
195
+ *
196
+ * NOTE: You can only use this for functions that are entirely local to a
197
+ * module; functions that are exported via method tables, callbacks, etc,
198
+ * should keep using static.
199
+ */
200
+
201
+ #if defined(_MSC_VER)
202
+ /* ignore warnings if the compiler decides not to inline a function */
203
+ # pragma warning(disable: 4710)
204
+ /* fastest possible local call under MSVC */
205
+ # define Py_LOCAL(type) static type __fastcall
206
+ # define Py_LOCAL_INLINE(type) static __inline type __fastcall
207
+ #else
208
+ # define Py_LOCAL(type) static type
209
+ # define Py_LOCAL_INLINE(type) static inline type
210
+ #endif
211
+
212
+ // Soft deprecated since Python 3.14, use memcpy() instead.
213
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
214
+ # define Py_MEMCPY memcpy
215
+ #endif
216
+
217
+ #ifdef __cplusplus
218
+ /* Move this down here since some C++ #include's don't like to be included
219
+ inside an extern "C" */
220
+ extern "C" {
221
+ #endif
222
+
223
+
224
+ /* Py_ARITHMETIC_RIGHT_SHIFT
225
+ * C doesn't define whether a right-shift of a signed integer sign-extends
226
+ * or zero-fills. Here a macro to force sign extension:
227
+ * Py_ARITHMETIC_RIGHT_SHIFT(TYPE, I, J)
228
+ * Return I >> J, forcing sign extension. Arithmetically, return the
229
+ * floor of I/2**J.
230
+ * Requirements:
231
+ * I should have signed integer type. In the terminology of C99, this can
232
+ * be either one of the five standard signed integer types (signed char,
233
+ * short, int, long, long long) or an extended signed integer type.
234
+ * J is an integer >= 0 and strictly less than the number of bits in the
235
+ * type of I (because C doesn't define what happens for J outside that
236
+ * range either).
237
+ * TYPE used to specify the type of I, but is now ignored. It's been left
238
+ * in for backwards compatibility with versions <= 2.6 or 3.0.
239
+ * Caution:
240
+ * I may be evaluated more than once.
241
+ */
242
+ #ifdef SIGNED_RIGHT_SHIFT_ZERO_FILLS
243
+ #define Py_ARITHMETIC_RIGHT_SHIFT(TYPE, I, J) \
244
+ ((I) < 0 ? -1-((-1-(I)) >> (J)) : (I) >> (J))
245
+ #else
246
+ #define Py_ARITHMETIC_RIGHT_SHIFT(TYPE, I, J) ((I) >> (J))
247
+ #endif
248
+
249
+ /* Py_FORCE_EXPANSION(X)
250
+ * "Simply" returns its argument. However, macro expansions within the
251
+ * argument are evaluated. This unfortunate trickery is needed to get
252
+ * token-pasting to work as desired in some cases.
253
+ */
254
+ #define Py_FORCE_EXPANSION(X) X
255
+
256
+ /* Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW)
257
+ * Cast VALUE to type NARROW from type WIDE. In Py_DEBUG mode, this
258
+ * assert-fails if any information is lost.
259
+ * Caution:
260
+ * VALUE may be evaluated more than once.
261
+ */
262
+ #ifdef Py_DEBUG
263
+ # define Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW) \
264
+ (assert(_Py_STATIC_CAST(WIDE, _Py_STATIC_CAST(NARROW, (VALUE))) == (VALUE)), \
265
+ _Py_STATIC_CAST(NARROW, (VALUE)))
266
+ #else
267
+ # define Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW) _Py_STATIC_CAST(NARROW, (VALUE))
268
+ #endif
269
+
270
+
271
+ /* Py_DEPRECATED(version)
272
+ * Declare a variable, type, or function deprecated.
273
+ * The macro must be placed before the declaration.
274
+ * Usage:
275
+ * Py_DEPRECATED(3.3) extern int old_var;
276
+ * Py_DEPRECATED(3.4) typedef int T1;
277
+ * Py_DEPRECATED(3.8) PyAPI_FUNC(int) Py_OldFunction(void);
278
+ */
279
+ #if defined(__GNUC__) \
280
+ && ((__GNUC__ >= 4) || (__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))
281
+ #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
282
+ #elif defined(_MSC_VER)
283
+ #define Py_DEPRECATED(VERSION) __declspec(deprecated( \
284
+ "deprecated in " #VERSION))
285
+ #else
286
+ #define Py_DEPRECATED(VERSION_UNUSED)
287
+ #endif
288
+
289
+ // _Py_DEPRECATED_EXTERNALLY(version)
290
+ // Deprecated outside CPython core.
291
+ #ifdef Py_BUILD_CORE
292
+ #define _Py_DEPRECATED_EXTERNALLY(VERSION_UNUSED)
293
+ #else
294
+ #define _Py_DEPRECATED_EXTERNALLY(version) Py_DEPRECATED(version)
295
+ #endif
296
+
297
+
298
+ #if defined(__clang__)
299
+ #define _Py_COMP_DIAG_PUSH _Pragma("clang diagnostic push")
300
+ #define _Py_COMP_DIAG_IGNORE_DEPR_DECLS \
301
+ _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
302
+ #define _Py_COMP_DIAG_POP _Pragma("clang diagnostic pop")
303
+ #elif defined(__GNUC__) \
304
+ && ((__GNUC__ >= 5) || (__GNUC__ == 4) && (__GNUC_MINOR__ >= 6))
305
+ #define _Py_COMP_DIAG_PUSH _Pragma("GCC diagnostic push")
306
+ #define _Py_COMP_DIAG_IGNORE_DEPR_DECLS \
307
+ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
308
+ #define _Py_COMP_DIAG_POP _Pragma("GCC diagnostic pop")
309
+ #elif defined(_MSC_VER)
310
+ #define _Py_COMP_DIAG_PUSH __pragma(warning(push))
311
+ #define _Py_COMP_DIAG_IGNORE_DEPR_DECLS __pragma(warning(disable: 4996))
312
+ #define _Py_COMP_DIAG_POP __pragma(warning(pop))
313
+ #else
314
+ #define _Py_COMP_DIAG_PUSH
315
+ #define _Py_COMP_DIAG_IGNORE_DEPR_DECLS
316
+ #define _Py_COMP_DIAG_POP
317
+ #endif
318
+
319
+ /* _Py_HOT_FUNCTION
320
+ * The hot attribute on a function is used to inform the compiler that the
321
+ * function is a hot spot of the compiled program. The function is optimized
322
+ * more aggressively and on many target it is placed into special subsection of
323
+ * the text section so all hot functions appears close together improving
324
+ * locality.
325
+ *
326
+ * Usage:
327
+ * int _Py_HOT_FUNCTION x(void) { return 3; }
328
+ *
329
+ * Issue #28618: This attribute must not be abused, otherwise it can have a
330
+ * negative effect on performance. Only the functions were Python spend most of
331
+ * its time must use it. Use a profiler when running performance benchmark
332
+ * suite to find these functions.
333
+ */
334
+ #if defined(__GNUC__) \
335
+ && ((__GNUC__ >= 5) || (__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))
336
+ #define _Py_HOT_FUNCTION __attribute__((hot))
337
+ #else
338
+ #define _Py_HOT_FUNCTION
339
+ #endif
340
+
341
+ // Ask the compiler to always inline a static inline function. The compiler can
342
+ // ignore it and decides to not inline the function.
343
+ //
344
+ // It can be used to inline performance critical static inline functions when
345
+ // building Python in debug mode with function inlining disabled. For example,
346
+ // MSC disables function inlining when building in debug mode.
347
+ //
348
+ // Marking blindly a static inline function with Py_ALWAYS_INLINE can result in
349
+ // worse performances (due to increased code size for example). The compiler is
350
+ // usually smarter than the developer for the cost/benefit analysis.
351
+ //
352
+ // If Python is built in debug mode (if the Py_DEBUG macro is defined), the
353
+ // Py_ALWAYS_INLINE macro does nothing.
354
+ //
355
+ // It must be specified before the function return type. Usage:
356
+ //
357
+ // static inline Py_ALWAYS_INLINE int random(void) { return 4; }
358
+ #if defined(Py_DEBUG)
359
+ // If Python is built in debug mode, usually compiler optimizations are
360
+ // disabled. In this case, Py_ALWAYS_INLINE can increase a lot the stack
361
+ // memory usage. For example, forcing inlining using gcc -O0 increases the
362
+ // stack usage from 6 KB to 15 KB per Python function call.
363
+ # define Py_ALWAYS_INLINE
364
+ #elif defined(__GNUC__) || defined(__clang__) || defined(__INTEL_COMPILER)
365
+ # define Py_ALWAYS_INLINE __attribute__((always_inline))
366
+ #elif defined(_MSC_VER)
367
+ # define Py_ALWAYS_INLINE __forceinline
368
+ #else
369
+ # define Py_ALWAYS_INLINE
370
+ #endif
371
+
372
+ // Py_NO_INLINE
373
+ // Disable inlining on a function. For example, it reduces the C stack
374
+ // consumption: useful on LTO+PGO builds which heavily inline code (see
375
+ // bpo-33720).
376
+ //
377
+ // Usage:
378
+ //
379
+ // Py_NO_INLINE static int random(void) { return 4; }
380
+ #if defined(__GNUC__) || defined(__clang__) || defined(__INTEL_COMPILER)
381
+ # define Py_NO_INLINE __attribute__ ((noinline))
382
+ #elif defined(_MSC_VER)
383
+ # define Py_NO_INLINE __declspec(noinline)
384
+ #else
385
+ # define Py_NO_INLINE
386
+ #endif
387
+
388
+ #include "exports.h"
389
+
390
+ #ifdef Py_LIMITED_API
391
+ // The internal C API must not be used with the limited C API: make sure
392
+ // that Py_BUILD_CORE macro is not defined in this case. These 3 macros are
393
+ // used by exports.h, so only undefine them afterwards.
394
+ # undef Py_BUILD_CORE
395
+ # undef Py_BUILD_CORE_BUILTIN
396
+ # undef Py_BUILD_CORE_MODULE
397
+ #endif
398
+
399
+ /* limits.h constants that may be missing */
400
+
401
+ #ifndef INT_MAX
402
+ #define INT_MAX 2147483647
403
+ #endif
404
+
405
+ #ifndef LONG_MAX
406
+ #if SIZEOF_LONG == 4
407
+ #define LONG_MAX 0X7FFFFFFFL
408
+ #elif SIZEOF_LONG == 8
409
+ #define LONG_MAX 0X7FFFFFFFFFFFFFFFL
410
+ #else
411
+ #error "could not set LONG_MAX in pyport.h"
412
+ #endif
413
+ #endif
414
+
415
+ #ifndef LONG_MIN
416
+ #define LONG_MIN (-LONG_MAX-1)
417
+ #endif
418
+
419
+ #ifndef LONG_BIT
420
+ #define LONG_BIT (8 * SIZEOF_LONG)
421
+ #endif
422
+
423
+ #if LONG_BIT != 8 * SIZEOF_LONG
424
+ /* 04-Oct-2000 LONG_BIT is apparently (mis)defined as 64 on some recent
425
+ * 32-bit platforms using gcc. We try to catch that here at compile-time
426
+ * rather than waiting for integer multiplication to trigger bogus
427
+ * overflows.
428
+ */
429
+ #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
430
+ #endif
431
+
432
+ #ifdef __cplusplus
433
+ }
434
+ #endif
435
+
436
+ /*
437
+ * Hide GCC attributes from compilers that don't support them.
438
+ */
439
+ #if (!defined(__GNUC__) || __GNUC__ < 2 || \
440
+ (__GNUC__ == 2 && __GNUC_MINOR__ < 7) )
441
+ #define Py_GCC_ATTRIBUTE(x)
442
+ #else
443
+ #define Py_GCC_ATTRIBUTE(x) __attribute__(x)
444
+ #endif
445
+
446
+ /*
447
+ * Specify alignment on compilers that support it.
448
+ */
449
+ #if defined(__GNUC__) && __GNUC__ >= 3
450
+ #define Py_ALIGNED(x) __attribute__((aligned(x)))
451
+ #else
452
+ #define Py_ALIGNED(x)
453
+ #endif
454
+
455
+ /* Eliminate end-of-loop code not reached warnings from SunPro C
456
+ * when using do{...}while(0) macros
457
+ */
458
+ #ifdef __SUNPRO_C
459
+ #pragma error_messages (off,E_END_OF_LOOP_CODE_NOT_REACHED)
460
+ #endif
461
+
462
+ #ifndef Py_LL
463
+ #define Py_LL(x) x##LL
464
+ #endif
465
+
466
+ #ifndef Py_ULL
467
+ #define Py_ULL(x) Py_LL(x##U)
468
+ #endif
469
+
470
+ #define Py_VA_COPY va_copy
471
+
472
+ /*
473
+ * Convenient macros to deal with endianness of the platform. WORDS_BIGENDIAN is
474
+ * detected by configure and defined in pyconfig.h. The code in pyconfig.h
475
+ * also takes care of Apple's universal builds.
476
+ */
477
+
478
+ #ifdef WORDS_BIGENDIAN
479
+ # define PY_BIG_ENDIAN 1
480
+ # define PY_LITTLE_ENDIAN 0
481
+ #else
482
+ # define PY_BIG_ENDIAN 0
483
+ # define PY_LITTLE_ENDIAN 1
484
+ #endif
485
+
486
+ #ifdef __ANDROID__
487
+ /* The Android langinfo.h header is not used. */
488
+ # undef HAVE_LANGINFO_H
489
+ # undef CODESET
490
+ #endif
491
+
492
+ /* Maximum value of the Windows DWORD type */
493
+ #define PY_DWORD_MAX 4294967295U
494
+
495
+ /* This macro used to tell whether Python was built with multithreading
496
+ * enabled. Now multithreading is always enabled, but keep the macro
497
+ * for compatibility.
498
+ */
499
+ #ifndef WITH_THREAD
500
+ # define WITH_THREAD
501
+ #endif
502
+
503
+ /* Some WebAssembly platforms do not provide a working pthread implementation.
504
+ * Thread support is stubbed and any attempt to create a new thread fails.
505
+ */
506
+ #if (!defined(HAVE_PTHREAD_STUBS) && \
507
+ (!defined(__EMSCRIPTEN__) || defined(__EMSCRIPTEN_PTHREADS__)))
508
+ # define Py_CAN_START_THREADS 1
509
+ #endif
510
+
511
+ #ifdef WITH_THREAD
512
+ # ifdef Py_BUILD_CORE
513
+ # ifdef HAVE_THREAD_LOCAL
514
+ # error "HAVE_THREAD_LOCAL is already defined"
515
+ # endif
516
+ # define HAVE_THREAD_LOCAL 1
517
+ # ifdef thread_local
518
+ # define _Py_thread_local thread_local
519
+ # elif __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_THREADS__)
520
+ # define _Py_thread_local _Thread_local
521
+ # elif defined(_MSC_VER) /* AKA NT_THREADS */
522
+ # define _Py_thread_local __declspec(thread)
523
+ # elif defined(__GNUC__) /* includes clang */
524
+ # define _Py_thread_local __thread
525
+ # else
526
+ // fall back to the PyThread_tss_*() API, or ignore.
527
+ # undef HAVE_THREAD_LOCAL
528
+ # endif
529
+ # endif
530
+ #endif
531
+
532
+ #if defined(__ANDROID__) || defined(__VXWORKS__)
533
+ // Use UTF-8 as the locale encoding, ignore the LC_CTYPE locale.
534
+ // See _Py_GetLocaleEncoding(), PyUnicode_DecodeLocale()
535
+ // and PyUnicode_EncodeLocale().
536
+ # define _Py_FORCE_UTF8_LOCALE
537
+ #endif
538
+
539
+ #if defined(_Py_FORCE_UTF8_LOCALE) || defined(__APPLE__)
540
+ // Use UTF-8 as the filesystem encoding.
541
+ // See PyUnicode_DecodeFSDefaultAndSize(), PyUnicode_EncodeFSDefault(),
542
+ // Py_DecodeLocale() and Py_EncodeLocale().
543
+ # define _Py_FORCE_UTF8_FS_ENCODING
544
+ #endif
545
+
546
+ /* Mark a function which cannot return. Example:
547
+ PyAPI_FUNC(void) _Py_NO_RETURN PyThread_exit_thread(void);
548
+
549
+ XLC support is intentionally omitted due to bpo-40244 */
550
+ #ifndef _Py_NO_RETURN
551
+ #if defined(__clang__) || \
552
+ (defined(__GNUC__) && \
553
+ ((__GNUC__ >= 3) || \
554
+ (__GNUC__ == 2) && (__GNUC_MINOR__ >= 5)))
555
+ # define _Py_NO_RETURN __attribute__((__noreturn__))
556
+ #elif defined(_MSC_VER)
557
+ # define _Py_NO_RETURN __declspec(noreturn)
558
+ #else
559
+ # define _Py_NO_RETURN
560
+ #endif
561
+ #endif
562
+
563
+
564
+ // _Py_TYPEOF(expr) gets the type of an expression.
565
+ //
566
+ // Example: _Py_TYPEOF(x) x_copy = (x);
567
+ //
568
+ // The macro is only defined if GCC or clang compiler is used.
569
+ #if defined(__GNUC__) || defined(__clang__)
570
+ # define _Py_TYPEOF(expr) __typeof__(expr)
571
+ #endif
572
+
573
+
574
+ /* A convenient way for code to know if sanitizers are enabled. */
575
+ #if defined(__has_feature)
576
+ # if __has_feature(memory_sanitizer)
577
+ # if !defined(_Py_MEMORY_SANITIZER)
578
+ # define _Py_MEMORY_SANITIZER
579
+ # define _Py_NO_SANITIZE_MEMORY __attribute__((no_sanitize_memory))
580
+ # endif
581
+ # endif
582
+ # if __has_feature(address_sanitizer)
583
+ # if !defined(_Py_ADDRESS_SANITIZER)
584
+ # define _Py_ADDRESS_SANITIZER
585
+ # define _Py_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
586
+ # endif
587
+ # endif
588
+ # if __has_feature(thread_sanitizer)
589
+ # if !defined(_Py_THREAD_SANITIZER)
590
+ # define _Py_THREAD_SANITIZER
591
+ # define _Py_NO_SANITIZE_THREAD __attribute__((no_sanitize_thread))
592
+ # endif
593
+ # endif
594
+ #elif defined(__GNUC__)
595
+ # if defined(__SANITIZE_ADDRESS__)
596
+ # define _Py_ADDRESS_SANITIZER
597
+ # define _Py_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
598
+ # endif
599
+ # if defined(__SANITIZE_THREAD__)
600
+ # define _Py_THREAD_SANITIZER
601
+ # define _Py_NO_SANITIZE_THREAD __attribute__((no_sanitize_thread))
602
+ # elif __GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ >= 1)
603
+ // TSAN is supported since GCC 5.1, but __SANITIZE_THREAD__ macro
604
+ // is provided only since GCC 7.
605
+ # define _Py_NO_SANITIZE_THREAD __attribute__((no_sanitize_thread))
606
+ # endif
607
+ #endif
608
+
609
+ #ifndef _Py_NO_SANITIZE_ADDRESS
610
+ # define _Py_NO_SANITIZE_ADDRESS
611
+ #endif
612
+ #ifndef _Py_NO_SANITIZE_THREAD
613
+ # define _Py_NO_SANITIZE_THREAD
614
+ #endif
615
+ #ifndef _Py_NO_SANITIZE_MEMORY
616
+ # define _Py_NO_SANITIZE_MEMORY
617
+ #endif
618
+
619
+ /* AIX has __bool__ redefined in it's system header file. */
620
+ #if defined(_AIX) && defined(__bool__)
621
+ #undef __bool__
622
+ #endif
623
+
624
+ // Make sure we have maximum alignment, even if the current compiler
625
+ // does not support max_align_t. Note that:
626
+ // - Autoconf reports alignment of unknown types to 0.
627
+ // - 'long double' has maximum alignment on *most* platforms,
628
+ // looks like the best we can do for pre-C11 compilers.
629
+ // - The value is tested, see test_alignof_max_align_t
630
+ #if !defined(ALIGNOF_MAX_ALIGN_T) || ALIGNOF_MAX_ALIGN_T == 0
631
+ # undef ALIGNOF_MAX_ALIGN_T
632
+ # define ALIGNOF_MAX_ALIGN_T _Alignof(long double)
633
+ #endif
634
+
635
+ #ifndef PY_CXX_CONST
636
+ # ifdef __cplusplus
637
+ # define PY_CXX_CONST const
638
+ # else
639
+ # define PY_CXX_CONST
640
+ # endif
641
+ #endif
642
+
643
+ #if defined(__sgi) && !defined(_SGI_MP_SOURCE)
644
+ # define _SGI_MP_SOURCE
645
+ #endif
646
+
647
+ // Explicit fallthrough in switch case to avoid warnings
648
+ // with compiler flag -Wimplicit-fallthrough.
649
+ //
650
+ // Usage example:
651
+ //
652
+ // switch (value) {
653
+ // case 1: _Py_FALLTHROUGH;
654
+ // case 2: code; break;
655
+ // }
656
+ //
657
+ // __attribute__((fallthrough)) was introduced in GCC 7 and Clang 10 /
658
+ // Apple Clang 12.0. Earlier Clang versions support only the C++11
659
+ // style fallthrough attribute, not the GCC extension syntax used here,
660
+ // and __has_attribute(fallthrough) evaluates to 1.
661
+ #if _Py__has_attribute(fallthrough) && (!defined(__clang__) || \
662
+ (!defined(__apple_build_version__) && __clang_major__ >= 10) || \
663
+ (defined(__apple_build_version__) && __clang_major__ >= 12))
664
+ # define _Py_FALLTHROUGH __attribute__((fallthrough))
665
+ #else
666
+ # define _Py_FALLTHROUGH do { } while (0)
667
+ #endif
668
+
669
+
670
+ // _Py_NO_SANITIZE_UNDEFINED(): Disable Undefined Behavior sanitizer (UBsan)
671
+ // on a function.
672
+ //
673
+ // Clang and GCC 9.0+ use __attribute__((no_sanitize("undefined"))).
674
+ // GCC 4.9+ uses __attribute__((no_sanitize_undefined)).
675
+ #if defined(__has_feature)
676
+ # if __has_feature(undefined_behavior_sanitizer)
677
+ # define _Py_NO_SANITIZE_UNDEFINED __attribute__((no_sanitize("undefined")))
678
+ # endif
679
+ #endif
680
+ #if !defined(_Py_NO_SANITIZE_UNDEFINED) && defined(__GNUC__) \
681
+ && ((__GNUC__ >= 5) || (__GNUC__ == 4) && (__GNUC_MINOR__ >= 9))
682
+ # define _Py_NO_SANITIZE_UNDEFINED __attribute__((no_sanitize_undefined))
683
+ #endif
684
+ #ifndef _Py_NO_SANITIZE_UNDEFINED
685
+ # define _Py_NO_SANITIZE_UNDEFINED
686
+ #endif
687
+
688
+
689
+ // _Py_NONSTRING: The nonstring variable attribute specifies that an object or
690
+ // member declaration with type array of char, signed char, or unsigned char,
691
+ // or pointer to such a type is intended to store character arrays that do not
692
+ // necessarily contain a terminating NUL.
693
+ //
694
+ // Usage:
695
+ //
696
+ // char name [8] _Py_NONSTRING;
697
+ #if _Py__has_attribute(nonstring)
698
+ # define _Py_NONSTRING __attribute__((nonstring))
699
+ #else
700
+ # define _Py_NONSTRING
701
+ #endif
702
+
703
+
704
+ // Assume the stack grows down unless specified otherwise
705
+ #ifndef _Py_STACK_GROWS_DOWN
706
+ # define _Py_STACK_GROWS_DOWN 1
707
+ #endif
708
+
709
+
710
+ #endif /* Py_PYPORT_H */