Issue #28765: _sre.compile() now checks the type of groupindex and indexgroup
groupindex must a dictionary and indexgroup must be a tuple.
Previously, indexgroup was a list. Use a tuple to reduce the memory usage.
diff --git a/Lib/sre_compile.py b/Lib/sre_compile.py
index 420d83d..2cc3900 100644
--- a/Lib/sre_compile.py
+++ b/Lib/sre_compile.py
@@ -576,5 +576,5 @@
return _sre.compile(
pattern, flags | p.pattern.flags, code,
p.pattern.groups-1,
- groupindex, indexgroup
+ groupindex, tuple(indexgroup)
)