class documentation
Better token wrapper for tokenize module.
Example usage: >>> from token import NAME >>> t = Token(NAME, 'foo', (1, 0), (1, 3), 'foo = 1') >>> t.kind 1 >>> t.value 'foo' >>> t.start (1, 0) >>> t.end (1, 3) >>> t.source 'foo = 1' >>> t == NAME True >>> t == 'foo' True >>> t == ['foo'] # Not matching kind+value, returns False False >>> t == None False >>> t.match(NAME, 'foo') True >>> repr(t) "<Token kind='NAME' value='foo'>" >>> t == 3.14 False
| Method | __eq__ |
Undocumented |
| Method | __init__ |
Undocumented |
| Method | __repr__ |
Undocumented |
| Method | match |
Undocumented |
| Instance Variable | end |
Undocumented |
| Instance Variable | kind |
Undocumented |
| Instance Variable | source |
Source line |
| Instance Variable | start |
Undocumented |
| Instance Variable | value |
Undocumented |