Modular Pattern Matching In Python