{"action":"created","issue":{"url":"https://api.github.com/repos/sympy/sympy/issues/11447","repository_url":"https://api.github.com/repos/sympy/sympy","labels_url":"https://api.github.com/repos/sympy/sympy/issues/11447/labels{/name}","comments_url":"https://api.github.com/repos/sympy/sympy/issues/11447/comments","events_url":"https://api.github.com/repos/sympy/sympy/issues/11447/events","html_url":"https://github.com/sympy/sympy/issues/11447","id":168357710,"number":11447,"title":"Poly.subs() returns an expression instead of a Polynomial","user":{"login":"moorepants","id":276007,"avatar_url":"https://avatars.githubusercontent.com/u/276007?v=3","gravatar_id":"","url":"https://api.github.com/users/moorepants","html_url":"https://github.com/moorepants","followers_url":"https://api.github.com/users/moorepants/followers","following_url":"https://api.github.com/users/moorepants/following{/other_user}","gists_url":"https://api.github.com/users/moorepants/gists{/gist_id}","starred_url":"https://api.github.com/users/moorepants/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moorepants/subscriptions","organizations_url":"https://api.github.com/users/moorepants/orgs","repos_url":"https://api.github.com/users/moorepants/repos","events_url":"https://api.github.com/users/moorepants/events{/privacy}","received_events_url":"https://api.github.com/users/moorepants/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-29T16:00:17Z","updated_at":"2016-07-29T16:46:41Z","closed_at":null,"body":"Shouldn't subs() return the same type of object that it is called on? See below:\r\n\r\n```\r\nmoorepants@garuda:src(master)$ ipython\r\nPython 3.5.2 |Continuum Analytics, Inc.| (default, Jul  2 2016, 17:53:06) \r\nType \"copyright\", \"credits\" or \"license\" for more information.\r\n\r\nIPython 5.0.0 -- An enhanced Interactive Python.\r\n?         -> Introduction and overview of IPython's features.\r\n%quickref -> Quick reference.\r\nhelp      -> Python's own help system.\r\nobject?   -> Details about 'object', use 'object??' for extra details.\r\n\r\nIn [1]: from sympy import *\r\n\r\nIn [2]: from sympy.abc import x\r\n\r\nIn [3]: from sympy.abc import x, a\r\n\r\nIn [4]: p = Poly(x**2 + a * x + 4, x)\r\n\r\nIn [5]: p\r\nOut[5]: Poly(x**2 + a*x + 4, x, domain='ZZ[a]')\r\n\r\nIn [6]: p.subs(a, 2)\r\nOut[6]: x**2 + 2*x + 4\r\n\r\nIn [8]: type(p.subs(a, 2))\r\nOut[8]: sympy.core.add.Add\r\n``"},"comment":{"url":"https://api.github.com/repos/sympy/sympy/issues/comments/236231949","html_url":"https://github.com/sympy/sympy/issues/11447#issuecomment-236231949","issue_url":"https://api.github.com/repos/sympy/sympy/issues/11447","id":236231949,"user":{"login":"jksuom","id":6929119,"avatar_url":"https://avatars.githubusercontent.com/u/6929119?v=3","gravatar_id":"","url":"https://api.github.com/users/jksuom","html_url":"https://github.com/jksuom","followers_url":"https://api.github.com/users/jksuom/followers","following_url":"https://api.github.com/users/jksuom/following{/other_user}","gists_url":"https://api.github.com/users/jksuom/gists{/gist_id}","starred_url":"https://api.github.com/users/jksuom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jksuom/subscriptions","organizations_url":"https://api.github.com/users/jksuom/orgs","repos_url":"https://api.github.com/users/jksuom/repos","events_url":"https://api.github.com/users/jksuom/events{/privacy}","received_events_url":"https://api.github.com/users/jksuom/received_events","type":"User","site_admin":false},"created_at":"2016-07-29T16:46:41Z","updated_at":"2016-07-29T16:46:41Z","body":"It seems that polynomials do not currently support substitutions into their coefficient rings. (Ring homomorphisms should be implemented.) But if `a` is elevated to a generator, then substitution should work.\r\n```\r\nIn [2]: p = Poly(x**2 + a * x + 4)\r\n\r\nIn [3]: p\r\nOut[3]: Poly(x**2 + x*a + 4, x, a, domain='ZZ')\r\n\r\nIn [4]: p.subs(a, 2)\r\nOut[4]: Poly(x**2 + 2*x + 4, x, domain='ZZ')\r\n```\r\n"}}
{"actor":{"display_login":"jksuom"}}