Mercurial > magic
annotate functools.total_ordering @ 244:eee52d5a4af8 default tip
created
| author | 127.0.0.1 |
|---|---|
| date | Sun, 30 Jun 2013 11:08:33 +0200 |
| parents | feaebfdde7fa |
| children |
| rev | line source |
|---|---|
| 69 | 1 {{{#!python |
| 2 @functools.total_ordering | |
| 3 class Student: | |
| 4 def __eq__(self, other): | |
| 5 return ((self.lastname.lower(), self.firstname.lower()) == | |
| 6 (other.lastname.lower(), other.firstname.lower())) | |
| 7 def __lt__(self, other): | |
| 8 return ((self.lastname.lower(), self.firstname.lower()) < | |
| 9 (other.lastname.lower(), other.firstname.lower())) | |
| 10 }}} |
