{"action":"created","issue":{"url":"https://api.github.com/repos/lkardos/test/issues/246","labels_url":"https://api.github.com/repos/lkardos/test/issues/246/labels{/name}","comments_url":"https://api.github.com/repos/lkardos/test/issues/246/comments","events_url":"https://api.github.com/repos/lkardos/test/issues/246/events","html_url":"https://github.com/lkardos/test/issues/246","id":71643513,"number":246,"title":"Make hdr values comparable with python3","user":{"login":"lkardos","id":7781878,"avatar_url":"https://avatars.githubusercontent.com/u/7781878?v=3","gravatar_id":"","url":"https://api.github.com/users/lkardos","html_url":"https://github.com/lkardos","followers_url":"https://api.github.com/users/lkardos/followers","following_url":"https://api.github.com/users/lkardos/following{/other_user}","gists_url":"https://api.github.com/users/lkardos/gists{/gist_id}","starred_url":"https://api.github.com/users/lkardos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lkardos/subscriptions","organizations_url":"https://api.github.com/users/lkardos/orgs","repos_url":"https://api.github.com/users/lkardos/repos","events_url":"https://api.github.com/users/lkardos/events{/privacy}","received_events_url":"https://api.github.com/users/lkardos/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"lkardos","id":7781878,"avatar_url":"https://avatars.githubusercontent.com/u/7781878?v=3","gravatar_id":"","url":"https://api.github.com/users/lkardos","html_url":"https://github.com/lkardos","followers_url":"https://api.github.com/users/lkardos/followers","following_url":"https://api.github.com/users/lkardos/following{/other_user}","gists_url":"https://api.github.com/users/lkardos/gists{/gist_id}","starred_url":"https://api.github.com/users/lkardos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lkardos/subscriptions","organizations_url":"https://api.github.com/users/lkardos/orgs","repos_url":"https://api.github.com/users/lkardos/repos","events_url":"https://api.github.com/users/lkardos/events{/privacy}","received_events_url":"https://api.github.com/users/lkardos/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-04-28T16:49:59Z","updated_at":"2015-04-28T16:50:01Z","closed_at":"2015-04-28T16:50:01Z","body":"With python 2_ rpm.hdr objects can be compared so that for example a list of hdrs can be sorted with  {{{  hdrs.sort(key = lambda x: (x[rpm.RPMTAG_NAME]_ x))  }}}  This no longer works with python 3_ it barfs:  {{{  unorderable types: rpm.hdr() < rpm.hdr() (from x)  }}}  Adding the {{{__lt__}}} method to hdr would fix it. Currently I'm using a wrapper object that defines it:  {{{  class myhdr(rpm.hdr):      def __lt__(self_ other):          return rpm.versionCompare(self_ other) < 0  }}}"},"comment":{"url":"https://api.github.com/repos/lkardos/test/issues/comments/97134975","html_url":"https://github.com/lkardos/test/issues/246#issuecomment-97134975","issue_url":"https://api.github.com/repos/lkardos/test/issues/246","id":97134975,"user":{"login":"lkardos","id":7781878,"avatar_url":"https://avatars.githubusercontent.com/u/7781878?v=3","gravatar_id":"","url":"https://api.github.com/users/lkardos","html_url":"https://github.com/lkardos","followers_url":"https://api.github.com/users/lkardos/followers","following_url":"https://api.github.com/users/lkardos/following{/other_user}","gists_url":"https://api.github.com/users/lkardos/gists{/gist_id}","starred_url":"https://api.github.com/users/lkardos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lkardos/subscriptions","organizations_url":"https://api.github.com/users/lkardos/orgs","repos_url":"https://api.github.com/users/lkardos/repos","events_url":"https://api.github.com/users/lkardos/events{/privacy}","received_events_url":"https://api.github.com/users/lkardos/received_events","type":"User","site_admin":false},"created_at":"2015-04-28T16:50:00Z","updated_at":"2015-04-28T16:50:00Z","body":"_Trac comment by FlorianFesti on 2015-04-24 11:41:21:_\n\nSorry_ but you are doing it wrong! Just use    hdrs.sort(key = lambda x: (x[rpm.RPMTAG_NAME]_ x[rpm.RPMTAG_EPOCH]_ x[rpm.RPMTAG_VERSION]_ x[rpm.RPMTAG_RELEASE]))    This way the header object is not actually used in the comparison. Alternativly you use a custom compare function."}}