Skip to content

Commit

Permalink
Add sequence operators to fix the unbound vs. missing problem
Browse files Browse the repository at this point in the history
These will also come in handy when it comes to re-implementing stuff like `Sequence.find`
  • Loading branch information
GrieferAtWork committed May 9, 2024
1 parent af23723 commit aead1b9
Show file tree
Hide file tree
Showing 49 changed files with 2,070 additions and 584 deletions.
529 changes: 356 additions & 173 deletions include/deemon/class.h

Large diffs are not rendered by default.

54 changes: 51 additions & 3 deletions include/deemon/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -2030,9 +2030,10 @@ struct Dee_type_seq {
WUNUSED_T NONNULL_T((1, 2)) Dee_ssize_t (DCALL *tp_foreach)(DeeObject *__restrict self, Dee_foreach_t proc, void *arg);
WUNUSED_T NONNULL_T((1, 2)) Dee_ssize_t (DCALL *tp_foreach_pair)(DeeObject *__restrict self, Dee_foreach_pair_t proc, void *arg);

/* TODO: For enumerating available indices/keys, and their current values (which may be NULL if `this[index] !is bound') */
//TODO: WUNUSED_T NONNULL_T((1, 2)) Dee_ssize_t (DCALL *tp_enumerate)(DeeObject *__restrict self, Dee_enumerate_t proc, void *arg);
//TODO: WUNUSED_T NONNULL_T((1, 2)) Dee_ssize_t (DCALL *tp_enumerate_index)(DeeObject *__restrict self, Dee_enumerate_index_t proc, void *arg, size_t starthint, size_t endhint);
/* Alternate forms for `tp_foreach' (these are inherited by `DeeType_InheritIter()').
* For enumerating available indices/keys, and their current values (which may be NULL if `this[index] !is bound') */
WUNUSED_T NONNULL_T((1, 2)) Dee_ssize_t (DCALL *tp_enumerate)(DeeObject *__restrict self, Dee_enumerate_t proc, void *arg);
WUNUSED_T NONNULL_T((1, 2)) Dee_ssize_t (DCALL *tp_enumerate_index)(DeeObject *__restrict self, Dee_enumerate_index_t proc, void *arg, size_t starthint, size_t endhint);

/* Optional function to check if a specific item index/key is bound. (inherited alongside `tp_getitem')
* Check if a given item is bound (`self[index] is bound' / `deemon.bounditem(self, index)')
Expand Down Expand Up @@ -2195,6 +2196,22 @@ myob_foreach_pair(MyObject *__restrict self, Dee_foreach_pair_t proc, void *arg)
return DeeError_NOTIMPLEMENTED();
}

PRIVATE WUNUSED NONNULL((1, 2)) Dee_ssize_t DCALL
myob_enumerate(MyObject *__restrict self, Dee_enumerate_t proc, void *arg) {
(void)self;
(void)proc;
(void)arg;
return DeeError_NOTIMPLEMENTED();
}

PRIVATE WUNUSED NONNULL((1, 2)) Dee_ssize_t DCALL
myob_enumerate_index(MyObject *__restrict self, Dee_enumerate_index_t proc, void *arg, size_t starthint, size_t endhint) {
(void)self;
(void)proc;
(void)arg;
return DeeError_NOTIMPLEMENTED();
}

PRIVATE WUNUSED NONNULL((1, 2)) int DCALL
myob_bounditem(MyObject *self, DeeObject *index) {
(void)self;
Expand Down Expand Up @@ -2448,6 +2465,8 @@ PRIVATE struct type_seq myob_seq = {
/* .tp_nsi = */ &myob_nsi,
/* .tp_foreach = */ (Dee_ssize_t (DCALL *)(DeeObject *__restrict, Dee_foreach_t, void *))&myob_foreach,
/* .tp_foreach_pair = */ (Dee_ssize_t (DCALL *)(DeeObject *__restrict, Dee_foreach_pair_t, void *))&myob_foreach_pair,
/* .tp_enumerate = */ (Dee_ssize_t (DCALL *)(DeeObject *__restrict, Dee_enumerate_t, void *))&myob_enumerate,
/* .tp_enumerate_index = */ (Dee_ssize_t (DCALL *)(DeeObject *__restrict, Dee_enumerate_index_t, void *, size_t, size_t))&myob_enumerate_index,
/* .tp_bounditem = */ (int (DCALL *)(DeeObject *, DeeObject *))&myob_bounditem,
/* .tp_hasitem = */ (int (DCALL *)(DeeObject *, DeeObject *))&myob_hasitem,
/* .tp_size = */ (size_t (DCALL *)(DeeObject *__restrict))&myob_size,
Expand Down Expand Up @@ -4517,7 +4536,9 @@ DFUNDEF WUNUSED NONNULL((1, 2)) int (DCALL DeeObject_InplacePow)(DREF DeeObject
DFUNDEF WUNUSED NONNULL((1)) DREF DeeObject *(DCALL DeeObject_AddInt8)(DeeObject *__restrict self, int8_t val);
DFUNDEF WUNUSED NONNULL((1)) DREF DeeObject *(DCALL DeeObject_SubInt8)(DeeObject *__restrict self, int8_t val);
DFUNDEF WUNUSED NONNULL((1)) DREF DeeObject *(DCALL DeeObject_AddUInt32)(DeeObject *__restrict self, uint32_t val);
DFUNDEF WUNUSED NONNULL((1)) DREF DeeObject *(DCALL DeeObject_AddUInt64)(DeeObject *__restrict self, uint64_t val);
DFUNDEF WUNUSED NONNULL((1)) DREF DeeObject *(DCALL DeeObject_SubUInt32)(DeeObject *__restrict self, uint32_t val);
DFUNDEF WUNUSED NONNULL((1)) DREF DeeObject *(DCALL DeeObject_SubUInt64)(DeeObject *__restrict self, uint64_t val);
DFUNDEF WUNUSED NONNULL((1)) DREF DeeObject *(DCALL DeeObject_MulInt8)(DeeObject *__restrict self, int8_t val);
DFUNDEF WUNUSED NONNULL((1)) DREF DeeObject *(DCALL DeeObject_DivInt8)(DeeObject *__restrict self, int8_t val);
DFUNDEF WUNUSED NONNULL((1)) DREF DeeObject *(DCALL DeeObject_ModInt8)(DeeObject *__restrict self, int8_t val);
Expand All @@ -4538,6 +4559,13 @@ DFUNDEF WUNUSED NONNULL((1)) int (DCALL DeeObject_InplaceShrUInt8)(DREF DeeObjec
DFUNDEF WUNUSED NONNULL((1)) int (DCALL DeeObject_InplaceAndUInt32)(DREF DeeObject **__restrict p_self, uint32_t val);
DFUNDEF WUNUSED NONNULL((1)) int (DCALL DeeObject_InplaceOrUInt32)(DREF DeeObject **__restrict p_self, uint32_t val);
DFUNDEF WUNUSED NONNULL((1)) int (DCALL DeeObject_InplaceXorUInt32)(DREF DeeObject **__restrict p_self, uint32_t val);
#if __SIZEOF_SIZE_T__ > 4
#define DeeObject_AddSize(self, val) DeeObject_AddUInt64(self, (uint64_t)(val))
#define DeeObject_SubSize(self, val) DeeObject_SubUInt64(self, (uint64_t)(val))
#else /* __SIZEOF_SIZE_T__ > 4 */
#define DeeObject_AddSize(self, val) DeeObject_AddUInt32(self, (uint32_t)(val))
#define DeeObject_SubSize(self, val) DeeObject_SubUInt32(self, (uint32_t)(val))
#endif /* __SIZEOF_SIZE_T__ <= 4 */


/* Comparison operator invocation. */
Expand Down Expand Up @@ -4769,6 +4797,26 @@ DFUNDEF WUNUSED NONNULL((1, 2)) Dee_ssize_t /* TODO: Refactor more code to use t
DFUNDEF WUNUSED NONNULL((1, 2)) Dee_ssize_t /* TODO: Refactor more code to use this instead of `DeeObject_Unpack()' */
(DCALL DeeObject_ForeachPair)(DeeObject *__restrict self, Dee_foreach_pair_t proc, void *arg);


/* Enumerate valid keys/indices of "self", as well as their current value.
* @return: * : Sum of return values of `*proc'
* @return: -1: An error occurred during iteration (or potentially inside of `*proc') */
DFUNDEF WUNUSED NONNULL((1, 2)) Dee_ssize_t
(DCALL DeeObject_Enumerate)(DeeObject *__restrict self, Dee_enumerate_t proc, void *arg);

/* Same as `DeeObject_Enumerate()', but only valid when "self" uses integers for indices
* or is a mapping where all keys are integers. In the former case, [starthint,endhint)
* can be given in order to allow the implementation to only enumerate indices that fall
* within that range (though an implementation is allowed to simply ignore these arguments)
* If you want to always enumerate all indices (like is also done by `DeeObject_Enumerate',
* then simply pass `starthint = 0, endhint = (size_t)-1')
* @return: * : Sum of return values of `*proc'
* @return: -1: An error occurred during iteration (or potentially inside of `*proc') */
DFUNDEF WUNUSED NONNULL((1, 2)) Dee_ssize_t
(DCALL DeeObject_EnumerateIndex)(DeeObject *__restrict self, Dee_enumerate_index_t proc,
void *arg, size_t starthint, size_t endhint);


/* Unpack the given sequence `self' into `objc' items then stored within the `objv' vector. */
DFUNDEF WUNUSED ATTR_OUTS(3, 2) NONNULL((1)) int
(DCALL DeeObject_Unpack)(DeeObject *__restrict self, size_t objc,
Expand Down
2 changes: 2 additions & 0 deletions include/deemon/super.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ DFUNDEF WUNUSED NONNULL((1, 2, 3)) int (DCALL DeeObject_TTryCompareEq)(DeeTypeOb
/* Sequence operators */
DFUNDEF WUNUSED NONNULL((1, 2, 3)) Dee_ssize_t (DCALL DeeObject_TForeach)(DeeTypeObject *tp_self, DeeObject *self, Dee_foreach_t proc, void *arg);
DFUNDEF WUNUSED NONNULL((1, 2, 3)) Dee_ssize_t (DCALL DeeObject_TForeachPair)(DeeTypeObject *tp_self, DeeObject *self, Dee_foreach_pair_t proc, void *arg);
DFUNDEF WUNUSED NONNULL((1, 2, 3)) Dee_ssize_t (DCALL DeeObject_TEnumerate)(DeeTypeObject *tp_self, DeeObject *self, Dee_enumerate_t proc, void *arg);
DFUNDEF WUNUSED NONNULL((1, 2, 3)) Dee_ssize_t (DCALL DeeObject_TEnumerateIndex)(DeeTypeObject *tp_self, DeeObject *self, Dee_enumerate_index_t proc, void *arg, size_t starthint, size_t endhint);
DFUNDEF WUNUSED NONNULL((1, 2)) DREF DeeObject *(DCALL DeeObject_TIter)(DeeTypeObject *tp_self, DeeObject *self);
DFUNDEF WUNUSED NONNULL((1, 2)) DREF DeeObject *(DCALL DeeObject_TIterNext)(DeeTypeObject *tp_self, DeeObject *self);
DFUNDEF WUNUSED NONNULL((1, 2)) DREF DeeObject *(DCALL DeeObject_TSizeOb)(DeeTypeObject *tp_self, DeeObject *self);
Expand Down
16 changes: 15 additions & 1 deletion src/deemon/execute/function-wrappers.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,9 @@ PRIVATE struct type_seq funcstatics_seq = {
/* .tp_setrange = */ NULL,
/* .tp_nsi = */ &funcstatics_nsi,
/* .tp_foreach = */ (Dee_ssize_t (DCALL *)(DeeObject *__restrict, Dee_foreach_t, void *))&funcstatics_foreach,
/* .tp_foreach_pair = */ (Dee_ssize_t (DCALL *)(DeeObject *__restrict, Dee_foreach_pair_t, void *))NULL,
/* .tp_foreach_pair = */ NULL,
/* .tp_enumerate = */ NULL,
/* .tp_enumerate_index = */ NULL,
/* .tp_bounditem = */ NULL,
/* .tp_hasitem = */ NULL,
/* .tp_size = */ (size_t (DCALL *)(DeeObject *__restrict))&funcstatics_nsi_getsize,
Expand Down Expand Up @@ -1415,6 +1417,8 @@ PRIVATE struct type_seq funcsymbolsbyname_seq = {
/* .tp_nsi = */ &funcsymbolsbyname_nsi,
/* .tp_foreach = */ NULL,
/* .tp_foreach_pair = */ NULL,
/* .tp_enumerate = */ NULL,
/* .tp_enumerate_index = */ NULL,
/* .tp_bounditem = */ NULL,
/* .tp_hasitem = */ NULL,
/* .tp_size = */ (size_t (DCALL *)(DeeObject *__restrict))&funcsymbolsbyname_nsi_getsize,
Expand Down Expand Up @@ -2399,6 +2403,8 @@ PRIVATE struct type_seq yfuncsymbolsbyname_seq = {
/* .tp_nsi = */ &yfuncsymbolsbyname_nsi,
/* .tp_foreach = */ NULL,
/* .tp_foreach_pair = */ NULL,
/* .tp_enumerate = */ NULL,
/* .tp_enumerate_index = */ NULL,
/* .tp_bounditem = */ NULL,
/* .tp_hasitem = */ NULL,
/* .tp_size = */ (size_t (DCALL *)(DeeObject *__restrict))&yfuncsymbolsbyname_nsi_getsize,
Expand Down Expand Up @@ -2680,6 +2686,8 @@ PRIVATE struct type_seq frameargs_seq = {
/* .tp_nsi = */ &frameargs_nsi,
/* .tp_foreach = */ NULL,
/* .tp_foreach_pair = */ NULL,
/* .tp_enumerate = */ NULL,
/* .tp_enumerate_index = */ NULL,
/* .tp_bounditem = */ NULL,
/* .tp_hasitem = */ NULL,
/* .tp_size = */ (size_t (DCALL *)(DeeObject *__restrict))&frameargs_nsi_getsize,
Expand Down Expand Up @@ -2987,6 +2995,8 @@ PRIVATE struct type_seq framelocals_seq = {
/* .tp_nsi = */ &framelocals_nsi,
/* .tp_foreach = */ NULL,
/* .tp_foreach_pair = */ NULL,
/* .tp_enumerate = */ NULL,
/* .tp_enumerate_index = */ NULL,
/* .tp_bounditem = */ NULL,
/* .tp_hasitem = */ NULL,
/* .tp_size = */ (size_t (DCALL *)(DeeObject *__restrict))&framelocals_nsi_getsize,
Expand Down Expand Up @@ -3369,6 +3379,8 @@ PRIVATE struct type_seq framestack_seq = {
/* .tp_nsi = */ &framestack_nsi,
/* .tp_foreach = */ NULL,
/* .tp_foreach_pair = */ NULL,
/* .tp_enumerate = */ NULL,
/* .tp_enumerate_index = */ NULL,
/* .tp_bounditem = */ NULL,
/* .tp_hasitem = */ NULL,
/* .tp_size = */ (size_t (DCALL *)(DeeObject *__restrict))&framestack_nsi_getsize,
Expand Down Expand Up @@ -4711,6 +4723,8 @@ PRIVATE struct type_seq framesymbolsbyname_seq = {
/* .tp_nsi = */ &framesymbolsbyname_nsi,
/* .tp_foreach = */ NULL,
/* .tp_foreach_pair = */ NULL,
/* .tp_enumerate = */ NULL,
/* .tp_enumerate_index = */ NULL,
/* .tp_bounditem = */ NULL,
/* .tp_hasitem = */ NULL,
/* .tp_size = */ (size_t (DCALL *)(DeeObject *__restrict))&framesymbolsbyname_nsi_getsize,
Expand Down
2 changes: 2 additions & 0 deletions src/deemon/execute/module_globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,8 @@ PRIVATE struct type_seq modglobals_seq = {
/* .tp_nsi = */ &modglobals_nsi,
/* .tp_foreach = */ NULL, /* TODO */
/* .tp_foreach_pair = */ NULL,
/* .tp_enumerate = */ NULL,
/* .tp_enumerate_index = */ NULL,
/* .tp_bounditem = */ NULL,
/* .tp_hasitem = */ NULL,
/* .tp_size = */ (size_t (DCALL *)(DeeObject *__restrict))&modglobals_nsi_getsize,
Expand Down
2 changes: 2 additions & 0 deletions src/deemon/objects/bytes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1475,6 +1475,8 @@ PRIVATE struct type_seq bytes_seq = {
/* .tp_nsi = */ &bytes_nsi,
/* .tp_foreach = */ (Dee_ssize_t (DCALL *)(DeeObject *__restrict, Dee_foreach_t, void *))&bytes_foreach,
/* .tp_foreach_pair = */ NULL,
/* .tp_enumerate = */ NULL,
/* .tp_enumerate_index = */ NULL,
/* .tp_bounditem = */ NULL,
/* .tp_hasitem = */ NULL,
/* .tp_size = */ (size_t (DCALL *)(DeeObject *__restrict))&bytes_size,
Expand Down
2 changes: 2 additions & 0 deletions src/deemon/objects/cached-dict.c
Original file line number Diff line number Diff line change
Expand Up @@ -1268,6 +1268,8 @@ PRIVATE struct type_seq cdict_seq = {
/* .tp_nsi = */ &cdict_nsi,
/* .tp_foreach = */ (Dee_ssize_t (DCALL *)(DeeObject *__restrict, Dee_foreach_t, void *))&cdict_foreach,
/* .tp_foreach_pair = */ (Dee_ssize_t (DCALL *)(DeeObject *__restrict, Dee_foreach_pair_t, void *))&cdict_foreach_pair,
/* .tp_enumerate = */ NULL,
/* .tp_enumerate_index = */ NULL,
/* .tp_bounditem = */ (int (DCALL *)(DeeObject *, DeeObject *))&cdict_bounditem,
/* .tp_hasitem = */ NULL,
/* .tp_size = */ (size_t (DCALL *)(DeeObject *__restrict))&cdict_size,
Expand Down
6 changes: 6 additions & 0 deletions src/deemon/objects/class_desc.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,8 @@ PRIVATE struct type_seq cot_seq = {
/* .tp_nsi = */ &cot_nsi,
/* .tp_foreach = */ NULL,
/* .tp_foreach_pair = */ (Dee_ssize_t (DCALL *)(DeeObject *__restrict, Dee_foreach_pair_t, void *))&cot_foreach_pair,
/* .tp_enumerate = */ NULL,
/* .tp_enumerate_index = */ NULL,
/* .tp_bounditem = */ NULL,
/* .tp_hasitem = */ NULL,
/* .tp_size = */ (size_t (DCALL *)(DeeObject *__restrict))&cot_size,
Expand Down Expand Up @@ -1078,6 +1080,8 @@ PRIVATE struct type_seq cat_seq = {
/* .tp_nsi = */ &cat_nsi,
/* .tp_foreach = */ NULL,
/* .tp_foreach_pair = */ (Dee_ssize_t (DCALL *)(DeeObject *__restrict, Dee_foreach_pair_t, void *))&cat_foreach_pair,
/* .tp_enumerate = */ NULL,
/* .tp_enumerate_index = */ NULL,
/* .tp_bounditem = */ NULL,
/* .tp_hasitem = */ NULL,
/* .tp_size = */ (size_t (DCALL *)(DeeObject *__restrict))&cat_size,
Expand Down Expand Up @@ -2616,6 +2620,8 @@ PRIVATE struct type_seq ot_seq = {
/* .tp_nsi = */ &ot_nsi,
/* .tp_foreach = */ (Dee_ssize_t (DCALL *)(DeeObject *__restrict, Dee_foreach_t, void *))&ot_foreach,
/* .tp_foreach_pair = */ NULL,
/* .tp_enumerate = */ NULL,
/* .tp_enumerate_index = */ NULL,
/* .tp_bounditem = */ NULL,
/* .tp_hasitem = */ NULL,
/* .tp_size = */ (size_t (DCALL *)(DeeObject *__restrict))&ot_size,
Expand Down
2 changes: 2 additions & 0 deletions src/deemon/objects/dict.c
Original file line number Diff line number Diff line change
Expand Up @@ -2522,6 +2522,8 @@ PRIVATE struct type_seq dict_seq = {
/* .tp_nsi = */ &dict_nsi,
/* .tp_foreach = */ NULL,
/* .tp_foreach_pair = */ (Dee_ssize_t (DCALL *)(DeeObject *__restrict, Dee_foreach_pair_t, void *))&dict_foreach,
/* .tp_enumerate = */ NULL,
/* .tp_enumerate_index = */ NULL,
/* .tp_bounditem = */ (int (DCALL *)(DeeObject *, DeeObject *))&dict_bounditem,
/* .tp_hasitem = */ (int (DCALL *)(DeeObject *, DeeObject *))&dict_hasitem,
/* .tp_size = */ (size_t (DCALL *)(DeeObject *__restrict))&dict_size,
Expand Down
8 changes: 8 additions & 0 deletions src/deemon/objects/dictproxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,8 @@ PRIVATE struct type_seq proxy_seq = {
/* .tp_nsi = */ NULL,
/* .tp_foreach = */ NULL,
/* .tp_foreach_pair = */ NULL,
/* .tp_enumerate = */ NULL,
/* .tp_enumerate_index = */ NULL,
/* .tp_bounditem = */ NULL,
/* .tp_hasitem = */ NULL,
/* .tp_size = */ (size_t (DCALL *)(DeeObject *__restrict))&proxy_size,
Expand Down Expand Up @@ -805,6 +807,8 @@ PRIVATE struct type_seq dict_keys_seq = {
/* .tp_nsi = */ NULL,
/* .tp_foreach = */ (Dee_ssize_t (DCALL *)(DeeObject *__restrict, Dee_foreach_t, void *))&dict_keys_foreach,
/* .tp_foreach_pair = */ NULL,
/* .tp_enumerate = */ NULL,
/* .tp_enumerate_index = */ NULL,
/* .tp_bounditem = */ NULL,
/* .tp_hasitem = */ NULL,
/* .tp_size = */ (size_t (DCALL *)(DeeObject *__restrict))&proxy_size,
Expand Down Expand Up @@ -850,6 +854,8 @@ PRIVATE struct type_seq dict_items_seq = {
/* .tp_foreach = */ NULL,
/* .tp_nsi = */ NULL,
/* .tp_foreach_pair = */ (Dee_ssize_t (DCALL *)(DeeObject *__restrict, Dee_foreach_pair_t, void *))&dict_items_foreach,
/* .tp_enumerate = */ NULL,
/* .tp_enumerate_index = */ NULL,
/* .tp_bounditem = */ NULL,
/* .tp_hasitem = */ NULL,
/* .tp_size = */ (size_t (DCALL *)(DeeObject *__restrict))&proxy_size,
Expand Down Expand Up @@ -895,6 +901,8 @@ PRIVATE struct type_seq dict_values_seq = {
/* .tp_nsi = */ NULL,
/* .tp_foreach = */ (Dee_ssize_t (DCALL *)(DeeObject *__restrict, Dee_foreach_t, void *))&dict_values_foreach,
/* .tp_foreach_pair = */ NULL,
/* .tp_enumerate = */ NULL,
/* .tp_enumerate_index = */ NULL,
/* .tp_bounditem = */ NULL,
/* .tp_hasitem = */ NULL,
/* .tp_size = */ (size_t (DCALL *)(DeeObject *__restrict))&proxy_size,
Expand Down
2 changes: 2 additions & 0 deletions src/deemon/objects/gc_inspect.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ PRIVATE struct type_seq gcset_seq = {
/* .tp_nsi = */ NULL,
/* .tp_foreach = */ NULL,
/* .tp_foreach_pair = */ NULL,
/* .tp_enumerate = */ NULL,
/* .tp_enumerate_index = */ NULL,
/* .tp_bounditem = */ NULL,
/* .tp_hasitem = */ NULL,
/* .tp_size = */ (size_t (DCALL *)(DeeObject *__restrict))&gcset_size,
Expand Down
2 changes: 2 additions & 0 deletions src/deemon/objects/hashset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1872,6 +1872,8 @@ PRIVATE struct type_seq hashset_seq = {
/* .tp_nsi = */ &hashset_nsi,
/* .tp_foreach = */ (Dee_ssize_t (DCALL *)(DeeObject *__restrict, Dee_foreach_t, void *))&hashset_foreach,
/* .tp_foreach_pair = */ NULL,
/* .tp_enumerate = */ NULL,
/* .tp_enumerate_index = */ NULL,
/* .tp_bounditem = */ NULL,
/* .tp_hasitem = */ NULL,
/* .tp_size = */ (size_t (DCALL *)(DeeObject *__restrict))&hashset_size,
Expand Down
2 changes: 2 additions & 0 deletions src/deemon/objects/list.c
Original file line number Diff line number Diff line change
Expand Up @@ -2385,6 +2385,8 @@ PRIVATE struct type_seq list_seq = {
/* .tp_nsi = */ &list_nsi,
/* .tp_foreach = */ (Dee_ssize_t (DCALL *)(DeeObject *__restrict, Dee_foreach_t, void *))&list_foreach,
/* .tp_foreach_pair = */ NULL,
/* .tp_enumerate = */ NULL,
/* .tp_enumerate_index = */ NULL,
/* .tp_bounditem = */ NULL, /* default */
/* .tp_hasitem = */ NULL, /* default */
/* .tp_size = */ (size_t (DCALL *)(DeeObject *__restrict))&list_size,
Expand Down
Loading

0 comments on commit aead1b9

Please sign in to comment.