[docs]defis_match(pattern:Pattern[str])->Predicate[str]:""" Create a new predicate that succeeds when the start of its argument matches the given ``pattern``. """@bind_name(is_match,pattern.pattern)defmatch(instance:str)->bool:returnpattern.match(instance)isnotNonereturnmatch
[docs]defis_full_match(pattern:Pattern[str])->Predicate[str]:""" Create a new predicate that succeeds when its whole argument matches the given ``pattern``. """@bind_name(is_full_match,pattern.pattern)deffull_match(instance:str)->bool:returnpattern.fullmatch(instance)isnotNonereturnfull_match