public PyObject groupdict(PyObject[] args, String[] kws) {
ArgParser ap = new ArgParser("groupdict", args, kws, "default");
PyObject def = ap.getPyObject(0, Py.None);
PyObject result = new PyDictionary();
if (pattern.groupindex == null)
return result;
PyObject keys = pattern.groupindex.invoke("keys");
PyObject key;
for (int i = 0; (key = keys.__finditem__(i)) != null; i++) {
PyObject item = getslice(key, def);
result.__setitem__(key, item);
}
return result;
}