{"action":"created","issue":{"url":"https://api.github.com/repos/shedskin/shedskin/issues/147","labels_url":"https://api.github.com/repos/shedskin/shedskin/issues/147/labels{/name}","comments_url":"https://api.github.com/repos/shedskin/shedskin/issues/147/comments","events_url":"https://api.github.com/repos/shedskin/shedskin/issues/147/events","html_url":"https://github.com/shedskin/shedskin/issues/147","id":65293522,"number":147,"title":"cmp() fallback to rich comparison operators","user":{"login":"ShedskinBot","id":11687421,"avatar_url":"https://avatars.githubusercontent.com/u/11687421?v=3","gravatar_id":"","url":"https://api.github.com/users/ShedskinBot","html_url":"https://github.com/ShedskinBot","followers_url":"https://api.github.com/users/ShedskinBot/followers","following_url":"https://api.github.com/users/ShedskinBot/following{/other_user}","gists_url":"https://api.github.com/users/ShedskinBot/gists{/gist_id}","starred_url":"https://api.github.com/users/ShedskinBot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShedskinBot/subscriptions","organizations_url":"https://api.github.com/users/ShedskinBot/orgs","repos_url":"https://api.github.com/users/ShedskinBot/repos","events_url":"https://api.github.com/users/ShedskinBot/events{/privacy}","received_events_url":"https://api.github.com/users/ShedskinBot/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/shedskin/shedskin/labels/auto-migrated","name":"auto-migrated","color":"ededed"},{"url":"https://api.github.com/repos/shedskin/shedskin/labels/milestone-0.9","name":"milestone-0.9","color":"ededed"},{"url":"https://api.github.com/repos/shedskin/shedskin/labels/Priority-Medium","name":"Priority-Medium","color":"ededed"},{"url":"https://api.github.com/repos/shedskin/shedskin/labels/Type-Defect","name":"Type-Defect","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-30T20:18:27Z","updated_at":"2015-03-30T20:18:44Z","closed_at":null,"body":"**Issue by jason.mi...@gmail.com**\n_16 Jul 2011 at 8:26 GMT_\n_Originally opened on Google Code_\n\n----\n\n```\nimplement the sort semantics of class obj through the __lt__ method.\nIt's quite common to sort complex obj list\n\ntest case:\n\nclass inst(object):\n\tdef __init__(self, num, opcode='add', pc='1'):\n\t\tself.opcode = opcode\n\t\tself.pc = pc\n\t\tself.num = num\n\t\n\tdef __lt__( self, other):\n\t\treturn self.num < other.num\n\n\tdef __repr__(self):\t\n\t\treturn \"%d\" % self.num\n\t\t\nSeq = [inst(3),inst(1),inst(4),inst(2)]\nprint Seq\nprint sorted(Seq)\n\n\nPython output:\n[3, 1, 4, 2]\n[1, 2, 3, 4]\n\n```\n\n\n"},"comment":{"url":"https://api.github.com/repos/shedskin/shedskin/issues/comments/87817268","html_url":"https://github.com/shedskin/shedskin/issues/147#issuecomment-87817268","issue_url":"https://api.github.com/repos/shedskin/shedskin/issues/147","id":87817268,"user":{"login":"ShedskinBot","id":11687421,"avatar_url":"https://avatars.githubusercontent.com/u/11687421?v=3","gravatar_id":"","url":"https://api.github.com/users/ShedskinBot","html_url":"https://github.com/ShedskinBot","followers_url":"https://api.github.com/users/ShedskinBot/followers","following_url":"https://api.github.com/users/ShedskinBot/following{/other_user}","gists_url":"https://api.github.com/users/ShedskinBot/gists{/gist_id}","starred_url":"https://api.github.com/users/ShedskinBot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShedskinBot/subscriptions","organizations_url":"https://api.github.com/users/ShedskinBot/orgs","repos_url":"https://api.github.com/users/ShedskinBot/repos","events_url":"https://api.github.com/users/ShedskinBot/events{/privacy}","received_events_url":"https://api.github.com/users/ShedskinBot/received_events","type":"User","site_admin":false},"created_at":"2015-03-30T20:18:44Z","updated_at":"2015-03-30T20:18:44Z","body":"**Comment by [Mark Dufour](/srepmub)**\n_16 Jul 2011 at 11:01 GMT_\n\n----\n\n\n\n\n* Changed state: **Accepted**\n* Added labels: **milestone-0.9**\n\n"}}