Mercurial > genshi > genshi-test
diff genshi/path.py @ 822:ce5ad2d540b3
Get rid of some Python 2.3 legacy that's no longer needed now that 2.4 is the baseline.
author | cmlenz |
---|---|
date | Wed, 11 Mar 2009 22:14:32 +0000 |
parents | eab11d35c769 |
children | 04945cd67dad |
line wrap: on
line diff
--- a/genshi/path.py +++ b/genshi/path.py @@ -65,12 +65,12 @@ DESCENDANT_OR_SELF = 'descendant-or-self' SELF = 'self' + @classmethod def forname(cls, name): """Return the axis constant for the given name, or `None` if no such axis was defined. """ return getattr(cls, name.upper().replace('-', '_'), None) - forname = classmethod(forname) ATTRIBUTE = Axis.ATTRIBUTE @@ -674,8 +674,13 @@ # Tokenizer - at_end = property(lambda self: self.pos == len(self.tokens) - 1) - cur_token = property(lambda self: self.tokens[self.pos]) + @property + def at_end(self): + return self.pos == len(self.tokens) - 1 + + @property + def cur_token(self): + return self.tokens[self.pos] def next_token(self): self.pos += 1