opycaml / type.ml

(** class hierarchy *)
type _Object = [`_Object]

type _None = [_Object | `_None]

type _Number = [_Object | `_Number]
type _Integral = [_Number | `_Integral]
type _Int = [_Integral | `_Int]
type _Long = [_Integral | `_Long]
(* Integral + bool *)
type _Float = [_Number | `_Float]
(* Number + real and  complex *)
 
type _Sequence = [_Object | `_Sequence]
type _String = [_Sequence | `_String]
type _Unicode = [_String (* ? *) | `_Unicode]
type _Tuple = [_Sequence | `_Tuple]
type _Mutable = [_Sequence | `_Mutable]
type _List = [_Mutable | `_List]
type _ByteArray = [_Mutable | `_ByteArray]
(* _Set
   _FrozenSet
*)
type _Mapping = [_Object | `_Mapping]
type _Dict = [_Mapping | `_Dict]

type _Callable = [_Object | `_Callable]

type _Module = [_Object | `_Module]

type _Type = [_Object | `_Type]
type _Index = [_Object | `_Index]
type _Iter = [_Object | `_Iter]

type _Class = [_Object | `_Class]
type _Slice = [_Object | `_Slice]

type _CObject = [_Object | `_CObject]

type _Closure = [_Object | `_Closure]

type _Run = [_Object | `_Run]
type _Eval = [_Object | `_Eval]
type _DictProxy = [_Object | `_DictProxy]
type _Err = [_Object | `_Err]
type _Base = [_Object | `_Base]
type _Import = [_Object | `_Import]

(** the Python Object type. It is contravariant, since object with richer interface can be poorer *)
type -'a t

type unit_or_fail = unit
type bool_or_fail = bool
type size_or_fail = int
type hash_or_fail = nativeint
type py_ssize_t = int
type size_t = int
type _FILE (* not implemented yet *)

exception Error of _Object t (* type *) * _Object t (* detail value *)

exception Coercion

(** change the type of the object. Unsafe. *)
let unsafe_coerce : [>_Object] t -> 'a t = fun t -> Obj.magic t
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.