Numworks Epsilon  1.4.1
Graphing Calculator Operating System
objtuple.c File Reference
#include <string.h>
#include <assert.h>
#include "py/objtuple.h"
#include "py/runtime.h"

Go to the source code of this file.

Classes

struct  _mp_obj_tuple_it_t
 

Typedefs

typedef struct _mp_obj_tuple_it_t mp_obj_tuple_it_t
 

Functions

void mp_obj_tuple_print (const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind)
 
STATIC mp_obj_t mp_obj_tuple_make_new (const mp_obj_type_t *type_in, size_t n_args, size_t n_kw, const mp_obj_t *args)
 
STATIC mp_obj_t tuple_cmp_helper (mp_uint_t op, mp_obj_t self_in, mp_obj_t another_in)
 
mp_obj_t mp_obj_tuple_unary_op (mp_unary_op_t op, mp_obj_t self_in)
 
mp_obj_t mp_obj_tuple_binary_op (mp_binary_op_t op, mp_obj_t lhs, mp_obj_t rhs)
 
mp_obj_t mp_obj_tuple_subscr (mp_obj_t self_in, mp_obj_t index, mp_obj_t value)
 
STATIC mp_obj_t tuple_count (mp_obj_t self_in, mp_obj_t value)
 
STATIC MP_DEFINE_CONST_FUN_OBJ_2 (tuple_count_obj, tuple_count)
 
STATIC mp_obj_t tuple_index (size_t n_args, const mp_obj_t *args)
 
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (tuple_index_obj, 2, 4, tuple_index)
 
STATIC MP_DEFINE_CONST_DICT (tuple_locals_dict, tuple_locals_dict_table)
 
mp_obj_t mp_obj_new_tuple (size_t n, const mp_obj_t *items)
 
void mp_obj_tuple_get (mp_obj_t self_in, size_t *len, mp_obj_t **items)
 
void mp_obj_tuple_del (mp_obj_t self_in)
 
STATIC mp_obj_t tuple_it_iternext (mp_obj_t self_in)
 
mp_obj_t mp_obj_tuple_getiter (mp_obj_t o_in, mp_obj_iter_buf_t *iter_buf)
 

Variables

STATIC const mp_rom_map_elem_t tuple_locals_dict_table []
 
const mp_obj_type_t mp_type_tuple
 
const mp_obj_tuple_t mp_const_empty_tuple_obj = {{&mp_type_tuple}, 0}
 

Typedef Documentation

◆ mp_obj_tuple_it_t

Function Documentation

◆ MP_DEFINE_CONST_DICT()

STATIC MP_DEFINE_CONST_DICT ( tuple_locals_dict  ,
tuple_locals_dict_table   
)

◆ MP_DEFINE_CONST_FUN_OBJ_2()

STATIC MP_DEFINE_CONST_FUN_OBJ_2 ( tuple_count_obj  ,
tuple_count   
)

◆ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN()

STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN ( tuple_index_obj  ,
,
,
tuple_index   
)

◆ mp_obj_new_tuple()

mp_obj_t mp_obj_new_tuple ( size_t  n,
const mp_obj_t items 
)

Definition at line 235 of file objtuple.c.

◆ mp_obj_tuple_binary_op()

mp_obj_t mp_obj_tuple_binary_op ( mp_binary_op_t  op,
mp_obj_t  lhs,
mp_obj_t  rhs 
)

Definition at line 139 of file objtuple.c.

◆ mp_obj_tuple_del()

void mp_obj_tuple_del ( mp_obj_t  self_in)

Definition at line 257 of file objtuple.c.

◆ mp_obj_tuple_get()

void mp_obj_tuple_get ( mp_obj_t  self_in,
size_t len,
mp_obj_t **  items 
)

Definition at line 250 of file objtuple.c.

◆ mp_obj_tuple_getiter()

mp_obj_t mp_obj_tuple_getiter ( mp_obj_t  o_in,
mp_obj_iter_buf_t iter_buf 
)

Definition at line 284 of file objtuple.c.

◆ mp_obj_tuple_make_new()

STATIC mp_obj_t mp_obj_tuple_make_new ( const mp_obj_type_t type_in,
size_t  n_args,
size_t  n_kw,
const mp_obj_t args 
)

Definition at line 60 of file objtuple.c.

◆ mp_obj_tuple_print()

void mp_obj_tuple_print ( const mp_print_t print,
mp_obj_t  o_in,
mp_print_kind_t  kind 
)

Definition at line 36 of file objtuple.c.

◆ mp_obj_tuple_subscr()

mp_obj_t mp_obj_tuple_subscr ( mp_obj_t  self_in,
mp_obj_t  index,
mp_obj_t  value 
)

Definition at line 177 of file objtuple.c.

◆ mp_obj_tuple_unary_op()

mp_obj_t mp_obj_tuple_unary_op ( mp_unary_op_t  op,
mp_obj_t  self_in 
)

Definition at line 122 of file objtuple.c.

◆ tuple_cmp_helper()

STATIC mp_obj_t tuple_cmp_helper ( mp_uint_t  op,
mp_obj_t  self_in,
mp_obj_t  another_in 
)

Definition at line 102 of file objtuple.c.

◆ tuple_count()

STATIC mp_obj_t tuple_count ( mp_obj_t  self_in,
mp_obj_t  value 
)

Definition at line 199 of file objtuple.c.

◆ tuple_index()

STATIC mp_obj_t tuple_index ( size_t  n_args,
const mp_obj_t args 
)

Definition at line 206 of file objtuple.c.

◆ tuple_it_iternext()

STATIC mp_obj_t tuple_it_iternext ( mp_obj_t  self_in)

Definition at line 273 of file objtuple.c.

Variable Documentation

◆ mp_const_empty_tuple_obj

const mp_obj_tuple_t mp_const_empty_tuple_obj = {{&mp_type_tuple}, 0}

Definition at line 233 of file objtuple.c.

◆ mp_type_tuple

const mp_obj_type_t mp_type_tuple
Initial value:
= {
.name = MP_QSTR_tuple,
.make_new = mp_obj_tuple_make_new,
.unary_op = mp_obj_tuple_unary_op,
.binary_op = mp_obj_tuple_binary_op,
.locals_dict = (mp_obj_dict_t*)&tuple_locals_dict,
}
mp_obj_t mp_obj_tuple_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value)
Definition: objtuple.c:177
mp_obj_t mp_obj_tuple_binary_op(mp_binary_op_t op, mp_obj_t lhs, mp_obj_t rhs)
Definition: objtuple.c:139
void mp_obj_tuple_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind)
Definition: objtuple.c:36
mp_obj_t mp_obj_tuple_getiter(mp_obj_t o_in, mp_obj_iter_buf_t *iter_buf)
Definition: objtuple.c:284
const mp_obj_type_t mp_type_type
Definition: objtype.c:969
STATIC mp_obj_t mp_obj_tuple_make_new(const mp_obj_type_t *type_in, size_t n_args, size_t n_kw, const mp_obj_t *args)
Definition: objtuple.c:60
qstr name
Definition: obj.h:478
mp_obj_t mp_obj_tuple_unary_op(mp_unary_op_t op, mp_obj_t self_in)
Definition: objtuple.c:122

Definition at line 220 of file objtuple.c.

◆ tuple_locals_dict_table

STATIC const mp_rom_map_elem_t tuple_locals_dict_table[]
Initial value:
= {
{ MP_ROM_QSTR(MP_QSTR_count), MP_ROM_PTR(&tuple_count_obj) },
{ MP_ROM_QSTR(MP_QSTR_index), MP_ROM_PTR(&tuple_index_obj) },
}
#define MP_ROM_QSTR(q)
Definition: obj.h:241
#define MP_ROM_PTR(p)
Definition: obj.h:242

Definition at line 213 of file objtuple.c.