{"action":"created","issue":{"url":"https://api.github.com/repos/ipython/ipywidgets/issues/238","labels_url":"https://api.github.com/repos/ipython/ipywidgets/issues/238/labels{/name}","comments_url":"https://api.github.com/repos/ipython/ipywidgets/issues/238/comments","events_url":"https://api.github.com/repos/ipython/ipywidgets/issues/238/events","html_url":"https://github.com/ipython/ipywidgets/issues/238","id":116666296,"number":238,"title":"Improve @interact API","user":{"login":"jdemeyer","id":3625785,"avatar_url":"https://avatars.githubusercontent.com/u/3625785?v=3","gravatar_id":"","url":"https://api.github.com/users/jdemeyer","html_url":"https://github.com/jdemeyer","followers_url":"https://api.github.com/users/jdemeyer/followers","following_url":"https://api.github.com/users/jdemeyer/following{/other_user}","gists_url":"https://api.github.com/users/jdemeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/jdemeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdemeyer/subscriptions","organizations_url":"https://api.github.com/users/jdemeyer/orgs","repos_url":"https://api.github.com/users/jdemeyer/repos","events_url":"https://api.github.com/users/jdemeyer/events{/privacy}","received_events_url":"https://api.github.com/users/jdemeyer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-12T23:33:11Z","updated_at":"2015-11-13T00:02:42Z","closed_at":null,"body":"There are various issues and unexpected behaviours with `@interact`:\r\n \r\n**1.** code like\r\n```\r\n@interact\r\ndef f(x=[2,5]):\r\n```\r\nshould produce some widget with two values, namely 2 and 5. It currently gives a slider with values from 2 to 5. Should the current behaviour be deprecated or just changed directly?\r\n\r\n**2.** More generally,\r\n```\r\n@interact\r\ndef f(x=[obj1,obj2,obj3]):\r\n```\r\nshould produce a widget where you can choose between `obj1`, `obj2` and `obj3`. This currently works for strings only.\r\n\r\n**3.** Use the [collections abc](https://docs.python.org/2/library/collections.html#collections-abstract-base-classes). In particular, support generator expressions and `OrderedDict`."},"comment":{"url":"https://api.github.com/repos/ipython/ipywidgets/issues/comments/156275677","html_url":"https://github.com/ipython/ipywidgets/issues/238#issuecomment-156275677","issue_url":"https://api.github.com/repos/ipython/ipywidgets/issues/238","id":156275677,"user":{"login":"ellisonbg","id":27600,"avatar_url":"https://avatars.githubusercontent.com/u/27600?v=3","gravatar_id":"","url":"https://api.github.com/users/ellisonbg","html_url":"https://github.com/ellisonbg","followers_url":"https://api.github.com/users/ellisonbg/followers","following_url":"https://api.github.com/users/ellisonbg/following{/other_user}","gists_url":"https://api.github.com/users/ellisonbg/gists{/gist_id}","starred_url":"https://api.github.com/users/ellisonbg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ellisonbg/subscriptions","organizations_url":"https://api.github.com/users/ellisonbg/orgs","repos_url":"https://api.github.com/users/ellisonbg/repos","events_url":"https://api.github.com/users/ellisonbg/events{/privacy}","received_events_url":"https://api.github.com/users/ellisonbg/received_events","type":"User","site_admin":false},"created_at":"2015-11-13T00:02:42Z","updated_at":"2015-11-13T00:02:42Z","body":"On Thu, Nov 12, 2015 at 6:33 PM, jdemeyer <notifications@github.com> wrote:\n\n> There are various issues and unexpected behaviours with @interact:\n>\n> *1.* code like\n>\n> @interact\n> def f(x=[2,5]):\n>\n> should produce some widget with two values, namely 2 and 5. It currently\n> gives a slider with values from 2 to 5. Should the current behaviour be\n> deprecated or just changed directly?\n>\nI don't follow the \"should\" here. We designed the widget abbreviation\nsyntax very carefully. The two-and-three-element list of int/float syntax\nfollows that of Mathematica for sliders. Selection widgets are dicts to\nallow users to provide display/value pairs.\n\n\n\n> *2.* More generally,\n>\n> @interact\n> def f(x=[obj1,obj2,obj3]):\n>\n> should produce a widget where you can choose between obj1, obj2 and obj3.\n> This currently works for strings only.\n>\nSame as comment above - this is by design.\n\nCan you provide more details of what you are thinking about when you make\nthese recommendations?\n\n\n\n> *3.* Use the\n> https://docs.python.org/2/library/collections.html#collections-abstract-base-classes\n> <http://collections%20abc>. In particular, support generator expressions\n> and OrderedDict.\n>\nHmm, this web page isn't resolving for me right now...\n\n\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/ipython/ipywidgets/issues/238>.\n>\n\n\n\n-- \nBrian E. Granger\nAssociate Professor of Physics and Data Science\nCal Poly State University, San Luis Obispo\n@ellisonbg on Twitter and GitHub\nbgranger@calpoly.edu and ellisonbg@gmail.com\n"}}