diff options
| author | Casey Dahlin <cdahlin@redhat.com> | 2008-12-23 11:48:17 -0500 |
|---|---|---|
| committer | Casey Dahlin <cdahlin@redhat.com> | 2008-12-23 11:48:17 -0500 |
| commit | de2f7051649b01978bc02d105400548dcb4a7e4d (patch) | |
| tree | 800bc9a9031ec867b7403e6f3f921a9ba37b72fc | |
| parent | f5b2fc6b601036b529e5c18d860e92c5ba467277 (diff) | |
| download | upstate-de2f7051649b01978bc02d105400548dcb4a7e4d.tar.gz upstate-de2f7051649b01978bc02d105400548dcb4a7e4d.tar.xz upstate-de2f7051649b01978bc02d105400548dcb4a7e4d.zip | |
Add full() method to pattern
| -rw-r--r-- | pattern.py | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 |
