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.
- pytron/__init__.py +112 -0
- pytron/application.py +562 -0
- pytron/apputils/__init__.py +0 -0
- pytron/apputils/chrome_ipc.py +203 -0
- pytron/apputils/codegen.py +261 -0
- pytron/apputils/config.py +303 -0
- pytron/apputils/deadmansswitch.py +47 -0
- pytron/apputils/extras.py +76 -0
- pytron/apputils/native.py +148 -0
- pytron/apputils/shell.py +73 -0
- pytron/apputils/windows.py +286 -0
- pytron/cli.py +384 -0
- pytron/commands/__init__.py +0 -0
- pytron/commands/android.py +28 -0
- pytron/commands/build.py +26 -0
- pytron/commands/doctor.py +221 -0
- pytron/commands/engine.py +23 -0
- pytron/commands/frontend.py +60 -0
- pytron/commands/harvest.py +112 -0
- pytron/commands/helpers.py +239 -0
- pytron/commands/info.py +50 -0
- pytron/commands/init.py +521 -0
- pytron/commands/install.py +294 -0
- pytron/commands/login.py +130 -0
- pytron/commands/package.py +228 -0
- pytron/commands/plugin.py +442 -0
- pytron/commands/run.py +312 -0
- pytron/commands/scan.py +210 -0
- pytron/commands/show.py +23 -0
- pytron/commands/uninstall.py +150 -0
- pytron/commands/utils.py +42 -0
- pytron/commands/workflow.py +95 -0
- pytron/console.py +133 -0
- pytron/core.py +18 -0
- pytron/dependencies/WebView2Loader.dll +0 -0
- pytron/dependencies/__init__.py +1 -0
- pytron/dependencies/pytron_native.so +0 -0
- pytron/engines/chrome/adapter.py +445 -0
- pytron/engines/chrome/engine.py +576 -0
- pytron/engines/chrome/forge.py +147 -0
- pytron/engines/chrome/shell/package.json +8 -0
- pytron/engines/chrome/shell/preload.js +12 -0
- pytron/engines/chrome/shell/shell.js +534 -0
- pytron/exceptions.py +36 -0
- pytron/inspector.py +201 -0
- pytron/inspector_ui.py +512 -0
- pytron/installer/Installation.nsi +236 -0
- pytron/installer/header.bmp +0 -0
- pytron/installer/pytron.ico +0 -0
- pytron/installer/sidebar.bmp +0 -0
- pytron/llms.md +98 -0
- pytron/manifests/README.md +29 -0
- pytron/manifests/windows-utf8.manifest +44 -0
- pytron/menu.py +128 -0
- pytron/nsis-setup.exe +0 -0
- pytron/pack/__init__.py +0 -0
- pytron/pack/assets.py +131 -0
- pytron/pack/compilers.py +289 -0
- pytron/pack/crystal.py +297 -0
- pytron/pack/graph.py +377 -0
- pytron/pack/inference.py +157 -0
- pytron/pack/installers.py +402 -0
- pytron/pack/introspect.py +357 -0
- pytron/pack/metadata.py +213 -0
- pytron/pack/modules.py +618 -0
- pytron/pack/nuitka.py +108 -0
- pytron/pack/pipeline.py +107 -0
- pytron/pack/pyinstaller.py +176 -0
- pytron/pack/rust_engine.py +273 -0
- pytron/pack/secure.py +309 -0
- pytron/pack/secure_loader/bin/pytron_rust_bootloader +0 -0
- pytron/pack/secure_loader/icon.ico +0 -0
- pytron/pack/utils.py +110 -0
- pytron/pack/virtual_root.py +124 -0
- pytron/platforms/__init__.py +0 -0
- pytron/platforms/android/__init__.py +3 -0
- pytron/platforms/android/android.py +103 -0
- pytron/platforms/android/builder.py +736 -0
- pytron/platforms/android/ops/build.py +79 -0
- pytron/platforms/android/ops/init.py +63 -0
- pytron/platforms/android/ops/run.py +79 -0
- pytron/platforms/android/ops/sync.py +770 -0
- pytron/platforms/android/ops/utils.py +8 -0
- pytron/platforms/android/shell/README.md +30 -0
- pytron/platforms/android/shell/app/build.gradle +64 -0
- pytron/platforms/android/shell/app/src/main/AndroidManifest.xml +29 -0
- pytron/platforms/android/shell/app/src/main/assets/python/main.py +86 -0
- pytron/platforms/android/shell/app/src/main/assets/python/python314.zip +0 -0
- pytron/platforms/android/shell/app/src/main/cpp/CMakeLists.txt +25 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/Python.h +155 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/abstract.h +915 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/audit.h +30 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/bltinmodule.h +14 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/boolobject.h +54 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/bytearrayobject.h +44 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/bytesobject.h +66 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/ceval.h +145 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/codecs.h +176 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/compile.h +22 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/complexobject.h +30 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/abstract.h +104 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/audit.h +8 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/bytearrayobject.h +38 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/bytesobject.h +42 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/cellobject.h +50 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/ceval.h +43 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/classobject.h +71 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/code.h +340 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/compile.h +50 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/complexobject.h +33 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/context.h +107 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/critical_section.h +154 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/descrobject.h +62 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/dictobject.h +105 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/fileobject.h +16 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/fileutils.h +16 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/floatobject.h +27 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/frameobject.h +35 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/funcobject.h +185 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/genobject.h +56 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/import.h +30 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/initconfig.h +334 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/listobject.h +53 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/lock.h +74 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/longintrepr.h +184 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/longobject.h +89 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/memoryobject.h +50 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/methodobject.h +66 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/modsupport.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/monitoring.h +269 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/object.h +493 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/objimpl.h +104 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/odictobject.h +43 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/picklebufobject.h +31 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pthread_stubs.h +105 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic.h +614 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic_gcc.h +615 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic_msc.h +1197 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic_std.h +1112 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyctype.h +39 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pydebug.h +38 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyerrors.h +132 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyfpe.h +15 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyframe.h +45 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyhash.h +54 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pylifecycle.h +89 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pymem.h +84 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pystate.h +275 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pystats.h +194 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pythonrun.h +96 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pythread.h +43 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pytime.h +27 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/setobject.h +71 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/traceback.h +13 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/tracemalloc.h +32 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/tupleobject.h +40 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/unicodeobject.h +773 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/warnings.h +20 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/weakrefobject.h +66 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/critical_section.h +16 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/datetime.h +267 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/descrobject.h +100 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/dictobject.h +108 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/dynamic_annotations.h +499 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/enumobject.h +17 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/errcode.h +45 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/exports.h +105 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/fileobject.h +41 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/fileutils.h +62 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/floatobject.h +54 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/frameobject.h +20 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/genericaliasobject.h +14 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/import.h +103 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/atomic.h +392 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/internal.h +969 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/prim.h +329 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/track.h +147 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/types.h +721 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc.h +565 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_abstract.h +61 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_asdl.h +112 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ast.h +945 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ast_state.h +271 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_atexit.h +31 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_audit.h +35 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_backoff.h +133 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_bitutils.h +186 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_blocks_output_buffer.h +321 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_brc.h +73 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_bytes_methods.h +82 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_bytesobject.h +149 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_c_array.h +39 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_call.h +206 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_capsule.h +17 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_cell.h +75 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ceval.h +390 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ceval_state.h +48 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_code.h +671 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_codecs.h +76 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_compile.h +230 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_complexobject.h +34 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_condvar.h +93 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_context.h +59 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_critical_section.h +237 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_crossinterp.h +406 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_crossinterp_data_registry.h +41 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_debug_offsets.h +379 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_descrobject.h +28 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_dict.h +410 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_dict_state.h +28 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_dtoa.h +40 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_emscripten_signal.h +30 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_emscripten_trampoline.h +70 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_exceptions.h +40 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_faulthandler.h +100 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_fileutils.h +320 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_fileutils_windows.h +98 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_floatobject.h +49 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_flowgraph.h +47 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_format.h +27 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_frame.h +61 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_freelist.h +111 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_freelist_state.h +70 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_function.h +53 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_gc.h +378 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_genobject.h +43 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_getopt.h +22 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_gil.h +66 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_global_objects.h +34 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_global_objects_fini_generated.h +1592 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_global_strings.h +854 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_hamt.h +113 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_hashtable.h +150 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_import.h +141 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_importdl.h +139 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_index_pool.h +36 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_initconfig.h +197 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_instruction_sequence.h +83 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_instruments.h +127 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interp.h +109 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interp_structs.h +977 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interpframe.h +401 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interpframe_structs.h +95 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interpolation.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_intrinsics.h +51 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_jit.h +29 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_list.h +81 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_llist.h +106 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_lock.h +236 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_long.h +319 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_magic_number.h +305 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_memoryobject.h +20 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_mimalloc.h +69 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_modsupport.h +99 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_moduleobject.h +62 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_namespace.h +21 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object.h +1029 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_alloc.h +71 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_deferred.h +32 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_stack.h +95 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_state.h +49 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_obmalloc.h +702 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_obmalloc_init.h +66 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_opcode_metadata.h +2117 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_opcode_utils.h +90 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_optimizer.h +318 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_parking_lot.h +97 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_parser.h +78 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pathconfig.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyarena.h +68 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyatomic_ft_wrappers.h +174 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pybuffer.h +21 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyerrors.h +213 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyhash.h +91 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pylifecycle.h +136 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pymath.h +205 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pymem.h +145 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pymem_init.h +103 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pystate.h +339 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pystats.h +21 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pythonrun.h +68 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pythread.h +172 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_qsbr.h +172 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_range.h +21 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime.h +63 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime_init.h +239 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime_init_generated.h +1589 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime_structs.h +310 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_semaphore.h +67 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_setobject.h +41 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_signal.h +108 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_sliceobject.h +20 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_stackref.h +791 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_stats.h +97 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_strhex.h +39 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_structs.h +88 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_structseq.h +40 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_symtable.h +201 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_sysmodule.h +32 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_template.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_time.h +334 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_token.h +110 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_traceback.h +111 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_tracemalloc.h +164 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_tstate.h +88 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_tuple.h +75 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_typedefs.h +18 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_typeobject.h +155 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_typevarobject.h +28 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ucnhash.h +36 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_unicodeobject.h +308 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_unicodeobject_generated.h +3132 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_unionobject.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_uniqueid.h +57 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_uop_ids.h +335 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_uop_metadata.h +1204 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_warnings.h +21 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_weakref.h +133 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/intrcheck.h +23 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/iterobject.h +24 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/listobject.h +55 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/lock.h +16 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/longobject.h +178 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/marshal.h +31 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/memoryobject.h +34 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/methodobject.h +146 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/modsupport.h +146 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/moduleobject.h +122 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/monitoring.h +18 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/object.h +828 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/objimpl.h +211 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/opcode.h +43 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/opcode_ids.h +259 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/osdefs.h +57 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/osmodule.h +17 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/patchlevel.h +49 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/py_curses.h +117 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyatomic.h +16 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pybuffer.h +145 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pycapsule.h +58 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyconfig.h +2088 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pydtrace.h +59 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyerrors.h +335 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyexpat.h +62 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyframe.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyhash.h +59 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pylifecycle.h +80 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pymacconfig.h +91 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pymacro.h +243 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pymath.h +65 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pymem.h +110 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyport.h +710 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pystate.h +132 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pystats.h +28 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pystrcmp.h +23 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pystrtod.h +37 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pythonrun.h +42 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pythread.h +131 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pytypedefs.h +30 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/rangeobject.h +27 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/refcount.h +555 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/setobject.h +49 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/sliceobject.h +69 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/structmember.h +56 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/structseq.h +46 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/sysmodule.h +27 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/traceback.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/tupleobject.h +46 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/typeslots.h +96 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/unicodeobject.h +1029 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/warnings.h +45 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/weakrefobject.h +46 -0
- pytron/platforms/android/shell/app/src/main/cpp/pytron_bridge.cpp +224 -0
- pytron/platforms/android/shell/app/src/main/java/com/pytron/shell/MainActivity.kt +208 -0
- pytron/platforms/android/shell/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- pytron/platforms/android/shell/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- pytron/platforms/android/shell/build.gradle +11 -0
- pytron/platforms/android/shell/gradle/wrapper/gradle-wrapper.jar +0 -0
- pytron/platforms/android/shell/gradle/wrapper/gradle-wrapper.properties +5 -0
- pytron/platforms/android/shell/gradle.properties +2 -0
- pytron/platforms/android/shell/gradlew.bat +85 -0
- pytron/platforms/android/shell/settings.gradle +16 -0
- pytron/platforms/darwin.py +82 -0
- pytron/platforms/darwin_ops/libs.py +31 -0
- pytron/platforms/darwin_ops/system.py +182 -0
- pytron/platforms/darwin_ops/utils.py +85 -0
- pytron/platforms/darwin_ops/webview.py +5 -0
- pytron/platforms/darwin_ops/window.py +102 -0
- pytron/platforms/interface.py +152 -0
- pytron/platforms/linux.py +82 -0
- pytron/platforms/linux_ops/libs.py +49 -0
- pytron/platforms/linux_ops/system.py +316 -0
- pytron/platforms/linux_ops/utils.py +19 -0
- pytron/platforms/linux_ops/webview.py +5 -0
- pytron/platforms/linux_ops/window.py +115 -0
- pytron/platforms/windows.py +136 -0
- pytron/platforms/windows_ops/__init__.py +0 -0
- pytron/platforms/windows_ops/constants.py +126 -0
- pytron/platforms/windows_ops/system.py +518 -0
- pytron/platforms/windows_ops/utils.py +3 -0
- pytron/platforms/windows_ops/webview.py +5 -0
- pytron/platforms/windows_ops/window.py +361 -0
- pytron/plugin.py +467 -0
- pytron/rcedit-x64.exe +0 -0
- pytron/router.py +146 -0
- pytron/serializer.py +240 -0
- pytron/shortcuts.py +279 -0
- pytron/state.py +76 -0
- pytron/tray.py +399 -0
- pytron/updater.py +181 -0
- pytron/utf8_hook.py +112 -0
- pytron/utils.py +44 -0
- pytron/webview.py +722 -0
- pytron_kit-0.3.12.dist-info/METADATA +131 -0
- pytron_kit-0.3.12.dist-info/RECORD +419 -0
- pytron_kit-0.3.12.dist-info/WHEEL +5 -0
- pytron_kit-0.3.12.dist-info/entry_points.txt +2 -0
- pytron_kit-0.3.12.dist-info/licenses/LICENSE +201 -0
- pytron_kit-0.3.12.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#ifndef Py_CPYTHON_BYTEARRAYOBJECT_H
|
|
2
|
+
# error "this header file must not be included directly"
|
|
3
|
+
#endif
|
|
4
|
+
|
|
5
|
+
/* Object layout */
|
|
6
|
+
typedef struct {
|
|
7
|
+
PyObject_VAR_HEAD
|
|
8
|
+
Py_ssize_t ob_alloc; /* How many bytes allocated in ob_bytes */
|
|
9
|
+
char *ob_bytes; /* Physical backing buffer */
|
|
10
|
+
char *ob_start; /* Logical start inside ob_bytes */
|
|
11
|
+
Py_ssize_t ob_exports; /* How many buffer exports */
|
|
12
|
+
} PyByteArrayObject;
|
|
13
|
+
|
|
14
|
+
PyAPI_DATA(char) _PyByteArray_empty_string[];
|
|
15
|
+
|
|
16
|
+
/* Macros and static inline functions, trading safety for speed */
|
|
17
|
+
#define _PyByteArray_CAST(op) \
|
|
18
|
+
(assert(PyByteArray_Check(op)), _Py_CAST(PyByteArrayObject*, op))
|
|
19
|
+
|
|
20
|
+
static inline char* PyByteArray_AS_STRING(PyObject *op)
|
|
21
|
+
{
|
|
22
|
+
PyByteArrayObject *self = _PyByteArray_CAST(op);
|
|
23
|
+
if (Py_SIZE(self)) {
|
|
24
|
+
return self->ob_start;
|
|
25
|
+
}
|
|
26
|
+
return _PyByteArray_empty_string;
|
|
27
|
+
}
|
|
28
|
+
#define PyByteArray_AS_STRING(self) PyByteArray_AS_STRING(_PyObject_CAST(self))
|
|
29
|
+
|
|
30
|
+
static inline Py_ssize_t PyByteArray_GET_SIZE(PyObject *op) {
|
|
31
|
+
PyByteArrayObject *self = _PyByteArray_CAST(op);
|
|
32
|
+
#ifdef Py_GIL_DISABLED
|
|
33
|
+
return _Py_atomic_load_ssize_relaxed(&(_PyVarObject_CAST(self)->ob_size));
|
|
34
|
+
#else
|
|
35
|
+
return Py_SIZE(self);
|
|
36
|
+
#endif
|
|
37
|
+
}
|
|
38
|
+
#define PyByteArray_GET_SIZE(self) PyByteArray_GET_SIZE(_PyObject_CAST(self))
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#ifndef Py_CPYTHON_BYTESOBJECT_H
|
|
2
|
+
# error "this header file must not be included directly"
|
|
3
|
+
#endif
|
|
4
|
+
|
|
5
|
+
typedef struct {
|
|
6
|
+
PyObject_VAR_HEAD
|
|
7
|
+
Py_DEPRECATED(3.11) Py_hash_t ob_shash;
|
|
8
|
+
char ob_sval[1];
|
|
9
|
+
|
|
10
|
+
/* Invariants:
|
|
11
|
+
* ob_sval contains space for 'ob_size+1' elements.
|
|
12
|
+
* ob_sval[ob_size] == 0.
|
|
13
|
+
* ob_shash is the hash of the byte string or -1 if not computed yet.
|
|
14
|
+
*/
|
|
15
|
+
} PyBytesObject;
|
|
16
|
+
|
|
17
|
+
PyAPI_FUNC(int) _PyBytes_Resize(PyObject **, Py_ssize_t);
|
|
18
|
+
|
|
19
|
+
/* Macros and static inline functions, trading safety for speed */
|
|
20
|
+
#define _PyBytes_CAST(op) \
|
|
21
|
+
(assert(PyBytes_Check(op)), _Py_CAST(PyBytesObject*, op))
|
|
22
|
+
|
|
23
|
+
static inline char* PyBytes_AS_STRING(PyObject *op)
|
|
24
|
+
{
|
|
25
|
+
return _PyBytes_CAST(op)->ob_sval;
|
|
26
|
+
}
|
|
27
|
+
#define PyBytes_AS_STRING(op) PyBytes_AS_STRING(_PyObject_CAST(op))
|
|
28
|
+
|
|
29
|
+
static inline Py_ssize_t PyBytes_GET_SIZE(PyObject *op) {
|
|
30
|
+
PyBytesObject *self = _PyBytes_CAST(op);
|
|
31
|
+
return Py_SIZE(self);
|
|
32
|
+
}
|
|
33
|
+
#define PyBytes_GET_SIZE(self) PyBytes_GET_SIZE(_PyObject_CAST(self))
|
|
34
|
+
|
|
35
|
+
PyAPI_FUNC(PyObject*) PyBytes_Join(PyObject *sep, PyObject *iterable);
|
|
36
|
+
|
|
37
|
+
// Deprecated alias kept for backward compatibility
|
|
38
|
+
Py_DEPRECATED(3.14) static inline PyObject*
|
|
39
|
+
_PyBytes_Join(PyObject *sep, PyObject *iterable)
|
|
40
|
+
{
|
|
41
|
+
return PyBytes_Join(sep, iterable);
|
|
42
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* Cell object interface */
|
|
2
|
+
|
|
3
|
+
#ifndef Py_LIMITED_API
|
|
4
|
+
#ifndef Py_CELLOBJECT_H
|
|
5
|
+
#define Py_CELLOBJECT_H
|
|
6
|
+
#ifdef __cplusplus
|
|
7
|
+
extern "C" {
|
|
8
|
+
#endif
|
|
9
|
+
|
|
10
|
+
typedef struct {
|
|
11
|
+
PyObject_HEAD
|
|
12
|
+
/* Content of the cell or NULL when empty */
|
|
13
|
+
PyObject *ob_ref;
|
|
14
|
+
} PyCellObject;
|
|
15
|
+
|
|
16
|
+
PyAPI_DATA(PyTypeObject) PyCell_Type;
|
|
17
|
+
|
|
18
|
+
#define PyCell_Check(op) Py_IS_TYPE((op), &PyCell_Type)
|
|
19
|
+
|
|
20
|
+
PyAPI_FUNC(PyObject *) PyCell_New(PyObject *);
|
|
21
|
+
PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *);
|
|
22
|
+
PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *);
|
|
23
|
+
|
|
24
|
+
static inline PyObject* PyCell_GET(PyObject *op) {
|
|
25
|
+
PyObject *res;
|
|
26
|
+
PyCellObject *cell;
|
|
27
|
+
assert(PyCell_Check(op));
|
|
28
|
+
cell = _Py_CAST(PyCellObject*, op);
|
|
29
|
+
Py_BEGIN_CRITICAL_SECTION(cell);
|
|
30
|
+
res = cell->ob_ref;
|
|
31
|
+
Py_END_CRITICAL_SECTION();
|
|
32
|
+
return res;
|
|
33
|
+
}
|
|
34
|
+
#define PyCell_GET(op) PyCell_GET(_PyObject_CAST(op))
|
|
35
|
+
|
|
36
|
+
static inline void PyCell_SET(PyObject *op, PyObject *value) {
|
|
37
|
+
PyCellObject *cell;
|
|
38
|
+
assert(PyCell_Check(op));
|
|
39
|
+
cell = _Py_CAST(PyCellObject*, op);
|
|
40
|
+
Py_BEGIN_CRITICAL_SECTION(cell);
|
|
41
|
+
cell->ob_ref = value;
|
|
42
|
+
Py_END_CRITICAL_SECTION();
|
|
43
|
+
}
|
|
44
|
+
#define PyCell_SET(op, value) PyCell_SET(_PyObject_CAST(op), (value))
|
|
45
|
+
|
|
46
|
+
#ifdef __cplusplus
|
|
47
|
+
}
|
|
48
|
+
#endif
|
|
49
|
+
#endif /* !Py_TUPLEOBJECT_H */
|
|
50
|
+
#endif /* Py_LIMITED_API */
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#ifndef Py_CPYTHON_CEVAL_H
|
|
2
|
+
# error "this header file must not be included directly"
|
|
3
|
+
#endif
|
|
4
|
+
|
|
5
|
+
PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *);
|
|
6
|
+
PyAPI_FUNC(void) PyEval_SetProfileAllThreads(Py_tracefunc, PyObject *);
|
|
7
|
+
PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *);
|
|
8
|
+
PyAPI_FUNC(void) PyEval_SetTraceAllThreads(Py_tracefunc, PyObject *);
|
|
9
|
+
|
|
10
|
+
/* Look at the current frame's (if any) code's co_flags, and turn on
|
|
11
|
+
the corresponding compiler flags in cf->cf_flags. Return 1 if any
|
|
12
|
+
flag was set, else return 0. */
|
|
13
|
+
PyAPI_FUNC(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf);
|
|
14
|
+
|
|
15
|
+
PyAPI_FUNC(PyObject *) _PyEval_EvalFrameDefault(PyThreadState *tstate, struct _PyInterpreterFrame *f, int exc);
|
|
16
|
+
|
|
17
|
+
PyAPI_FUNC(Py_ssize_t) PyUnstable_Eval_RequestCodeExtraIndex(freefunc);
|
|
18
|
+
// Old name -- remove when this API changes:
|
|
19
|
+
_Py_DEPRECATED_EXTERNALLY(3.12) static inline Py_ssize_t
|
|
20
|
+
_PyEval_RequestCodeExtraIndex(freefunc f) {
|
|
21
|
+
return PyUnstable_Eval_RequestCodeExtraIndex(f);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
PyAPI_FUNC(int) _PyEval_SliceIndex(PyObject *, Py_ssize_t *);
|
|
25
|
+
PyAPI_FUNC(int) _PyEval_SliceIndexNotNone(PyObject *, Py_ssize_t *);
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
// Trampoline API
|
|
29
|
+
|
|
30
|
+
typedef struct {
|
|
31
|
+
FILE* perf_map;
|
|
32
|
+
PyThread_type_lock map_lock;
|
|
33
|
+
} PerfMapState;
|
|
34
|
+
|
|
35
|
+
PyAPI_FUNC(int) PyUnstable_PerfMapState_Init(void);
|
|
36
|
+
PyAPI_FUNC(int) PyUnstable_WritePerfMapEntry(
|
|
37
|
+
const void *code_addr,
|
|
38
|
+
unsigned int code_size,
|
|
39
|
+
const char *entry_name);
|
|
40
|
+
PyAPI_FUNC(void) PyUnstable_PerfMapState_Fini(void);
|
|
41
|
+
PyAPI_FUNC(int) PyUnstable_CopyPerfMapFile(const char* parent_filename);
|
|
42
|
+
PyAPI_FUNC(int) PyUnstable_PerfTrampoline_CompileCode(PyCodeObject *);
|
|
43
|
+
PyAPI_FUNC(int) PyUnstable_PerfTrampoline_SetPersistAfterFork(int enable);
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/* Former class object interface -- now only bound methods are here */
|
|
2
|
+
|
|
3
|
+
/* Revealing some structures (not for general use) */
|
|
4
|
+
|
|
5
|
+
#ifndef Py_LIMITED_API
|
|
6
|
+
#ifndef Py_CLASSOBJECT_H
|
|
7
|
+
#define Py_CLASSOBJECT_H
|
|
8
|
+
#ifdef __cplusplus
|
|
9
|
+
extern "C" {
|
|
10
|
+
#endif
|
|
11
|
+
|
|
12
|
+
typedef struct {
|
|
13
|
+
PyObject_HEAD
|
|
14
|
+
PyObject *im_func; /* The callable object implementing the method */
|
|
15
|
+
PyObject *im_self; /* The instance it is bound to */
|
|
16
|
+
PyObject *im_weakreflist; /* List of weak references */
|
|
17
|
+
vectorcallfunc vectorcall;
|
|
18
|
+
} PyMethodObject;
|
|
19
|
+
|
|
20
|
+
PyAPI_DATA(PyTypeObject) PyMethod_Type;
|
|
21
|
+
|
|
22
|
+
#define PyMethod_Check(op) Py_IS_TYPE((op), &PyMethod_Type)
|
|
23
|
+
|
|
24
|
+
PyAPI_FUNC(PyObject *) PyMethod_New(PyObject *, PyObject *);
|
|
25
|
+
|
|
26
|
+
PyAPI_FUNC(PyObject *) PyMethod_Function(PyObject *);
|
|
27
|
+
PyAPI_FUNC(PyObject *) PyMethod_Self(PyObject *);
|
|
28
|
+
|
|
29
|
+
#define _PyMethod_CAST(meth) \
|
|
30
|
+
(assert(PyMethod_Check(meth)), _Py_CAST(PyMethodObject*, meth))
|
|
31
|
+
|
|
32
|
+
/* Static inline functions for direct access to these values.
|
|
33
|
+
Type checks are *not* done, so use with care. */
|
|
34
|
+
static inline PyObject* PyMethod_GET_FUNCTION(PyObject *meth) {
|
|
35
|
+
return _PyMethod_CAST(meth)->im_func;
|
|
36
|
+
}
|
|
37
|
+
#define PyMethod_GET_FUNCTION(meth) PyMethod_GET_FUNCTION(_PyObject_CAST(meth))
|
|
38
|
+
|
|
39
|
+
static inline PyObject* PyMethod_GET_SELF(PyObject *meth) {
|
|
40
|
+
return _PyMethod_CAST(meth)->im_self;
|
|
41
|
+
}
|
|
42
|
+
#define PyMethod_GET_SELF(meth) PyMethod_GET_SELF(_PyObject_CAST(meth))
|
|
43
|
+
|
|
44
|
+
typedef struct {
|
|
45
|
+
PyObject_HEAD
|
|
46
|
+
PyObject *func;
|
|
47
|
+
} PyInstanceMethodObject;
|
|
48
|
+
|
|
49
|
+
PyAPI_DATA(PyTypeObject) PyInstanceMethod_Type;
|
|
50
|
+
|
|
51
|
+
#define PyInstanceMethod_Check(op) Py_IS_TYPE((op), &PyInstanceMethod_Type)
|
|
52
|
+
|
|
53
|
+
PyAPI_FUNC(PyObject *) PyInstanceMethod_New(PyObject *);
|
|
54
|
+
PyAPI_FUNC(PyObject *) PyInstanceMethod_Function(PyObject *);
|
|
55
|
+
|
|
56
|
+
#define _PyInstanceMethod_CAST(meth) \
|
|
57
|
+
(assert(PyInstanceMethod_Check(meth)), \
|
|
58
|
+
_Py_CAST(PyInstanceMethodObject*, meth))
|
|
59
|
+
|
|
60
|
+
/* Static inline function for direct access to these values.
|
|
61
|
+
Type checks are *not* done, so use with care. */
|
|
62
|
+
static inline PyObject* PyInstanceMethod_GET_FUNCTION(PyObject *meth) {
|
|
63
|
+
return _PyInstanceMethod_CAST(meth)->func;
|
|
64
|
+
}
|
|
65
|
+
#define PyInstanceMethod_GET_FUNCTION(meth) PyInstanceMethod_GET_FUNCTION(_PyObject_CAST(meth))
|
|
66
|
+
|
|
67
|
+
#ifdef __cplusplus
|
|
68
|
+
}
|
|
69
|
+
#endif
|
|
70
|
+
#endif // !Py_CLASSOBJECT_H
|
|
71
|
+
#endif // !Py_LIMITED_API
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
/* Definitions for bytecode */
|
|
2
|
+
|
|
3
|
+
#ifndef Py_LIMITED_API
|
|
4
|
+
#ifndef Py_CODE_H
|
|
5
|
+
#define Py_CODE_H
|
|
6
|
+
|
|
7
|
+
#ifdef __cplusplus
|
|
8
|
+
extern "C" {
|
|
9
|
+
#endif
|
|
10
|
+
|
|
11
|
+
typedef struct {
|
|
12
|
+
PyObject *_co_code;
|
|
13
|
+
PyObject *_co_varnames;
|
|
14
|
+
PyObject *_co_cellvars;
|
|
15
|
+
PyObject *_co_freevars;
|
|
16
|
+
} _PyCoCached;
|
|
17
|
+
|
|
18
|
+
typedef struct {
|
|
19
|
+
int size;
|
|
20
|
+
int capacity;
|
|
21
|
+
struct _PyExecutorObject *executors[1];
|
|
22
|
+
} _PyExecutorArray;
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
#ifdef Py_GIL_DISABLED
|
|
26
|
+
|
|
27
|
+
/* Each thread specializes a thread-local copy of the bytecode in free-threaded
|
|
28
|
+
* builds. These copies are stored on the code object in a `_PyCodeArray`. The
|
|
29
|
+
* first entry in the array always points to the "main" copy of the bytecode
|
|
30
|
+
* that is stored at the end of the code object.
|
|
31
|
+
*/
|
|
32
|
+
typedef struct {
|
|
33
|
+
Py_ssize_t size;
|
|
34
|
+
char *entries[1];
|
|
35
|
+
} _PyCodeArray;
|
|
36
|
+
|
|
37
|
+
#define _PyCode_DEF_THREAD_LOCAL_BYTECODE() \
|
|
38
|
+
_PyCodeArray *co_tlbc;
|
|
39
|
+
#else
|
|
40
|
+
#define _PyCode_DEF_THREAD_LOCAL_BYTECODE()
|
|
41
|
+
#endif
|
|
42
|
+
|
|
43
|
+
// To avoid repeating ourselves in deepfreeze.py, all PyCodeObject members are
|
|
44
|
+
// defined in this macro:
|
|
45
|
+
#define _PyCode_DEF(SIZE) { \
|
|
46
|
+
PyObject_VAR_HEAD \
|
|
47
|
+
\
|
|
48
|
+
/* Note only the following fields are used in hash and/or comparisons \
|
|
49
|
+
* \
|
|
50
|
+
* - co_name \
|
|
51
|
+
* - co_argcount \
|
|
52
|
+
* - co_posonlyargcount \
|
|
53
|
+
* - co_kwonlyargcount \
|
|
54
|
+
* - co_nlocals \
|
|
55
|
+
* - co_stacksize \
|
|
56
|
+
* - co_flags \
|
|
57
|
+
* - co_firstlineno \
|
|
58
|
+
* - co_consts \
|
|
59
|
+
* - co_names \
|
|
60
|
+
* - co_localsplusnames \
|
|
61
|
+
* This is done to preserve the name and line number for tracebacks \
|
|
62
|
+
* and debuggers; otherwise, constant de-duplication would collapse \
|
|
63
|
+
* identical functions/lambdas defined on different lines. \
|
|
64
|
+
*/ \
|
|
65
|
+
\
|
|
66
|
+
/* These fields are set with provided values on new code objects. */ \
|
|
67
|
+
\
|
|
68
|
+
/* The hottest fields (in the eval loop) are grouped here at the top. */ \
|
|
69
|
+
PyObject *co_consts; /* list (constants used) */ \
|
|
70
|
+
PyObject *co_names; /* list of strings (names used) */ \
|
|
71
|
+
PyObject *co_exceptiontable; /* Byte string encoding exception handling \
|
|
72
|
+
table */ \
|
|
73
|
+
int co_flags; /* CO_..., see below */ \
|
|
74
|
+
\
|
|
75
|
+
/* The rest are not so impactful on performance. */ \
|
|
76
|
+
int co_argcount; /* #arguments, except *args */ \
|
|
77
|
+
int co_posonlyargcount; /* #positional only arguments */ \
|
|
78
|
+
int co_kwonlyargcount; /* #keyword only arguments */ \
|
|
79
|
+
int co_stacksize; /* #entries needed for evaluation stack */ \
|
|
80
|
+
int co_firstlineno; /* first source line number */ \
|
|
81
|
+
\
|
|
82
|
+
/* redundant values (derived from co_localsplusnames and \
|
|
83
|
+
co_localspluskinds) */ \
|
|
84
|
+
int co_nlocalsplus; /* number of spaces for holding local, cell, \
|
|
85
|
+
and free variables */ \
|
|
86
|
+
int co_framesize; /* Size of frame in words */ \
|
|
87
|
+
int co_nlocals; /* number of local variables */ \
|
|
88
|
+
int co_ncellvars; /* total number of cell variables */ \
|
|
89
|
+
int co_nfreevars; /* number of free variables */ \
|
|
90
|
+
uint32_t co_version; /* version number */ \
|
|
91
|
+
\
|
|
92
|
+
PyObject *co_localsplusnames; /* tuple mapping offsets to names */ \
|
|
93
|
+
PyObject *co_localspluskinds; /* Bytes mapping to local kinds (one byte \
|
|
94
|
+
per variable) */ \
|
|
95
|
+
PyObject *co_filename; /* unicode (where it was loaded from) */ \
|
|
96
|
+
PyObject *co_name; /* unicode (name, for reference) */ \
|
|
97
|
+
PyObject *co_qualname; /* unicode (qualname, for reference) */ \
|
|
98
|
+
PyObject *co_linetable; /* bytes object that holds location info */ \
|
|
99
|
+
PyObject *co_weakreflist; /* to support weakrefs to code objects */ \
|
|
100
|
+
_PyExecutorArray *co_executors; /* executors from optimizer */ \
|
|
101
|
+
_PyCoCached *_co_cached; /* cached co_* attributes */ \
|
|
102
|
+
uintptr_t _co_instrumentation_version; /* current instrumentation version */ \
|
|
103
|
+
struct _PyCoMonitoringData *_co_monitoring; /* Monitoring data */ \
|
|
104
|
+
Py_ssize_t _co_unique_id; /* ID used for per-thread refcounting */ \
|
|
105
|
+
int _co_firsttraceable; /* index of first traceable instruction */ \
|
|
106
|
+
/* Scratch space for extra data relating to the code object. \
|
|
107
|
+
Type is a void* to keep the format private in codeobject.c to force \
|
|
108
|
+
people to go through the proper APIs. */ \
|
|
109
|
+
void *co_extra; \
|
|
110
|
+
_PyCode_DEF_THREAD_LOCAL_BYTECODE() \
|
|
111
|
+
char co_code_adaptive[(SIZE)]; \
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Bytecode object */
|
|
115
|
+
struct PyCodeObject _PyCode_DEF(1);
|
|
116
|
+
|
|
117
|
+
/* Masks for co_flags above */
|
|
118
|
+
#define CO_OPTIMIZED 0x0001
|
|
119
|
+
#define CO_NEWLOCALS 0x0002
|
|
120
|
+
#define CO_VARARGS 0x0004
|
|
121
|
+
#define CO_VARKEYWORDS 0x0008
|
|
122
|
+
#define CO_NESTED 0x0010
|
|
123
|
+
#define CO_GENERATOR 0x0020
|
|
124
|
+
|
|
125
|
+
/* The CO_COROUTINE flag is set for coroutine functions (defined with
|
|
126
|
+
``async def`` keywords) */
|
|
127
|
+
#define CO_COROUTINE 0x0080
|
|
128
|
+
#define CO_ITERABLE_COROUTINE 0x0100
|
|
129
|
+
#define CO_ASYNC_GENERATOR 0x0200
|
|
130
|
+
|
|
131
|
+
/* bpo-39562: These constant values are changed in Python 3.9
|
|
132
|
+
to prevent collision with compiler flags. CO_FUTURE_ and PyCF_
|
|
133
|
+
constants must be kept unique. PyCF_ constants can use bits from
|
|
134
|
+
0x0100 to 0x10000. CO_FUTURE_ constants use bits starting at 0x20000. */
|
|
135
|
+
#define CO_FUTURE_DIVISION 0x20000
|
|
136
|
+
#define CO_FUTURE_ABSOLUTE_IMPORT 0x40000 /* do absolute imports by default */
|
|
137
|
+
#define CO_FUTURE_WITH_STATEMENT 0x80000
|
|
138
|
+
#define CO_FUTURE_PRINT_FUNCTION 0x100000
|
|
139
|
+
#define CO_FUTURE_UNICODE_LITERALS 0x200000
|
|
140
|
+
|
|
141
|
+
#define CO_FUTURE_BARRY_AS_BDFL 0x400000
|
|
142
|
+
#define CO_FUTURE_GENERATOR_STOP 0x800000
|
|
143
|
+
#define CO_FUTURE_ANNOTATIONS 0x1000000
|
|
144
|
+
|
|
145
|
+
#define CO_NO_MONITORING_EVENTS 0x2000000
|
|
146
|
+
|
|
147
|
+
/* Whether the code object has a docstring,
|
|
148
|
+
If so, it will be the first item in co_consts
|
|
149
|
+
*/
|
|
150
|
+
#define CO_HAS_DOCSTRING 0x4000000
|
|
151
|
+
|
|
152
|
+
/* A function defined in class scope */
|
|
153
|
+
#define CO_METHOD 0x8000000
|
|
154
|
+
|
|
155
|
+
/* This should be defined if a future statement modifies the syntax.
|
|
156
|
+
For example, when a keyword is added.
|
|
157
|
+
*/
|
|
158
|
+
#define PY_PARSER_REQUIRES_FUTURE_KEYWORD
|
|
159
|
+
|
|
160
|
+
#define CO_MAXBLOCKS 21 /* Max static block nesting within a function */
|
|
161
|
+
|
|
162
|
+
PyAPI_DATA(PyTypeObject) PyCode_Type;
|
|
163
|
+
|
|
164
|
+
#define PyCode_Check(op) Py_IS_TYPE((op), &PyCode_Type)
|
|
165
|
+
|
|
166
|
+
static inline Py_ssize_t PyCode_GetNumFree(PyCodeObject *op) {
|
|
167
|
+
assert(PyCode_Check(op));
|
|
168
|
+
return op->co_nfreevars;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
static inline int PyUnstable_Code_GetFirstFree(PyCodeObject *op) {
|
|
172
|
+
assert(PyCode_Check(op));
|
|
173
|
+
return op->co_nlocalsplus - op->co_nfreevars;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
Py_DEPRECATED(3.13) static inline int PyCode_GetFirstFree(PyCodeObject *op) {
|
|
177
|
+
return PyUnstable_Code_GetFirstFree(op);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/* Unstable public interface */
|
|
181
|
+
PyAPI_FUNC(PyCodeObject *) PyUnstable_Code_New(
|
|
182
|
+
int, int, int, int, int, PyObject *, PyObject *,
|
|
183
|
+
PyObject *, PyObject *, PyObject *, PyObject *,
|
|
184
|
+
PyObject *, PyObject *, PyObject *, int, PyObject *,
|
|
185
|
+
PyObject *);
|
|
186
|
+
|
|
187
|
+
PyAPI_FUNC(PyCodeObject *) PyUnstable_Code_NewWithPosOnlyArgs(
|
|
188
|
+
int, int, int, int, int, int, PyObject *, PyObject *,
|
|
189
|
+
PyObject *, PyObject *, PyObject *, PyObject *,
|
|
190
|
+
PyObject *, PyObject *, PyObject *, int, PyObject *,
|
|
191
|
+
PyObject *);
|
|
192
|
+
/* same as struct above */
|
|
193
|
+
// Old names -- remove when this API changes:
|
|
194
|
+
_Py_DEPRECATED_EXTERNALLY(3.12) static inline PyCodeObject *
|
|
195
|
+
PyCode_New(
|
|
196
|
+
int a, int b, int c, int d, int e, PyObject *f, PyObject *g,
|
|
197
|
+
PyObject *h, PyObject *i, PyObject *j, PyObject *k,
|
|
198
|
+
PyObject *l, PyObject *m, PyObject *n, int o, PyObject *p,
|
|
199
|
+
PyObject *q)
|
|
200
|
+
{
|
|
201
|
+
return PyUnstable_Code_New(
|
|
202
|
+
a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q);
|
|
203
|
+
}
|
|
204
|
+
_Py_DEPRECATED_EXTERNALLY(3.12) static inline PyCodeObject *
|
|
205
|
+
PyCode_NewWithPosOnlyArgs(
|
|
206
|
+
int a, int poac, int b, int c, int d, int e, PyObject *f, PyObject *g,
|
|
207
|
+
PyObject *h, PyObject *i, PyObject *j, PyObject *k,
|
|
208
|
+
PyObject *l, PyObject *m, PyObject *n, int o, PyObject *p,
|
|
209
|
+
PyObject *q)
|
|
210
|
+
{
|
|
211
|
+
return PyUnstable_Code_NewWithPosOnlyArgs(
|
|
212
|
+
a, poac, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* Creates a new empty code object with the specified source location. */
|
|
216
|
+
PyAPI_FUNC(PyCodeObject *)
|
|
217
|
+
PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno);
|
|
218
|
+
|
|
219
|
+
/* Return the line number associated with the specified bytecode index
|
|
220
|
+
in this code object. If you just need the line number of a frame,
|
|
221
|
+
use PyFrame_GetLineNumber() instead. */
|
|
222
|
+
PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int);
|
|
223
|
+
|
|
224
|
+
PyAPI_FUNC(int) PyCode_Addr2Location(PyCodeObject *, int, int *, int *, int *, int *);
|
|
225
|
+
|
|
226
|
+
#define PY_FOREACH_CODE_EVENT(V) \
|
|
227
|
+
V(CREATE) \
|
|
228
|
+
V(DESTROY)
|
|
229
|
+
|
|
230
|
+
typedef enum {
|
|
231
|
+
#define PY_DEF_EVENT(op) PY_CODE_EVENT_##op,
|
|
232
|
+
PY_FOREACH_CODE_EVENT(PY_DEF_EVENT)
|
|
233
|
+
#undef PY_DEF_EVENT
|
|
234
|
+
} PyCodeEvent;
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
/*
|
|
238
|
+
* A callback that is invoked for different events in a code object's lifecycle.
|
|
239
|
+
*
|
|
240
|
+
* The callback is invoked with a borrowed reference to co, after it is
|
|
241
|
+
* created and before it is destroyed.
|
|
242
|
+
*
|
|
243
|
+
* If the callback sets an exception, it must return -1. Otherwise
|
|
244
|
+
* it should return 0.
|
|
245
|
+
*/
|
|
246
|
+
typedef int (*PyCode_WatchCallback)(
|
|
247
|
+
PyCodeEvent event,
|
|
248
|
+
PyCodeObject* co);
|
|
249
|
+
|
|
250
|
+
/*
|
|
251
|
+
* Register a per-interpreter callback that will be invoked for code object
|
|
252
|
+
* lifecycle events.
|
|
253
|
+
*
|
|
254
|
+
* Returns a handle that may be passed to PyCode_ClearWatcher on success,
|
|
255
|
+
* or -1 and sets an error if no more handles are available.
|
|
256
|
+
*/
|
|
257
|
+
PyAPI_FUNC(int) PyCode_AddWatcher(PyCode_WatchCallback callback);
|
|
258
|
+
|
|
259
|
+
/*
|
|
260
|
+
* Clear the watcher associated with the watcher_id handle.
|
|
261
|
+
*
|
|
262
|
+
* Returns 0 on success or -1 if no watcher exists for the provided id.
|
|
263
|
+
*/
|
|
264
|
+
PyAPI_FUNC(int) PyCode_ClearWatcher(int watcher_id);
|
|
265
|
+
|
|
266
|
+
/* for internal use only */
|
|
267
|
+
struct _opaque {
|
|
268
|
+
int computed_line;
|
|
269
|
+
const uint8_t *lo_next;
|
|
270
|
+
const uint8_t *limit;
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
typedef struct _line_offsets {
|
|
274
|
+
int ar_start;
|
|
275
|
+
int ar_end;
|
|
276
|
+
int ar_line;
|
|
277
|
+
struct _opaque opaque;
|
|
278
|
+
} PyCodeAddressRange;
|
|
279
|
+
|
|
280
|
+
/* Update *bounds to describe the first and one-past-the-last instructions in the
|
|
281
|
+
same line as lasti. Return the number of that line.
|
|
282
|
+
*/
|
|
283
|
+
PyAPI_FUNC(int) _PyCode_CheckLineNumber(int lasti, PyCodeAddressRange *bounds);
|
|
284
|
+
|
|
285
|
+
/* Create a comparable key used to compare constants taking in account the
|
|
286
|
+
* object type. It is used to make sure types are not coerced (e.g., float and
|
|
287
|
+
* complex) _and_ to distinguish 0.0 from -0.0 e.g. on IEEE platforms
|
|
288
|
+
*
|
|
289
|
+
* Return (type(obj), obj, ...): a tuple with variable size (at least 2 items)
|
|
290
|
+
* depending on the type and the value. The type is the first item to not
|
|
291
|
+
* compare bytes and str which can raise a BytesWarning exception. */
|
|
292
|
+
PyAPI_FUNC(PyObject*) _PyCode_ConstantKey(PyObject *obj);
|
|
293
|
+
|
|
294
|
+
PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts,
|
|
295
|
+
PyObject *names, PyObject *lnotab);
|
|
296
|
+
|
|
297
|
+
PyAPI_FUNC(int) PyUnstable_Code_GetExtra(
|
|
298
|
+
PyObject *code, Py_ssize_t index, void **extra);
|
|
299
|
+
PyAPI_FUNC(int) PyUnstable_Code_SetExtra(
|
|
300
|
+
PyObject *code, Py_ssize_t index, void *extra);
|
|
301
|
+
// Old names -- remove when this API changes:
|
|
302
|
+
_Py_DEPRECATED_EXTERNALLY(3.12) static inline int
|
|
303
|
+
_PyCode_GetExtra(PyObject *code, Py_ssize_t index, void **extra)
|
|
304
|
+
{
|
|
305
|
+
return PyUnstable_Code_GetExtra(code, index, extra);
|
|
306
|
+
}
|
|
307
|
+
_Py_DEPRECATED_EXTERNALLY(3.12) static inline int
|
|
308
|
+
_PyCode_SetExtra(PyObject *code, Py_ssize_t index, void *extra)
|
|
309
|
+
{
|
|
310
|
+
return PyUnstable_Code_SetExtra(code, index, extra);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/* Equivalent to getattr(code, 'co_code') in Python.
|
|
314
|
+
Returns a strong reference to a bytes object. */
|
|
315
|
+
PyAPI_FUNC(PyObject *) PyCode_GetCode(PyCodeObject *code);
|
|
316
|
+
/* Equivalent to getattr(code, 'co_varnames') in Python. */
|
|
317
|
+
PyAPI_FUNC(PyObject *) PyCode_GetVarnames(PyCodeObject *code);
|
|
318
|
+
/* Equivalent to getattr(code, 'co_cellvars') in Python. */
|
|
319
|
+
PyAPI_FUNC(PyObject *) PyCode_GetCellvars(PyCodeObject *code);
|
|
320
|
+
/* Equivalent to getattr(code, 'co_freevars') in Python. */
|
|
321
|
+
PyAPI_FUNC(PyObject *) PyCode_GetFreevars(PyCodeObject *code);
|
|
322
|
+
|
|
323
|
+
typedef enum _PyCodeLocationInfoKind {
|
|
324
|
+
/* short forms are 0 to 9 */
|
|
325
|
+
PY_CODE_LOCATION_INFO_SHORT0 = 0,
|
|
326
|
+
/* one lineforms are 10 to 12 */
|
|
327
|
+
PY_CODE_LOCATION_INFO_ONE_LINE0 = 10,
|
|
328
|
+
PY_CODE_LOCATION_INFO_ONE_LINE1 = 11,
|
|
329
|
+
PY_CODE_LOCATION_INFO_ONE_LINE2 = 12,
|
|
330
|
+
|
|
331
|
+
PY_CODE_LOCATION_INFO_NO_COLUMNS = 13,
|
|
332
|
+
PY_CODE_LOCATION_INFO_LONG = 14,
|
|
333
|
+
PY_CODE_LOCATION_INFO_NONE = 15
|
|
334
|
+
} _PyCodeLocationInfoKind;
|
|
335
|
+
|
|
336
|
+
#ifdef __cplusplus
|
|
337
|
+
}
|
|
338
|
+
#endif
|
|
339
|
+
#endif // !Py_CODE_H
|
|
340
|
+
#endif // !Py_LIMITED_API
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#ifndef Py_CPYTHON_COMPILE_H
|
|
2
|
+
# error "this header file must not be included directly"
|
|
3
|
+
#endif
|
|
4
|
+
|
|
5
|
+
/* Public interface */
|
|
6
|
+
#define PyCF_MASK (CO_FUTURE_DIVISION | CO_FUTURE_ABSOLUTE_IMPORT | \
|
|
7
|
+
CO_FUTURE_WITH_STATEMENT | CO_FUTURE_PRINT_FUNCTION | \
|
|
8
|
+
CO_FUTURE_UNICODE_LITERALS | CO_FUTURE_BARRY_AS_BDFL | \
|
|
9
|
+
CO_FUTURE_GENERATOR_STOP | CO_FUTURE_ANNOTATIONS)
|
|
10
|
+
#define PyCF_MASK_OBSOLETE (CO_NESTED)
|
|
11
|
+
|
|
12
|
+
/* bpo-39562: CO_FUTURE_ and PyCF_ constants must be kept unique.
|
|
13
|
+
PyCF_ constants can use bits from 0x0100 to 0x10000.
|
|
14
|
+
CO_FUTURE_ constants use bits starting at 0x20000. */
|
|
15
|
+
#define PyCF_SOURCE_IS_UTF8 0x0100
|
|
16
|
+
#define PyCF_DONT_IMPLY_DEDENT 0x0200
|
|
17
|
+
#define PyCF_ONLY_AST 0x0400
|
|
18
|
+
#define PyCF_IGNORE_COOKIE 0x0800
|
|
19
|
+
#define PyCF_TYPE_COMMENTS 0x1000
|
|
20
|
+
#define PyCF_ALLOW_TOP_LEVEL_AWAIT 0x2000
|
|
21
|
+
#define PyCF_ALLOW_INCOMPLETE_INPUT 0x4000
|
|
22
|
+
#define PyCF_OPTIMIZED_AST (0x8000 | PyCF_ONLY_AST)
|
|
23
|
+
#define PyCF_COMPILE_MASK (PyCF_ONLY_AST | PyCF_ALLOW_TOP_LEVEL_AWAIT | \
|
|
24
|
+
PyCF_TYPE_COMMENTS | PyCF_DONT_IMPLY_DEDENT | \
|
|
25
|
+
PyCF_ALLOW_INCOMPLETE_INPUT | PyCF_OPTIMIZED_AST)
|
|
26
|
+
|
|
27
|
+
typedef struct {
|
|
28
|
+
int cf_flags; /* bitmask of CO_xxx flags relevant to future */
|
|
29
|
+
int cf_feature_version; /* minor Python version (PyCF_ONLY_AST) */
|
|
30
|
+
} PyCompilerFlags;
|
|
31
|
+
|
|
32
|
+
#define _PyCompilerFlags_INIT \
|
|
33
|
+
(PyCompilerFlags){.cf_flags = 0, .cf_feature_version = PY_MINOR_VERSION}
|
|
34
|
+
|
|
35
|
+
/* Future feature support */
|
|
36
|
+
|
|
37
|
+
#define FUTURE_NESTED_SCOPES "nested_scopes"
|
|
38
|
+
#define FUTURE_GENERATORS "generators"
|
|
39
|
+
#define FUTURE_DIVISION "division"
|
|
40
|
+
#define FUTURE_ABSOLUTE_IMPORT "absolute_import"
|
|
41
|
+
#define FUTURE_WITH_STATEMENT "with_statement"
|
|
42
|
+
#define FUTURE_PRINT_FUNCTION "print_function"
|
|
43
|
+
#define FUTURE_UNICODE_LITERALS "unicode_literals"
|
|
44
|
+
#define FUTURE_BARRY_AS_BDFL "barry_as_FLUFL"
|
|
45
|
+
#define FUTURE_GENERATOR_STOP "generator_stop"
|
|
46
|
+
#define FUTURE_ANNOTATIONS "annotations"
|
|
47
|
+
|
|
48
|
+
#define PY_INVALID_STACK_EFFECT INT_MAX
|
|
49
|
+
PyAPI_FUNC(int) PyCompile_OpcodeStackEffect(int opcode, int oparg);
|
|
50
|
+
PyAPI_FUNC(int) PyCompile_OpcodeStackEffectWithJump(int opcode, int oparg, int jump);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#ifndef Py_CPYTHON_COMPLEXOBJECT_H
|
|
2
|
+
# error "this header file must not be included directly"
|
|
3
|
+
#endif
|
|
4
|
+
|
|
5
|
+
typedef struct {
|
|
6
|
+
double real;
|
|
7
|
+
double imag;
|
|
8
|
+
} Py_complex;
|
|
9
|
+
|
|
10
|
+
// Operations on complex numbers.
|
|
11
|
+
PyAPI_FUNC(Py_complex) _Py_c_sum(Py_complex, Py_complex);
|
|
12
|
+
PyAPI_FUNC(Py_complex) _Py_c_diff(Py_complex, Py_complex);
|
|
13
|
+
PyAPI_FUNC(Py_complex) _Py_c_neg(Py_complex);
|
|
14
|
+
PyAPI_FUNC(Py_complex) _Py_c_prod(Py_complex, Py_complex);
|
|
15
|
+
PyAPI_FUNC(Py_complex) _Py_c_quot(Py_complex, Py_complex);
|
|
16
|
+
PyAPI_FUNC(Py_complex) _Py_c_pow(Py_complex, Py_complex);
|
|
17
|
+
PyAPI_FUNC(double) _Py_c_abs(Py_complex);
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
/* Complex object interface */
|
|
21
|
+
|
|
22
|
+
/*
|
|
23
|
+
PyComplexObject represents a complex number with double-precision
|
|
24
|
+
real and imaginary parts.
|
|
25
|
+
*/
|
|
26
|
+
typedef struct {
|
|
27
|
+
PyObject_HEAD
|
|
28
|
+
Py_complex cval;
|
|
29
|
+
} PyComplexObject;
|
|
30
|
+
|
|
31
|
+
PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex);
|
|
32
|
+
|
|
33
|
+
PyAPI_FUNC(Py_complex) PyComplex_AsCComplex(PyObject *op);
|