Skip to content

module internal.core

Source: stdlib/internal/core.codon


type[T] @tuple Class is named tuple (cannot write fields)

Fields

T: type


unrealized_type[T] @tuple Class is named tuple (cannot write fields)

Fields

T: type


TypeWrap[T] @tuple Class is named tuple (cannot write fields)

Fields

T: type


bool @tuple Class is named tuple (cannot write fields)


byte @tuple Class is named tuple (cannot write fields)


int @tuple Class is named tuple (cannot write fields)

Fields

MAX


float @tuple Class is named tuple (cannot write fields)

Fields

MIN_10_EXP


float32 @tuple Class is named tuple (cannot write fields)

Fields

MIN_10_EXP


float16 @tuple Class is named tuple (cannot write fields)

Fields

MIN_10_EXP


bfloat16 @tuple Class is named tuple (cannot write fields)

Fields

MIN_10_EXP


float128 @tuple Class is named tuple (cannot write fields)

Fields

MIN_10_EXP


Function[T,TR] @tuple Class is named tuple (cannot write fields)

Fields

T: type

TR: type


CallableTrait[T,TR] @tuple Class is named tuple (cannot write fields)

Fields

T: type

TR: type


NoneType @tuple Class is named tuple (cannot write fields)


Ptr[T] @tuple Class is named tuple (cannot write fields)

Fields

T: type


cobj = Ptr[byte]


Capsule[T] @tuple Class is named tuple (cannot write fields)

Fields

val: Ptr[T]

T: type


Generator[T] @tuple Class is named tuple (cannot write fields)

Fields

T: type


Optional[T] @tuple Class is named tuple (cannot write fields)

Fields

T: type


Int[N] @tuple Class is named tuple (cannot write fields)

Fields

N: Literal[int]


UInt[N] @tuple Class is named tuple (cannot write fields)

Fields

N: Literal[int]


pyobj

Fields

p: Ptr[byte]


str @tuple Class is named tuple (cannot write fields)

Fields

ptr: Ptr[byte]

len: int


Tuple @tuple Class is named tuple (cannot write fields)

Magic methods

__new__() @llvm Function is implemented with inline LLVM IR

ret {} {}

__add__(self: __SELF__, obj, __SELF__: type)

__mul__(self: __SELF__, n: Literal[int], __SELF__: type)

__contains__(self: __SELF__, obj, __SELF__: type)

__getitem__(self: __SELF__, idx: int, __SELF__: type)

__iter__(self: __SELF__, __SELF__: type)

__hash__(self: __SELF__, __SELF__: type)

__repr__(self: __SELF__, __SELF__: type)

__len__(self: __SELF__, __SELF__: type)

__eq__(self: __SELF__, obj: __SELF__, __SELF__: type)

__ne__(self: __SELF__, obj: __SELF__, __SELF__: type)

__gt__(self: __SELF__, obj: __SELF__, __SELF__: type)

__ge__(self: __SELF__, obj: __SELF__, __SELF__: type)

__lt__(self: __SELF__, obj: __SELF__, __SELF__: type)

__le__(self: __SELF__, obj: __SELF__, __SELF__: type)

__pickle__(self: __SELF__, dest: Ptr[byte], __SELF__: type)

__unpickle__(src: Ptr[byte], __SELF__: type)

__to_py__(self: __SELF__, __SELF__: type)

__from_py__(src: Ptr[byte], __SELF__: type)

__to_gpu__(self: __SELF__, cache, __SELF__: type)

__from_gpu__(self: __SELF__, other: __SELF__, __SELF__: type)

__from_gpu_new__(other: __SELF__, __SELF__: type)

__tuplesize__(self: __SELF__, __SELF__: type)


tuple = Tuple


pure() @attribute Function is an attribute


derives() @attribute Function is an attribute


NoneType @extend Class is extended to add given methods

Magic methods

__new__() @pure Function has no side effects and returns same value for same inputs @derives Function return value captures arguments @llvm Function is implemented with inline LLVM IR

ret {} {}

Array[T] @tuple Class is named tuple (cannot write fields)

Fields

len: int

ptr: Ptr[T]

T: type


type[T] @extend Class is extended to add given methods

Magic methods

__new__(obj)


function = Function


Union[TU] @tuple Class is named tuple (cannot write fields)

Fields

TU: type

Magic methods

__new__(val)

__call__(self, *args, **kwargs)


Function[T,TR] @extend Class is extended to add given methods

Magic methods

__new__() @pure Function has no side effects and returns same value for same inputs @derives Function return value captures arguments @llvm Function is implemented with inline LLVM IR

ret ptr null

TypeTrait[T]

Fields

T: type


ByVal


ByRef


ClassVar[T]

Fields

T: type


RTTI

Fields

id: int


ellipsis @tuple Class is named tuple (cannot write fields)

Magic methods

__new__() @pure Function has no side effects and returns same value for same inputs @derives Function return value captures arguments @llvm Function is implemented with inline LLVM IR

ret {} {}

Ellipsis = ellipsis()


Import[file,name] @tuple Class is named tuple (cannot write fields)

Fields

loaded: bool

file: Literal[str]

name: Literal[str]

Magic methods

__new__(loaded: bool, file: Literal[str], name: Literal[str]) @pure Function has no side effects and returns same value for same inputs @derives Function return value captures arguments @llvm Function is implemented with inline LLVM IR

%0 = insertvalue { {=bool} } undef, {=bool} %loaded, 0
ret { {=bool} } %0

__repr__(self)


compile_error(msg: Literal[str])


isinstance(obj, what)


overload() @attribute Function is an attribute


hasattr(obj, attr: Literal[str], *args, **kwargs)


getattr(obj, attr: Literal[str])


setattr(obj, attr: Literal[str], what)


Super[__T__] @tuple Class is named tuple (cannot write fields)


super()


superf(*args)

Special handling


NamedTuple[N,T] @tuple Class is named tuple (cannot write fields)

Fields

args: T

N: Literal[int]

T: type

Magic methods

__new__(args: T = (), N: Literal[int] = 0, T: type) @pure Function has no side effects and returns same value for same inputs @derives Function return value captures arguments @llvm Function is implemented with inline LLVM IR

%0 = insertvalue { {=T} } undef, {=T} %args, 0
ret { {=T} } %0

__getitem__(self, key: Literal[str])

__contains__(self, key: Literal[str])

__keys__(self)

__repr__(self)

Methods

get(self, key: Literal[str], default = NoneType())


Partial[M,T,K,F] @tuple Class is named tuple (cannot write fields)

Fields

args: T

kwargs: K

M: Literal[str]

T: type

K: type

F: type

Properties

__fn_name__ @property Method is a class property

Magic methods

__new__(args: T, kwargs: K, M: Literal[str], F: type, T: type, K: type) @pure Function has no side effects and returns same value for same inputs @derives Function return value captures arguments @llvm Function is implemented with inline LLVM IR

%0 = insertvalue { {=T}, {=K} } undef, {=T} %args, 0
%1 = insertvalue { {=T}, {=K} } %0, {=K} %kwargs, 1
ret { {=T}, {=K} } %1

__repr__(self)

__call__(self, *args, **kwargs)

__fn_name__(self) @property Method is a class property

__raw__(self)


Callable[T,TR] @tuple Class is named tuple (cannot write fields)

Fields

fn: Function[Ptr[byte], T, TR]

data: Ptr[byte]

T: type

TR: type