mcpp index

compat.pocketpy

#include

PocketPy 2.2.0, a small embeddable Python 3.x interpreter in C11 (MIT)

#include <pocketpy.h>
mcpp add compat.pocketpy@2.2.0

用法

来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。

// compat.pocketpy — PocketPy 2.2.0: Python evaluated by the interpreter,
// checked by value through the C API.
//
// WHAT THIS ASSERTS AND WHY
//
//   the version        PK_VERSION and the interpreter's own sys.version
//   exec and eval      statements and expressions in the main module, the
//                      results read back as int, float, str and bool
//   containers         a dict and a list built in Python, walked from C++
//   native functions   a C function bound into the main module and called
//                      from Python, with its argument checks raising TypeError
//   errors             a syntax error, a runtime error, an uncaught raise and
//                      runaway recursion: each returns false with a formatted
//                      message, and the VM goes on once it is cleared
//   the watchdog       PK_ENABLE_WATCHDOG=1: py_watchdog_begin ends an endless
//                      loop with a TimeoutError
//   the configuration  pkpy.configmacros: the PK_ENABLE_* the package sets
//   upstream's fix     exceptions kept alive across garbage collections
//                      (de8351ed, applied by install()): without it the
//                      collector reads their unset traceback values and
//                      crashes
//   the library        json and math (dmath), modules compiled in C, and the
// …

tests/examples/pocketpy/tests/pocketpy.cpp · 项目 tests/examples/pocketpy

构建

targets
pocketpy (lib)
language
c++23
C standard
gnu11
import std
no
include dirs
*/include

源文件 (1)

  • */mcpp/pocketpy_unity.c

生成的文件

  • pocketpy-2.2.0/mcpp/pocketpy_unity.c

版本

版本平台 镜像sha256
2.2.0 最新 LinuxWindowsmacOS CN GLOBAL c67cb6a1422a…