Module PythonFrontend.PyCommon

module SMap : IStdlib.IStd.Caml.Map.S with type key = string
module SSet : IStdlib.IStd.Caml.Set.S with type elt = string
module IMap : IStdlib.IStd.Caml.Map.S with type key = int
val mk_type : string -> Textuallib.Textual.Typ.t
val builtin_name : string -> Textuallib.Textual.QualifiedProcName.t

Helper function to encode known builtin names correctly

Encoding of Python int type. Since Python integers are of arbitrary precision, they are not modeled directly with int.

Encoding of Python float type.

Encoding of Python str type.

Encoding of Python bytes type.

Encoding of Python bool type.

Encoding of Python tuple type. It is the raw "untyped" one where every item is of type object.

object is the top type of Python. It helps us when no type information is available.

code is a builtin Python type to describe any code (function, class, ...) object

Like pyCode but for class creation

val pyIterItem : Textuallib.Textual.Typ.t

Wrapper type to implement next access on an iterator. Declared as pyIterItemStruct

val py_iter_item_has_item : Textuallib.Textual.qualified_fieldname
val py_iter_item_next_item : Textuallib.Textual.qualified_fieldname
val pyIterItemStruct : Textuallib.Textual.Struct.t

Textual structure with two fields. has_item indicates if something was read from the iterator or if it was empty. If has_item is true, next_item holds the value read from the iterator.

Textual encoding of the primitive Python type int

Textual encoding of the primitive Python type str

Textual encoding of the primitive Python type bytes

Textual encoding of the primitive Python type bool

Textual encoding of the primitive Python type float

Textual encoding of the primitive Python type None

Python's builtin list type

Python's builtin map type

Python's builtin set type

Python's builtin tuple type

val mk_int : Z.t -> Textuallib.Textual.Exp.t

Helper function to define typed Textual expression for literal integers.

val mk_float : float -> Textuallib.Textual.Exp.t

Helper function to define typed Textual expression for literal floats.

val mk_string : string -> Textuallib.Textual.Exp.t

Helper function to define typed Textual expression for literal strings.

val get_string : Textuallib.Textual.Exp.t -> string option

Helper to get back a string built with mk_string

val get_tuple_as_list : Textuallib.Textual.Exp.t -> Textuallib.Textual.Exp.t list option

Helper to get back the inner elements of a python_tuple

val mk_bytes : bytes -> Textuallib.Textual.Exp.t

Helper function to define typed Textual expression for literal bytes.

val mk_bool : bool -> Textuallib.Textual.Exp.t

Helper function to define typed Textual expression for boolean.

module Ident : sig ... end
type annotated_name = {
  1. name : string;
  2. annotation : Ident.t;
}

Encoding of some type annotation like x: int

val pp_annotated_name : Stdlib.Format.formatter -> annotated_name -> unit
type signature = annotated_name list
val pp_signature : Stdlib.Format.formatter -> signature -> unit
val toplevel_function : string
val static_method : string
val static_companion : string -> string
module ABC : sig ... end
val init__ : string

Name of the Python initialization method

val new__ : string

Name of the Python instantiation method

val exit : string

Name of the Python context exit method

val enter : string

Name of the Python context enter method

val return : string

Name of the binding name of return types of functions / methods

val class__ : string

Special name for __class__

val classcell : string

Special name for __classcell__

val annotations : string

Special name for __annotations__

val entry : string

Textual label name for entry points of function we synthesized (constructors, __init__, ...)

val self : string

Common name of the self argument in Python

module MakeFunctionFlags : sig ... end

Flags used by MAKE_FUNCTION