示例#1
0
    def test_placeholder_with_operator(self):
        match = Match("python")

        @match.when(_.isdigit(), let_="moo")
        def case1(moo):
            return moo

        @match.when(_ == "python", let_=("a"))
        def case2(a):
            return a

        self.assertEqual(match.end, "python")