> (match '(1 2 3) [(list a b c) (list c b a)])
'(3 2 1)
> (match '(1 2 3) [(list 1 a ...) a])
'(2 3)
> (match '(1 2 3)
[(list 1 a ..3) a]
[_ 'else])
'else
> (match '(1 2 3 4)
[(list 1 a ..3) a]
[_ 'else])
'(2 3 4)
> (match '(1 2 3 4 5)
[(list 1 a ..3 5) a]
[_ 'else])
'(2 3 4)
> (match '(1 (2) (2) (2) 5)
[(list 1 (list a) ..3 5) a]
[_ 'else])
'(2 2 2)
在 Python 中是否有类似的语法糖或库可以做到这一点?