package pyml

  1. Overview
  2. Docs
val read_object_from_file : Stdlib.in_channel file -> Object.t

read_object_from_file f reads one value from f and returns it. Wrapper for PyMarshal_ReadObjectFromFile

val load : Stdlib.in_channel file -> Object.t

Equivalent to read_object_from_file.

val read_last_object_from_file : Stdlib.in_channel file -> Object.t

read_last_object_from_file f reads a value from f and returns it. That value should be the only value remaining to be read from f before EOF. Wrapper for PyMarshal_ReadLastObjectFromFile

val read_object_from_string : string -> int -> Object.t

read_object_from_string s len reads a value from the len first bytes of s. Wrapper for PyMarshal_ReadObjectFromString

val loads : string -> Object.t

Py.Marshal.loads s is equivalent to Py.Marshal.read_object_from_string s (String.length s).

val write_object_to_file : Object.t -> Stdlib.out_channel file -> int -> unit

write_object_to_file value file version writes the object value to file. version indicates the file format (use version to get the current version). Wrapper for PyMarshal_WriteObjectToFile

val dump : ?version:int -> Object.t -> Stdlib.out_channel file -> unit

Py.Marshal.dump ?version value file is equivalent to Py.Marshal.write_object_to_file value file version. By default, the version returned by version is used.

val write_object_to_string : Object.t -> int -> Object.t

write_object_to_file value file version returns the Python string representing the object value. version indicates the format (use version to get the current version). Wrapper for PyMarshal_WriteObjectToString

val dumps : ?version:int -> Object.t -> string

Py.Marshal.dumps ?version value is equivalent to Py.String.to_string (Py.Marshal.write_object_to_string value version). By default, the version returned by version is used.

val version : unit -> int

Returns the current file format version number.