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,915 @@
1
+ /* Abstract Object Interface (many thanks to Jim Fulton) */
2
+
3
+ #ifndef Py_ABSTRACTOBJECT_H
4
+ #define Py_ABSTRACTOBJECT_H
5
+ #ifdef __cplusplus
6
+ extern "C" {
7
+ #endif
8
+
9
+ /* === Object Protocol ================================================== */
10
+
11
+ /* Implemented elsewhere:
12
+
13
+ int PyObject_Print(PyObject *o, FILE *fp, int flags);
14
+
15
+ Print an object 'o' on file 'fp'. Returns -1 on error. The flags argument
16
+ is used to enable certain printing options. The only option currently
17
+ supported is Py_PRINT_RAW. By default (flags=0), PyObject_Print() formats
18
+ the object by calling PyObject_Repr(). If flags equals to Py_PRINT_RAW, it
19
+ formats the object by calling PyObject_Str(). */
20
+
21
+
22
+ /* Implemented elsewhere:
23
+
24
+ int PyObject_HasAttrString(PyObject *o, const char *attr_name);
25
+
26
+ Returns 1 if object 'o' has the attribute attr_name, and 0 otherwise.
27
+
28
+ This is equivalent to the Python expression: hasattr(o,attr_name).
29
+
30
+ This function always succeeds. */
31
+
32
+
33
+ /* Implemented elsewhere:
34
+
35
+ PyObject* PyObject_GetAttrString(PyObject *o, const char *attr_name);
36
+
37
+ Retrieve an attributed named attr_name form object o.
38
+ Returns the attribute value on success, or NULL on failure.
39
+
40
+ This is the equivalent of the Python expression: o.attr_name. */
41
+
42
+
43
+ /* Implemented elsewhere:
44
+
45
+ int PyObject_HasAttr(PyObject *o, PyObject *attr_name);
46
+
47
+ Returns 1 if o has the attribute attr_name, and 0 otherwise.
48
+
49
+ This is equivalent to the Python expression: hasattr(o,attr_name).
50
+
51
+ This function always succeeds. */
52
+
53
+
54
+ /* Implemented elsewhere:
55
+
56
+ int PyObject_HasAttrStringWithError(PyObject *o, const char *attr_name);
57
+
58
+ Returns 1 if object 'o' has the attribute attr_name, and 0 otherwise.
59
+ This is equivalent to the Python expression: hasattr(o,attr_name).
60
+ Returns -1 on failure. */
61
+
62
+
63
+ /* Implemented elsewhere:
64
+
65
+ int PyObject_HasAttrWithError(PyObject *o, PyObject *attr_name);
66
+
67
+ Returns 1 if o has the attribute attr_name, and 0 otherwise.
68
+ This is equivalent to the Python expression: hasattr(o,attr_name).
69
+ Returns -1 on failure. */
70
+
71
+
72
+ /* Implemented elsewhere:
73
+
74
+ PyObject* PyObject_GetAttr(PyObject *o, PyObject *attr_name);
75
+
76
+ Retrieve an attributed named 'attr_name' form object 'o'.
77
+ Returns the attribute value on success, or NULL on failure.
78
+
79
+ This is the equivalent of the Python expression: o.attr_name. */
80
+
81
+
82
+ /* Implemented elsewhere:
83
+
84
+ int PyObject_GetOptionalAttr(PyObject *obj, PyObject *attr_name, PyObject **result);
85
+
86
+ Variant of PyObject_GetAttr() which doesn't raise AttributeError
87
+ if the attribute is not found.
88
+
89
+ If the attribute is found, return 1 and set *result to a new strong
90
+ reference to the attribute.
91
+ If the attribute is not found, return 0 and set *result to NULL;
92
+ the AttributeError is silenced.
93
+ If an error other than AttributeError is raised, return -1 and
94
+ set *result to NULL.
95
+ */
96
+
97
+
98
+ /* Implemented elsewhere:
99
+
100
+ int PyObject_GetOptionalAttrString(PyObject *obj, const char *attr_name, PyObject **result);
101
+
102
+ Variant of PyObject_GetAttrString() which doesn't raise AttributeError
103
+ if the attribute is not found.
104
+
105
+ If the attribute is found, return 1 and set *result to a new strong
106
+ reference to the attribute.
107
+ If the attribute is not found, return 0 and set *result to NULL;
108
+ the AttributeError is silenced.
109
+ If an error other than AttributeError is raised, return -1 and
110
+ set *result to NULL.
111
+ */
112
+
113
+
114
+ /* Implemented elsewhere:
115
+
116
+ int PyObject_SetAttrString(PyObject *o, const char *attr_name, PyObject *v);
117
+
118
+ Set the value of the attribute named attr_name, for object 'o',
119
+ to the value 'v'. Raise an exception and return -1 on failure; return 0 on
120
+ success.
121
+
122
+ This is the equivalent of the Python statement o.attr_name=v. */
123
+
124
+
125
+ /* Implemented elsewhere:
126
+
127
+ int PyObject_SetAttr(PyObject *o, PyObject *attr_name, PyObject *v);
128
+
129
+ Set the value of the attribute named attr_name, for object 'o', to the value
130
+ 'v'. an exception and return -1 on failure; return 0 on success.
131
+
132
+ This is the equivalent of the Python statement o.attr_name=v. */
133
+
134
+ /* Implemented elsewhere:
135
+
136
+ int PyObject_DelAttrString(PyObject *o, const char *attr_name);
137
+
138
+ Delete attribute named attr_name, for object o. Returns
139
+ -1 on failure.
140
+
141
+ This is the equivalent of the Python statement: del o.attr_name.
142
+
143
+ Implemented as a macro in the limited C API 3.12 and older. */
144
+ #if defined(Py_LIMITED_API) && Py_LIMITED_API+0 < 0x030d0000
145
+ # define PyObject_DelAttrString(O, A) PyObject_SetAttrString((O), (A), NULL)
146
+ #endif
147
+
148
+
149
+ /* Implemented elsewhere:
150
+
151
+ int PyObject_DelAttr(PyObject *o, PyObject *attr_name);
152
+
153
+ Delete attribute named attr_name, for object o. Returns -1
154
+ on failure. This is the equivalent of the Python
155
+ statement: del o.attr_name.
156
+
157
+ Implemented as a macro in the limited C API 3.12 and older. */
158
+ #if defined(Py_LIMITED_API) && Py_LIMITED_API+0 < 0x030d0000
159
+ # define PyObject_DelAttr(O, A) PyObject_SetAttr((O), (A), NULL)
160
+ #endif
161
+
162
+
163
+ /* Implemented elsewhere:
164
+
165
+ PyObject *PyObject_Repr(PyObject *o);
166
+
167
+ Compute the string representation of object 'o'. Returns the
168
+ string representation on success, NULL on failure.
169
+
170
+ This is the equivalent of the Python expression: repr(o).
171
+
172
+ Called by the repr() built-in function. */
173
+
174
+
175
+ /* Implemented elsewhere:
176
+
177
+ PyObject *PyObject_Str(PyObject *o);
178
+
179
+ Compute the string representation of object, o. Returns the
180
+ string representation on success, NULL on failure.
181
+
182
+ This is the equivalent of the Python expression: str(o).
183
+
184
+ Called by the str() and print() built-in functions. */
185
+
186
+
187
+ /* Declared elsewhere
188
+
189
+ PyAPI_FUNC(int) PyCallable_Check(PyObject *o);
190
+
191
+ Determine if the object, o, is callable. Return 1 if the object is callable
192
+ and 0 otherwise.
193
+
194
+ This function always succeeds. */
195
+
196
+
197
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03090000
198
+ /* Call a callable Python object without any arguments */
199
+ PyAPI_FUNC(PyObject *) PyObject_CallNoArgs(PyObject *func);
200
+ #endif
201
+
202
+
203
+ /* Call a callable Python object 'callable' with arguments given by the
204
+ tuple 'args' and keywords arguments given by the dictionary 'kwargs'.
205
+
206
+ 'args' must not be NULL, use an empty tuple if no arguments are
207
+ needed. If no named arguments are needed, 'kwargs' can be NULL.
208
+
209
+ This is the equivalent of the Python expression:
210
+ callable(*args, **kwargs). */
211
+ PyAPI_FUNC(PyObject *) PyObject_Call(PyObject *callable,
212
+ PyObject *args, PyObject *kwargs);
213
+
214
+
215
+ /* Call a callable Python object 'callable', with arguments given by the
216
+ tuple 'args'. If no arguments are needed, then 'args' can be NULL.
217
+
218
+ Returns the result of the call on success, or NULL on failure.
219
+
220
+ This is the equivalent of the Python expression:
221
+ callable(*args). */
222
+ PyAPI_FUNC(PyObject *) PyObject_CallObject(PyObject *callable,
223
+ PyObject *args);
224
+
225
+ /* Call a callable Python object, callable, with a variable number of C
226
+ arguments. The C arguments are described using a mkvalue-style format
227
+ string.
228
+
229
+ The format may be NULL, indicating that no arguments are provided.
230
+
231
+ Returns the result of the call on success, or NULL on failure.
232
+
233
+ This is the equivalent of the Python expression:
234
+ callable(arg1, arg2, ...). */
235
+ PyAPI_FUNC(PyObject *) PyObject_CallFunction(PyObject *callable,
236
+ const char *format, ...);
237
+
238
+ /* Call the method named 'name' of object 'obj' with a variable number of
239
+ C arguments. The C arguments are described by a mkvalue format string.
240
+
241
+ The format can be NULL, indicating that no arguments are provided.
242
+
243
+ Returns the result of the call on success, or NULL on failure.
244
+
245
+ This is the equivalent of the Python expression:
246
+ obj.name(arg1, arg2, ...). */
247
+ PyAPI_FUNC(PyObject *) PyObject_CallMethod(PyObject *obj,
248
+ const char *name,
249
+ const char *format, ...);
250
+
251
+ /* Call a callable Python object 'callable' with a variable number of C
252
+ arguments. The C arguments are provided as PyObject* values, terminated
253
+ by a NULL.
254
+
255
+ Returns the result of the call on success, or NULL on failure.
256
+
257
+ This is the equivalent of the Python expression:
258
+ callable(arg1, arg2, ...). */
259
+ PyAPI_FUNC(PyObject *) PyObject_CallFunctionObjArgs(PyObject *callable,
260
+ ...);
261
+
262
+ /* Call the method named 'name' of object 'obj' with a variable number of
263
+ C arguments. The C arguments are provided as PyObject* values, terminated
264
+ by NULL.
265
+
266
+ Returns the result of the call on success, or NULL on failure.
267
+
268
+ This is the equivalent of the Python expression: obj.name(*args). */
269
+
270
+ PyAPI_FUNC(PyObject *) PyObject_CallMethodObjArgs(
271
+ PyObject *obj,
272
+ PyObject *name,
273
+ ...);
274
+
275
+ /* Given a vectorcall nargsf argument, return the actual number of arguments.
276
+ * (For use outside the limited API, this is re-defined as a static inline
277
+ * function in cpython/abstract.h)
278
+ */
279
+ PyAPI_FUNC(Py_ssize_t) PyVectorcall_NARGS(size_t nargsf);
280
+
281
+ /* Call "callable" (which must support vectorcall) with positional arguments
282
+ "tuple" and keyword arguments "dict". "dict" may also be NULL */
283
+ PyAPI_FUNC(PyObject *) PyVectorcall_Call(PyObject *callable, PyObject *tuple, PyObject *dict);
284
+
285
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030C0000
286
+ #define PY_VECTORCALL_ARGUMENTS_OFFSET \
287
+ (_Py_STATIC_CAST(size_t, 1) << (8 * sizeof(size_t) - 1))
288
+
289
+ /* Perform a PEP 590-style vector call on 'callable' */
290
+ PyAPI_FUNC(PyObject *) PyObject_Vectorcall(
291
+ PyObject *callable,
292
+ PyObject *const *args,
293
+ size_t nargsf,
294
+ PyObject *kwnames);
295
+
296
+ /* Call the method 'name' on args[0] with arguments in args[1..nargsf-1]. */
297
+ PyAPI_FUNC(PyObject *) PyObject_VectorcallMethod(
298
+ PyObject *name, PyObject *const *args,
299
+ size_t nargsf, PyObject *kwnames);
300
+ #endif
301
+
302
+ /* Implemented elsewhere:
303
+
304
+ Py_hash_t PyObject_Hash(PyObject *o);
305
+
306
+ Compute and return the hash, hash_value, of an object, o. On
307
+ failure, return -1.
308
+
309
+ This is the equivalent of the Python expression: hash(o). */
310
+
311
+
312
+ /* Implemented elsewhere:
313
+
314
+ int PyObject_IsTrue(PyObject *o);
315
+
316
+ Returns 1 if the object, o, is considered to be true, 0 if o is
317
+ considered to be false and -1 on failure.
318
+
319
+ This is equivalent to the Python expression: not not o. */
320
+
321
+
322
+ /* Implemented elsewhere:
323
+
324
+ int PyObject_Not(PyObject *o);
325
+
326
+ Returns 0 if the object, o, is considered to be true, 1 if o is
327
+ considered to be false and -1 on failure.
328
+
329
+ This is equivalent to the Python expression: not o. */
330
+
331
+
332
+ /* Get the type of an object.
333
+
334
+ On success, returns a type object corresponding to the object type of object
335
+ 'o'. On failure, returns NULL.
336
+
337
+ This is equivalent to the Python expression: type(o) */
338
+ PyAPI_FUNC(PyObject *) PyObject_Type(PyObject *o);
339
+
340
+
341
+ /* Return the size of object 'o'. If the object 'o' provides both sequence and
342
+ mapping protocols, the sequence size is returned.
343
+
344
+ On error, -1 is returned.
345
+
346
+ This is the equivalent to the Python expression: len(o) */
347
+ PyAPI_FUNC(Py_ssize_t) PyObject_Size(PyObject *o);
348
+
349
+
350
+ /* For DLL compatibility */
351
+ #undef PyObject_Length
352
+ PyAPI_FUNC(Py_ssize_t) PyObject_Length(PyObject *o);
353
+ #define PyObject_Length PyObject_Size
354
+
355
+ /* Return element of 'o' corresponding to the object 'key'. Return NULL
356
+ on failure.
357
+
358
+ This is the equivalent of the Python expression: o[key] */
359
+ PyAPI_FUNC(PyObject *) PyObject_GetItem(PyObject *o, PyObject *key);
360
+
361
+
362
+ /* Map the object 'key' to the value 'v' into 'o'.
363
+
364
+ Raise an exception and return -1 on failure; return 0 on success.
365
+
366
+ This is the equivalent of the Python statement: o[key]=v. */
367
+ PyAPI_FUNC(int) PyObject_SetItem(PyObject *o, PyObject *key, PyObject *v);
368
+
369
+ /* Remove the mapping for the string 'key' from the object 'o'.
370
+ Returns -1 on failure.
371
+
372
+ This is equivalent to the Python statement: del o[key]. */
373
+ PyAPI_FUNC(int) PyObject_DelItemString(PyObject *o, const char *key);
374
+
375
+ /* Delete the mapping for the object 'key' from the object 'o'.
376
+ Returns -1 on failure.
377
+
378
+ This is the equivalent of the Python statement: del o[key]. */
379
+ PyAPI_FUNC(int) PyObject_DelItem(PyObject *o, PyObject *key);
380
+
381
+
382
+ /* Takes an arbitrary object and returns the result of calling
383
+ obj.__format__(format_spec). */
384
+ PyAPI_FUNC(PyObject *) PyObject_Format(PyObject *obj,
385
+ PyObject *format_spec);
386
+
387
+
388
+ /* ==== Iterators ================================================ */
389
+
390
+ /* Takes an object and returns an iterator for it.
391
+ This is typically a new iterator but if the argument is an iterator, this
392
+ returns itself. */
393
+ PyAPI_FUNC(PyObject *) PyObject_GetIter(PyObject *);
394
+
395
+ /* Takes an AsyncIterable object and returns an AsyncIterator for it.
396
+ This is typically a new iterator but if the argument is an AsyncIterator,
397
+ this returns itself. */
398
+ PyAPI_FUNC(PyObject *) PyObject_GetAIter(PyObject *);
399
+
400
+ /* Returns non-zero if the object 'obj' provides iterator protocols, and 0 otherwise.
401
+
402
+ This function always succeeds. */
403
+ PyAPI_FUNC(int) PyIter_Check(PyObject *);
404
+
405
+ /* Returns non-zero if the object 'obj' provides AsyncIterator protocols, and 0 otherwise.
406
+
407
+ This function always succeeds. */
408
+ PyAPI_FUNC(int) PyAIter_Check(PyObject *);
409
+
410
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030e0000
411
+ /* Return 1 and set 'item' to the next item of 'iter' on success.
412
+ * Return 0 and set 'item' to NULL when there are no remaining values.
413
+ * Return -1, set 'item' to NULL and set an exception on error.
414
+ */
415
+ PyAPI_FUNC(int) PyIter_NextItem(PyObject *iter, PyObject **item);
416
+ #endif
417
+
418
+ /* Takes an iterator object and calls its tp_iternext slot,
419
+ returning the next value.
420
+
421
+ If the iterator is exhausted, this returns NULL without setting an
422
+ exception.
423
+
424
+ NULL with an exception means an error occurred.
425
+
426
+ Prefer PyIter_NextItem() instead. */
427
+ PyAPI_FUNC(PyObject *) PyIter_Next(PyObject *);
428
+
429
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000
430
+
431
+ /* Takes generator, coroutine or iterator object and sends the value into it.
432
+ Returns:
433
+ - PYGEN_RETURN (0) if generator has returned.
434
+ 'result' parameter is filled with return value
435
+ - PYGEN_ERROR (-1) if exception was raised.
436
+ 'result' parameter is NULL
437
+ - PYGEN_NEXT (1) if generator has yielded.
438
+ 'result' parameter is filled with yielded value. */
439
+ PyAPI_FUNC(PySendResult) PyIter_Send(PyObject *, PyObject *, PyObject **);
440
+ #endif
441
+
442
+
443
+ /* === Number Protocol ================================================== */
444
+
445
+ /* Returns 1 if the object 'o' provides numeric protocols, and 0 otherwise.
446
+
447
+ This function always succeeds. */
448
+ PyAPI_FUNC(int) PyNumber_Check(PyObject *o);
449
+
450
+ /* Returns the result of adding o1 and o2, or NULL on failure.
451
+
452
+ This is the equivalent of the Python expression: o1 + o2. */
453
+ PyAPI_FUNC(PyObject *) PyNumber_Add(PyObject *o1, PyObject *o2);
454
+
455
+ /* Returns the result of subtracting o2 from o1, or NULL on failure.
456
+
457
+ This is the equivalent of the Python expression: o1 - o2. */
458
+ PyAPI_FUNC(PyObject *) PyNumber_Subtract(PyObject *o1, PyObject *o2);
459
+
460
+ /* Returns the result of multiplying o1 and o2, or NULL on failure.
461
+
462
+ This is the equivalent of the Python expression: o1 * o2. */
463
+ PyAPI_FUNC(PyObject *) PyNumber_Multiply(PyObject *o1, PyObject *o2);
464
+
465
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
466
+ /* This is the equivalent of the Python expression: o1 @ o2. */
467
+ PyAPI_FUNC(PyObject *) PyNumber_MatrixMultiply(PyObject *o1, PyObject *o2);
468
+ #endif
469
+
470
+ /* Returns the result of dividing o1 by o2 giving an integral result,
471
+ or NULL on failure.
472
+
473
+ This is the equivalent of the Python expression: o1 // o2. */
474
+ PyAPI_FUNC(PyObject *) PyNumber_FloorDivide(PyObject *o1, PyObject *o2);
475
+
476
+ /* Returns the result of dividing o1 by o2 giving a float result, or NULL on
477
+ failure.
478
+
479
+ This is the equivalent of the Python expression: o1 / o2. */
480
+ PyAPI_FUNC(PyObject *) PyNumber_TrueDivide(PyObject *o1, PyObject *o2);
481
+
482
+ /* Returns the remainder of dividing o1 by o2, or NULL on failure.
483
+
484
+ This is the equivalent of the Python expression: o1 % o2. */
485
+ PyAPI_FUNC(PyObject *) PyNumber_Remainder(PyObject *o1, PyObject *o2);
486
+
487
+ /* See the built-in function divmod.
488
+
489
+ Returns NULL on failure.
490
+
491
+ This is the equivalent of the Python expression: divmod(o1, o2). */
492
+ PyAPI_FUNC(PyObject *) PyNumber_Divmod(PyObject *o1, PyObject *o2);
493
+
494
+ /* See the built-in function pow. Returns NULL on failure.
495
+
496
+ This is the equivalent of the Python expression: pow(o1, o2, o3),
497
+ where o3 is optional. */
498
+ PyAPI_FUNC(PyObject *) PyNumber_Power(PyObject *o1, PyObject *o2,
499
+ PyObject *o3);
500
+
501
+ /* Returns the negation of o on success, or NULL on failure.
502
+
503
+ This is the equivalent of the Python expression: -o. */
504
+ PyAPI_FUNC(PyObject *) PyNumber_Negative(PyObject *o);
505
+
506
+ /* Returns the positive of o on success, or NULL on failure.
507
+
508
+ This is the equivalent of the Python expression: +o. */
509
+ PyAPI_FUNC(PyObject *) PyNumber_Positive(PyObject *o);
510
+
511
+ /* Returns the absolute value of 'o', or NULL on failure.
512
+
513
+ This is the equivalent of the Python expression: abs(o). */
514
+ PyAPI_FUNC(PyObject *) PyNumber_Absolute(PyObject *o);
515
+
516
+ /* Returns the bitwise negation of 'o' on success, or NULL on failure.
517
+
518
+ This is the equivalent of the Python expression: ~o. */
519
+ PyAPI_FUNC(PyObject *) PyNumber_Invert(PyObject *o);
520
+
521
+ /* Returns the result of left shifting o1 by o2 on success, or NULL on failure.
522
+
523
+ This is the equivalent of the Python expression: o1 << o2. */
524
+ PyAPI_FUNC(PyObject *) PyNumber_Lshift(PyObject *o1, PyObject *o2);
525
+
526
+ /* Returns the result of right shifting o1 by o2 on success, or NULL on
527
+ failure.
528
+
529
+ This is the equivalent of the Python expression: o1 >> o2. */
530
+ PyAPI_FUNC(PyObject *) PyNumber_Rshift(PyObject *o1, PyObject *o2);
531
+
532
+ /* Returns the result of bitwise and of o1 and o2 on success, or NULL on
533
+ failure.
534
+
535
+ This is the equivalent of the Python expression: o1 & o2. */
536
+ PyAPI_FUNC(PyObject *) PyNumber_And(PyObject *o1, PyObject *o2);
537
+
538
+ /* Returns the bitwise exclusive or of o1 by o2 on success, or NULL on failure.
539
+
540
+ This is the equivalent of the Python expression: o1 ^ o2. */
541
+ PyAPI_FUNC(PyObject *) PyNumber_Xor(PyObject *o1, PyObject *o2);
542
+
543
+ /* Returns the result of bitwise or on o1 and o2 on success, or NULL on
544
+ failure.
545
+
546
+ This is the equivalent of the Python expression: o1 | o2. */
547
+ PyAPI_FUNC(PyObject *) PyNumber_Or(PyObject *o1, PyObject *o2);
548
+
549
+ /* Returns 1 if obj is an index integer (has the nb_index slot of the
550
+ tp_as_number structure filled in), and 0 otherwise. */
551
+ PyAPI_FUNC(int) PyIndex_Check(PyObject *);
552
+
553
+ /* Returns the object 'o' converted to a Python int, or NULL with an exception
554
+ raised on failure. */
555
+ PyAPI_FUNC(PyObject *) PyNumber_Index(PyObject *o);
556
+
557
+ /* Returns the object 'o' converted to Py_ssize_t by going through
558
+ PyNumber_Index() first.
559
+
560
+ If an overflow error occurs while converting the int to Py_ssize_t, then the
561
+ second argument 'exc' is the error-type to return. If it is NULL, then the
562
+ overflow error is cleared and the value is clipped. */
563
+ PyAPI_FUNC(Py_ssize_t) PyNumber_AsSsize_t(PyObject *o, PyObject *exc);
564
+
565
+ /* Returns the object 'o' converted to an integer object on success, or NULL
566
+ on failure.
567
+
568
+ This is the equivalent of the Python expression: int(o). */
569
+ PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o);
570
+
571
+ /* Returns the object 'o' converted to a float object on success, or NULL
572
+ on failure.
573
+
574
+ This is the equivalent of the Python expression: float(o). */
575
+ PyAPI_FUNC(PyObject *) PyNumber_Float(PyObject *o);
576
+
577
+
578
+ /* --- In-place variants of (some of) the above number protocol functions -- */
579
+
580
+ /* Returns the result of adding o2 to o1, possibly in-place, or NULL
581
+ on failure.
582
+
583
+ This is the equivalent of the Python expression: o1 += o2. */
584
+ PyAPI_FUNC(PyObject *) PyNumber_InPlaceAdd(PyObject *o1, PyObject *o2);
585
+
586
+ /* Returns the result of subtracting o2 from o1, possibly in-place or
587
+ NULL on failure.
588
+
589
+ This is the equivalent of the Python expression: o1 -= o2. */
590
+ PyAPI_FUNC(PyObject *) PyNumber_InPlaceSubtract(PyObject *o1, PyObject *o2);
591
+
592
+ /* Returns the result of multiplying o1 by o2, possibly in-place, or NULL on
593
+ failure.
594
+
595
+ This is the equivalent of the Python expression: o1 *= o2. */
596
+ PyAPI_FUNC(PyObject *) PyNumber_InPlaceMultiply(PyObject *o1, PyObject *o2);
597
+
598
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
599
+ /* This is the equivalent of the Python expression: o1 @= o2. */
600
+ PyAPI_FUNC(PyObject *) PyNumber_InPlaceMatrixMultiply(PyObject *o1, PyObject *o2);
601
+ #endif
602
+
603
+ /* Returns the result of dividing o1 by o2 giving an integral result, possibly
604
+ in-place, or NULL on failure.
605
+
606
+ This is the equivalent of the Python expression: o1 /= o2. */
607
+ PyAPI_FUNC(PyObject *) PyNumber_InPlaceFloorDivide(PyObject *o1,
608
+ PyObject *o2);
609
+
610
+ /* Returns the result of dividing o1 by o2 giving a float result, possibly
611
+ in-place, or null on failure.
612
+
613
+ This is the equivalent of the Python expression: o1 /= o2. */
614
+ PyAPI_FUNC(PyObject *) PyNumber_InPlaceTrueDivide(PyObject *o1,
615
+ PyObject *o2);
616
+
617
+ /* Returns the remainder of dividing o1 by o2, possibly in-place, or NULL on
618
+ failure.
619
+
620
+ This is the equivalent of the Python expression: o1 %= o2. */
621
+ PyAPI_FUNC(PyObject *) PyNumber_InPlaceRemainder(PyObject *o1, PyObject *o2);
622
+
623
+ /* Returns the result of raising o1 to the power of o2, possibly in-place,
624
+ or NULL on failure.
625
+
626
+ This is the equivalent of the Python expression: o1 **= o2,
627
+ or o1 = pow(o1, o2, o3) if o3 is present. */
628
+ PyAPI_FUNC(PyObject *) PyNumber_InPlacePower(PyObject *o1, PyObject *o2,
629
+ PyObject *o3);
630
+
631
+ /* Returns the result of left shifting o1 by o2, possibly in-place, or NULL
632
+ on failure.
633
+
634
+ This is the equivalent of the Python expression: o1 <<= o2. */
635
+ PyAPI_FUNC(PyObject *) PyNumber_InPlaceLshift(PyObject *o1, PyObject *o2);
636
+
637
+ /* Returns the result of right shifting o1 by o2, possibly in-place or NULL
638
+ on failure.
639
+
640
+ This is the equivalent of the Python expression: o1 >>= o2. */
641
+ PyAPI_FUNC(PyObject *) PyNumber_InPlaceRshift(PyObject *o1, PyObject *o2);
642
+
643
+ /* Returns the result of bitwise and of o1 and o2, possibly in-place, or NULL
644
+ on failure.
645
+
646
+ This is the equivalent of the Python expression: o1 &= o2. */
647
+ PyAPI_FUNC(PyObject *) PyNumber_InPlaceAnd(PyObject *o1, PyObject *o2);
648
+
649
+ /* Returns the bitwise exclusive or of o1 by o2, possibly in-place, or NULL
650
+ on failure.
651
+
652
+ This is the equivalent of the Python expression: o1 ^= o2. */
653
+ PyAPI_FUNC(PyObject *) PyNumber_InPlaceXor(PyObject *o1, PyObject *o2);
654
+
655
+ /* Returns the result of bitwise or of o1 and o2, possibly in-place,
656
+ or NULL on failure.
657
+
658
+ This is the equivalent of the Python expression: o1 |= o2. */
659
+ PyAPI_FUNC(PyObject *) PyNumber_InPlaceOr(PyObject *o1, PyObject *o2);
660
+
661
+ /* Returns the integer n converted to a string with a base, with a base
662
+ marker of 0b, 0o or 0x prefixed if applicable.
663
+
664
+ If n is not an int object, it is converted with PyNumber_Index first. */
665
+ PyAPI_FUNC(PyObject *) PyNumber_ToBase(PyObject *n, int base);
666
+
667
+
668
+ /* === Sequence protocol ================================================ */
669
+
670
+ /* Return 1 if the object provides sequence protocol, and zero
671
+ otherwise.
672
+
673
+ This function always succeeds. */
674
+ PyAPI_FUNC(int) PySequence_Check(PyObject *o);
675
+
676
+ /* Return the size of sequence object o, or -1 on failure. */
677
+ PyAPI_FUNC(Py_ssize_t) PySequence_Size(PyObject *o);
678
+
679
+ /* For DLL compatibility */
680
+ #undef PySequence_Length
681
+ PyAPI_FUNC(Py_ssize_t) PySequence_Length(PyObject *o);
682
+ #define PySequence_Length PySequence_Size
683
+
684
+
685
+ /* Return the concatenation of o1 and o2 on success, and NULL on failure.
686
+
687
+ This is the equivalent of the Python expression: o1 + o2. */
688
+ PyAPI_FUNC(PyObject *) PySequence_Concat(PyObject *o1, PyObject *o2);
689
+
690
+ /* Return the result of repeating sequence object 'o' 'count' times,
691
+ or NULL on failure.
692
+
693
+ This is the equivalent of the Python expression: o * count. */
694
+ PyAPI_FUNC(PyObject *) PySequence_Repeat(PyObject *o, Py_ssize_t count);
695
+
696
+ /* Return the ith element of o, or NULL on failure.
697
+
698
+ This is the equivalent of the Python expression: o[i]. */
699
+ PyAPI_FUNC(PyObject *) PySequence_GetItem(PyObject *o, Py_ssize_t i);
700
+
701
+ /* Return the slice of sequence object o between i1 and i2, or NULL on failure.
702
+
703
+ This is the equivalent of the Python expression: o[i1:i2]. */
704
+ PyAPI_FUNC(PyObject *) PySequence_GetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2);
705
+
706
+ /* Assign object 'v' to the ith element of the sequence 'o'. Raise an exception
707
+ and return -1 on failure; return 0 on success.
708
+
709
+ This is the equivalent of the Python statement o[i] = v. */
710
+ PyAPI_FUNC(int) PySequence_SetItem(PyObject *o, Py_ssize_t i, PyObject *v);
711
+
712
+ /* Delete the 'i'-th element of the sequence 'v'. Returns -1 on failure.
713
+
714
+ This is the equivalent of the Python statement: del o[i]. */
715
+ PyAPI_FUNC(int) PySequence_DelItem(PyObject *o, Py_ssize_t i);
716
+
717
+ /* Assign the sequence object 'v' to the slice in sequence object 'o',
718
+ from 'i1' to 'i2'. Returns -1 on failure.
719
+
720
+ This is the equivalent of the Python statement: o[i1:i2] = v. */
721
+ PyAPI_FUNC(int) PySequence_SetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2,
722
+ PyObject *v);
723
+
724
+ /* Delete the slice in sequence object 'o' from 'i1' to 'i2'.
725
+ Returns -1 on failure.
726
+
727
+ This is the equivalent of the Python statement: del o[i1:i2]. */
728
+ PyAPI_FUNC(int) PySequence_DelSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2);
729
+
730
+ /* Returns the sequence 'o' as a tuple on success, and NULL on failure.
731
+
732
+ This is equivalent to the Python expression: tuple(o). */
733
+ PyAPI_FUNC(PyObject *) PySequence_Tuple(PyObject *o);
734
+
735
+ /* Returns the sequence 'o' as a list on success, and NULL on failure.
736
+ This is equivalent to the Python expression: list(o) */
737
+ PyAPI_FUNC(PyObject *) PySequence_List(PyObject *o);
738
+
739
+ /* Return the sequence 'o' as a list, unless it's already a tuple or list.
740
+
741
+ Use PySequence_Fast_GET_ITEM to access the members of this list, and
742
+ PySequence_Fast_GET_SIZE to get its length.
743
+
744
+ Returns NULL on failure. If the object does not support iteration, raises a
745
+ TypeError exception with 'm' as the message text. */
746
+ PyAPI_FUNC(PyObject *) PySequence_Fast(PyObject *o, const char* m);
747
+
748
+ /* Return the number of occurrences on value on 'o', that is, return
749
+ the number of keys for which o[key] == value.
750
+
751
+ On failure, return -1. This is equivalent to the Python expression:
752
+ o.count(value). */
753
+ PyAPI_FUNC(Py_ssize_t) PySequence_Count(PyObject *o, PyObject *value);
754
+
755
+ /* Return 1 if 'ob' is in the sequence 'seq'; 0 if 'ob' is not in the sequence
756
+ 'seq'; -1 on error.
757
+
758
+ Use __contains__ if possible, else _PySequence_IterSearch(). */
759
+ PyAPI_FUNC(int) PySequence_Contains(PyObject *seq, PyObject *ob);
760
+
761
+ /* For DLL-level backwards compatibility */
762
+ #undef PySequence_In
763
+ /* Determine if the sequence 'o' contains 'value'. If an item in 'o' is equal
764
+ to 'value', return 1, otherwise return 0. On error, return -1.
765
+
766
+ This is equivalent to the Python expression: value in o. */
767
+ PyAPI_FUNC(int) PySequence_In(PyObject *o, PyObject *value);
768
+
769
+ /* For source-level backwards compatibility */
770
+ #define PySequence_In PySequence_Contains
771
+
772
+
773
+ /* Return the first index for which o[i] == value.
774
+ On error, return -1.
775
+
776
+ This is equivalent to the Python expression: o.index(value). */
777
+ PyAPI_FUNC(Py_ssize_t) PySequence_Index(PyObject *o, PyObject *value);
778
+
779
+
780
+ /* --- In-place versions of some of the above Sequence functions --- */
781
+
782
+ /* Append sequence 'o2' to sequence 'o1', in-place when possible. Return the
783
+ resulting object, which could be 'o1', or NULL on failure.
784
+
785
+ This is the equivalent of the Python expression: o1 += o2. */
786
+ PyAPI_FUNC(PyObject *) PySequence_InPlaceConcat(PyObject *o1, PyObject *o2);
787
+
788
+ /* Repeat sequence 'o' by 'count', in-place when possible. Return the resulting
789
+ object, which could be 'o', or NULL on failure.
790
+
791
+ This is the equivalent of the Python expression: o1 *= count. */
792
+ PyAPI_FUNC(PyObject *) PySequence_InPlaceRepeat(PyObject *o, Py_ssize_t count);
793
+
794
+
795
+ /* === Mapping protocol ================================================= */
796
+
797
+ /* Return 1 if the object provides mapping protocol, and 0 otherwise.
798
+
799
+ This function always succeeds. */
800
+ PyAPI_FUNC(int) PyMapping_Check(PyObject *o);
801
+
802
+ /* Returns the number of keys in mapping object 'o' on success, and -1 on
803
+ failure. This is equivalent to the Python expression: len(o). */
804
+ PyAPI_FUNC(Py_ssize_t) PyMapping_Size(PyObject *o);
805
+
806
+ /* For DLL compatibility */
807
+ #undef PyMapping_Length
808
+ PyAPI_FUNC(Py_ssize_t) PyMapping_Length(PyObject *o);
809
+ #define PyMapping_Length PyMapping_Size
810
+
811
+
812
+ /* Implemented as a macro:
813
+
814
+ int PyMapping_DelItemString(PyObject *o, const char *key);
815
+
816
+ Remove the mapping for the string 'key' from the mapping 'o'. Returns -1 on
817
+ failure.
818
+
819
+ This is equivalent to the Python statement: del o[key]. */
820
+ #define PyMapping_DelItemString(O, K) PyObject_DelItemString((O), (K))
821
+
822
+ /* Implemented as a macro:
823
+
824
+ int PyMapping_DelItem(PyObject *o, PyObject *key);
825
+
826
+ Remove the mapping for the object 'key' from the mapping object 'o'.
827
+ Returns -1 on failure.
828
+
829
+ This is equivalent to the Python statement: del o[key]. */
830
+ #define PyMapping_DelItem(O, K) PyObject_DelItem((O), (K))
831
+
832
+ /* On success, return 1 if the mapping object 'o' has the key 'key',
833
+ and 0 otherwise.
834
+
835
+ This is equivalent to the Python expression: key in o.
836
+
837
+ This function always succeeds. */
838
+ PyAPI_FUNC(int) PyMapping_HasKeyString(PyObject *o, const char *key);
839
+
840
+ /* Return 1 if the mapping object has the key 'key', and 0 otherwise.
841
+
842
+ This is equivalent to the Python expression: key in o.
843
+
844
+ This function always succeeds. */
845
+ PyAPI_FUNC(int) PyMapping_HasKey(PyObject *o, PyObject *key);
846
+
847
+ /* Return 1 if the mapping object has the key 'key', and 0 otherwise.
848
+ This is equivalent to the Python expression: key in o.
849
+ On failure, return -1. */
850
+
851
+ PyAPI_FUNC(int) PyMapping_HasKeyWithError(PyObject *o, PyObject *key);
852
+
853
+ /* Return 1 if the mapping object has the key 'key', and 0 otherwise.
854
+ This is equivalent to the Python expression: key in o.
855
+ On failure, return -1. */
856
+
857
+ PyAPI_FUNC(int) PyMapping_HasKeyStringWithError(PyObject *o, const char *key);
858
+
859
+ /* On success, return a list of the keys in mapping object 'o'.
860
+ On failure, return NULL. */
861
+ PyAPI_FUNC(PyObject *) PyMapping_Keys(PyObject *o);
862
+
863
+ /* On success, return a list of the values in mapping object 'o'.
864
+ On failure, return NULL. */
865
+ PyAPI_FUNC(PyObject *) PyMapping_Values(PyObject *o);
866
+
867
+ /* On success, return a list of the items in mapping object 'o',
868
+ where each item is a tuple containing a key-value pair. On failure, return
869
+ NULL. */
870
+ PyAPI_FUNC(PyObject *) PyMapping_Items(PyObject *o);
871
+
872
+ /* Return element of 'o' corresponding to the string 'key' or NULL on failure.
873
+
874
+ This is the equivalent of the Python expression: o[key]. */
875
+ PyAPI_FUNC(PyObject *) PyMapping_GetItemString(PyObject *o,
876
+ const char *key);
877
+
878
+ /* Variants of PyObject_GetItem() and PyMapping_GetItemString() which don't
879
+ raise KeyError if the key is not found.
880
+
881
+ If the key is found, return 1 and set *result to a new strong
882
+ reference to the corresponding value.
883
+ If the key is not found, return 0 and set *result to NULL;
884
+ the KeyError is silenced.
885
+ If an error other than KeyError is raised, return -1 and
886
+ set *result to NULL.
887
+ */
888
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000
889
+ PyAPI_FUNC(int) PyMapping_GetOptionalItem(PyObject *, PyObject *, PyObject **);
890
+ PyAPI_FUNC(int) PyMapping_GetOptionalItemString(PyObject *, const char *, PyObject **);
891
+ #endif
892
+
893
+ /* Map the string 'key' to the value 'v' in the mapping 'o'.
894
+ Returns -1 on failure.
895
+
896
+ This is the equivalent of the Python statement: o[key]=v. */
897
+ PyAPI_FUNC(int) PyMapping_SetItemString(PyObject *o, const char *key,
898
+ PyObject *value);
899
+
900
+ /* isinstance(object, typeorclass) */
901
+ PyAPI_FUNC(int) PyObject_IsInstance(PyObject *object, PyObject *typeorclass);
902
+
903
+ /* issubclass(object, typeorclass) */
904
+ PyAPI_FUNC(int) PyObject_IsSubclass(PyObject *object, PyObject *typeorclass);
905
+
906
+ #ifndef Py_LIMITED_API
907
+ # define Py_CPYTHON_ABSTRACTOBJECT_H
908
+ # include "cpython/abstract.h"
909
+ # undef Py_CPYTHON_ABSTRACTOBJECT_H
910
+ #endif
911
+
912
+ #ifdef __cplusplus
913
+ }
914
+ #endif
915
+ #endif /* Py_ABSTRACTOBJECT_H */