Raymond Hettinger added the comment:
+1 for m.get(key[, default])
-1 for __contains__
The get() makes logical sense and it is perfectly reasonable to want a default
value for a missing group.
The contains idea makes less sense and is problematic on several fronts. "'a'
in match" only works
Serhiy Storchaka added the comment:
I predicted that that change will open a can of worms.
The match object is not a dictionary. I don't see a need in new methods. The
get() method you propose looks virtually the same as the group() method. "'a'
in match" is virtually the same as
New submission from irdb:
__getitem__ was added to match objects as a resolution of issue24454.
Wouldn't it be nice to also have `__contains__` and `get` methods for match
objects? Is it even feasible to implement them in neat way?
They should work similar to dictionaries, i.e:
```
match =