{"action":"created","issue":{"url":"https://api.github.com/repos/shedskin/shedskin/issues/92","labels_url":"https://api.github.com/repos/shedskin/shedskin/issues/92/labels{/name}","comments_url":"https://api.github.com/repos/shedskin/shedskin/issues/92/comments","events_url":"https://api.github.com/repos/shedskin/shedskin/issues/92/events","html_url":"https://github.com/shedskin/shedskin/issues/92","id":65272013,"number":92,"title":"Subclasses fail type conversion","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/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":15,"created_at":"2015-03-30T18:28:09Z","updated_at":"2015-03-30T18:29:31Z","closed_at":null,"body":"**Issue by uran...@gmail.com**\n_19 Aug 2010 at 5:52 GMT_\n_Originally opened on Google Code_\n\n----\n\n```\nThe test case is rather a lot of code at the moment.  If you actually need one, \nlet me know and I'll get you one, but reducing it is a bit of a pain, and I'm \nhoping this will be enough info to see the problem without an actual repro.\n\nWhen you've got multiple subclasses, say Tri and Sphere, deriving from a parent \ntype, Shape, and a function that takes a list of T (for example, [sphere0, \nsphere1, tri0, tri1]), you'll get \"error in conversion to Shed Skin (Shape \nexpected)\".  It looks like the conversion function __to_ss() just doesn't \nacknowledge inheritance at all.  Here's the generated function:\n\ntemplate<> __Shape__::Shape *__to_ss(PyObject *p) {\n    if(p == Py_None) return NULL;\n    if(p->ob_type != &__Shape__::ShapeObjectType)\n        throw new TypeError(new str(\"error in conversion to Shed Skin (Shape expected)\"));\n    return ((__Shape__::ShapeObject *)p)->__ss_object;\n}\n\nBy changing the error string to p->ob_type->tp_name, I've verified that I'm \nactually passing in the subclass Sphere when the error happens.\n\nPerhaps you can maintain the type tree and walk up it when doing this check?\n```\n\n\n"},"comment":{"url":"https://api.github.com/repos/shedskin/shedskin/issues/comments/87781573","html_url":"https://github.com/shedskin/shedskin/issues/92#issuecomment-87781573","issue_url":"https://api.github.com/repos/shedskin/shedskin/issues/92","id":87781573,"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-30T18:29:31Z","updated_at":"2015-03-30T18:29:31Z","body":"**Comment by [Mark Dufour](/srepmub)**\n_7 Sep 2010 at 8:38 GMT_\n\n----\n\n```\nI haven't been able to reproduce the problem, unfortunately. please do send me \nthe files. it's fine if there's a lot of code..\n```\n\n\n\n\n"}}