I sort of understand this, at least the function of generators (I\'ve used them in Python). I understand how the switch statement and its content is formed. However, I get these errors.
I\'m looking for a way to reverse a generator object. I know how to reverse sequences: foo = imap(seq.__getitem__, xrange(len(seq)-1, -1, -1))
I have implemented a generator-based scanner in Python that tokenizes a string into tuples of the form (token type, token value):开发者_JAVA技巧