Adds a named "wildcard" pattern that can match anything.

Inherits From: Pattern

name A str name for the Var. When the Var is successfully matched to an expression, a new binding (name-expression pair) will be created in the bindings for subsequent matches. If name is None, no binding will be created.
restrictions An optional sequence of predicate functions that take in the expression to be matched against and return a bool. The match is only successful if all predicate functions return True. By default, restrictions is empty, so a Var will match any expression.



View source


View source


restrictions ()