diff options
author | blackbird <devnull@localhost> | 2006-12-21 22:10:34 +0100 |
---|---|---|
committer | blackbird <devnull@localhost> | 2006-12-21 22:10:34 +0100 |
commit | f86e5908ca4c35bcbe8fe25ba839ff5c9a7a9f34 (patch) | |
tree | 98237a777c718b58116b68e7643c79e76acf10f8 /pygments/token.py | |
parent | 95377ce6c229ec8cb1df8e358337fc524b8476c8 (diff) | |
download | pygments-f86e5908ca4c35bcbe8fe25ba839ff5c9a7a9f34.tar.gz |
[svn] implemented filters for pygments (first approach, api might change), it's impossible at the moment to add filters by using pygmentize
Diffstat (limited to 'pygments/token.py')
-rw-r--r-- | pygments/token.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pygments/token.py b/pygments/token.py index f9ab7442..64c67be4 100644 --- a/pygments/token.py +++ b/pygments/token.py @@ -21,6 +21,12 @@ class _TokenType(tuple): buf.reverse() return buf + def __contains__(self, val): + return self is val or ( + type(val) is self.__class__ and + val[:len(self)] == self + ) + def __getattr__(self, val): if not val or not val[0].isupper(): return tuple.__getattr__(self, val) |