From de2f7051649b01978bc02d105400548dcb4a7e4d Mon Sep 17 00:00:00 2001 From: Casey Dahlin Date: Tue, 23 Dec 2008 11:48:17 -0500 Subject: Add full() method to pattern --- pattern.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pattern.py') diff --git a/pattern.py b/pattern.py index 7ff95d8..6b391ad 100644 --- a/pattern.py +++ b/pattern.py @@ -31,6 +31,12 @@ class Pattern: if len(self.items) > 0: return True return False + def full(self): + """ + Returns True if this pattern matches *all* strings. + """ + return self.invert and len(self.items) == 0 + def singular(self): """ Returns True if this pattern will match *exactly one* string -- cgit