Pampy supports Python 3.7 dataclasses. You can pass the operator `_` as arguments and it will match those fields.
python
dataclass
class Pet:
name: str
age: int
pet = Pet('rover', 7)
match(pet, Pet('rover', _), lambda age: age) => 7
match(pet, Pet(_, 7), lambda name: name) => 'rover'
match(pet, Pet(_, _), lambda name, age: (name, age)) => ('rover', 7)