Here's what I'm doing now:
@memoized
def reversed_matching(matching_cls):
class ReversedMatching(ReversedSequenceMatching):
def __init__(self, *args, **kwargs):
super().__init__(matching_cls, *args, **kwargs)
return ReversedMatching
I want to bind one argument of a class and return the “partial class”. I can't use functools.partial
because that can't be used with isinstance
and issubclass
and the like. Is there a nicer way to write this?