Decode bytes to strings in Python Object API (#8551)

This commit is contained in:
Seth Raymond
2025-06-29 04:40:10 -04:00
committed by GitHub
parent 31beb0fb2f
commit 75556437cc
5 changed files with 29 additions and 1 deletions

View File

@@ -256,6 +256,7 @@ const static FlatCOption flatc_options[] = {
"Skip emission of Python functions that are prefixed with typenames" },
{ "", "python-typing", "", "Generate Python type annotations" },
{ "", "python-version", "", "Generate code for the given Python version." },
{ "", "python-decode-obj-api-strings", "", "Decode bytes to strings for the Python Object API"},
{ "", "python-gen-numpy", "", "Whether to generate numpy helpers." },
{ "", "ts-omit-entrypoint", "",
"Omit emission of namespace entrypoint file" },
@@ -682,6 +683,8 @@ FlatCOptions FlatCompiler::ParseFromCommandLineArguments(int argc,
} else if (arg == "--python-version") {
if (++argi >= argc) Error("missing value following: " + arg, true);
opts.python_version = argv[argi];
} else if (arg == "--python-decode-obj-api-strings") {
opts.python_decode_obj_api_strings = true;
} else if (arg == "--python-gen-numpy" ||
arg == "--python-gen-numpy=true") {
opts.python_gen_numpy = true;