summaryrefslogtreecommitdiffstats
path: root/Tools/clinic/clinic.py
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/clinic/clinic.py')
-rwxr-xr-xTools/clinic/clinic.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py
index 3d51c1d..55faf1e 100755
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -2659,6 +2659,18 @@ class Py_ssize_t_converter(CConverter):
c_ignored_default = "0"
+class slice_index_converter(CConverter):
+ type = 'Py_ssize_t'
+
+ def converter_init(self, *, accept={int, NoneType}):
+ if accept == {int}:
+ self.converter = '_PyEval_SliceIndex'
+ elif accept == {int, NoneType}:
+ self.converter = '_PyEval_SliceIndexOrNone'
+ else:
+ fail("slice_index_converter: illegal 'accept' argument " + repr(accept))
+
+
class float_converter(CConverter):
type = 'float'
default_type = float