Pattern Matching for Python 3.7+ in a simple, yet powerful, extensible manner.
MatchContext.match
matches collection patterns if type matches exactlyrange
as a patterntypefoo
module (Parameters
, KwArgs
, VarArgs
, see tests)Attrs
typefoo
module, everything has 100% branch and line coveragecaptureall
argument to match
Capture
patternsMatch
can now propagate match-options toocase
and of
accept match-options_
in keys won't lock the matched key to the value pattern (this is a more intuitive behavior)match
style (compatible with pampy)bind_groups
to Regex
argresult=
kwarg to match
- MatchResult
now implements __getattr__
by default.bind()
to MatchResult
for having a nicer API experience in Python 3.7 which lacks :=
Truish()
is not IsTruish
MatchResult
inherit from collections.Mapping
such that it can be used as **kwargs