Module PythonFrontend.FFI

This file is about translating Python3.8 code objects into an OCaml representation. Some interesting readings:

module Error : sig ... end
type version =
  1. | Python_3_10
  2. | Python_3_12
val equal_version : version -> version -> bool
val compare_version : version -> version -> int
module Constant : sig ... end
module Code : sig ... end
module Instruction : sig ... end
val from_string : source:string -> filename:string -> (Code.t, Error.t) IStdlib.IStd.result

Compiles the python program describes by source into a Code.t object

val from_file : is_binary:bool -> string -> (Code.t, Error.t) IStdlib.IStd.result

Generates a Code.t object from a file. If the file is a source file, the builtin compile from Python is called to generate the bytecode. If the file is already a bytecode file, it is used right away using the Python module Marshal