pampy icon indicating copy to clipboard operation
pampy copied to clipboard

Possibilty to match same object

Open sunbit opened this issue 4 years ago • 0 comments

Matching an instance of a class against it's class works perfectly but i just realied that you cannot match with the class itself:

class Marker: pass
match({"my_marker": Marker}, {"my_marker": Marker}, lambda x: print('MATCH'))

I think this should be a valid match right? Looking at the code at

https://github.com/santinic/pampy/blob/master/pampy/pampy.py#L59

seems like here we should add a check based on

inspect.isclass

What do you think?

sunbit avatar Aug 31 '20 13:08 sunbit