Message327933
| Author | serhiy.storchaka |
|---|---|
| Recipients | cykerway, rhettinger, serhiy.storchaka, steven.daprano, tim.peters, xtreak |
| Date | 2018-10-18.04:40:36 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1539837637.09.0.788709270274.issue35010@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
Would be worth to add a wrapper in functools which revert the sorting order?
class reverted_order:
def __init__(self, value):
self.value = value
def __lt__(self, other):
if isinstance(other, reverted_order):
other = other.value
return self.value.__ge__(other)
# __le__, __gt__, __ge__, __eq__, __ne__, __hash__
Then you could use key=lambda x: (x['url'], reverted_order(x['user'])). |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2018-10-18 04:40:37 | serhiy.storchaka | set | recipients: + serhiy.storchaka, tim.peters, rhettinger, steven.daprano, cykerway, xtreak |
| 2018-10-18 04:40:37 | serhiy.storchaka | set | messageid: <1539837637.09.0.788709270274.issue35010@psf.upfronthosting.co.za> |
| 2018-10-18 04:40:37 | serhiy.storchaka | link | issue35010 messages |
| 2018-10-18 04:40:36 | serhiy.storchaka | create | |