47 return mctx.matcher([x]) |
47 return mctx.matcher([x]) |
48 |
48 |
49 def kindpatmatch(mctx, x, y): |
49 def kindpatmatch(mctx, x, y): |
50 return stringmatch(mctx, _getkindpat(x, y, matchmod.allpatternkinds, |
50 return stringmatch(mctx, _getkindpat(x, y, matchmod.allpatternkinds, |
51 _("pattern must be a string"))) |
51 _("pattern must be a string"))) |
|
52 |
|
53 def patternsmatch(mctx, *xs): |
|
54 allkinds = matchmod.allpatternkinds |
|
55 patterns = [getpattern(x, allkinds, _("pattern must be a string")) |
|
56 for x in xs] |
|
57 return mctx.matcher(patterns) |
52 |
58 |
53 def andmatch(mctx, x, y): |
59 def andmatch(mctx, x, y): |
54 xm = getmatch(mctx, x) |
60 xm = getmatch(mctx, x) |
55 ym = getmatch(mctx, y) |
61 ym = getmatch(mctx, y) |
56 return matchmod.intersectmatchers(xm, ym) |
62 return matchmod.intersectmatchers(xm, ym) |