In python - a final class is a class that other classes can't inherit from because of various reasons(for example - bool class should always have only 2 instances - true or false).
However - in my case, I want to inherit from re.Match (the regex Match class). the thing is that this class is written in c and apparently the Py_TPFLAGS_BASETYPE
flag is not enabled in the c-python implementation of this class.
if i would try:
class Region(re.Match): # Error: type 're.Match' is not an acceptable base type
...
I'm not sure why this flag isn't enabled in this case but it could be great if I could at least try and not be restricted by a flag.
there is a pythonic way to prohibit inheritance(see) but is there a python way to allow inheritence?
I can try to solve it by enabling this flag in the c implementation but I want to avoid it.
I can also try rerefer each needed method and attribute by hand to inner match:re.Match variable(want to avoid this also).
I'm looking for a more 'Pythonic' solution. any ideas?