Skip to content

Commit 839b4fc

Browse files
committed
Add tests for calling all sq and mp slots
1 parent 724fed2 commit 839b4fc

File tree

2 files changed

+331
-78
lines changed

2 files changed

+331
-78
lines changed

graalpython/com.oracle.graal.python.test/src/tests/cpyext/__init__.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
22
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33
#
44
# The Universal Permissive License (UPL), Version 1.0
@@ -650,19 +650,22 @@ def CPyExtTypeDecl(name, code='', **kwargs):
650650
}};
651651
652652
static PySequenceMethods {name}_sequence_methods = {{
653-
{sq_length}, /* sq_length */
654-
{sq_concat}, /* sq_concat */
655-
0, /* sq_repeat */
656-
{sq_item}, /* sq_item */
657-
0, /* sq_slice */
658-
{sq_ass_item}, /* sq_ass_item */
659-
0, /* sq_ass_slice */
660-
{sq_contains}, /* sq_contains */
653+
{sq_length}, /* sq_length */
654+
{sq_concat}, /* sq_concat */
655+
{sq_repeat}, /* sq_repeat */
656+
{sq_item}, /* sq_item */
657+
0, /* was_sq_slice */
658+
{sq_ass_item}, /* sq_ass_item */
659+
0, /* was_sq_ass_slice */
660+
{sq_contains}, /* sq_contains */
661+
{sq_inplace_concat}, /* sq_inplace_concat */
662+
{sq_inplace_repeat}, /* sq_inplace_repeat */
661663
}};
662664
663665
static PyMappingMethods {name}_mapping_methods = {{
664666
{mp_length}, /* mp_length */
665667
{mp_subscript}, /* mp_subscript */
668+
{mp_ass_subscript}, /* mp_subscript */
666669
}};
667670
668671
static struct PyMethodDef {name}_methods[] = {{

0 commit comments

Comments
 (0)