18 Apr
2022
18 Apr
'22
5:48 p.m.
You can achieve this without `@sealed` by changing Coin -> BaseCoin, and adding `Coin = Nickle | Dime | Quarter`.
Exactly. This is the pattern I use extensively in my code, and I find it to be very robust, easy to understand, and easy to maintain.
you can't put Coin in another Union and match on it because Unions do not implement isinstance
If all of the classes in the union derive from the same base class, you can use the base class for the `isinstance` check or case statement.