{"action":"created","issue":{"url":"https://api.github.com/repos/bastibe/PySoundCard/issues/43","labels_url":"https://api.github.com/repos/bastibe/PySoundCard/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/bastibe/PySoundCard/issues/43/comments","events_url":"https://api.github.com/repos/bastibe/PySoundCard/issues/43/events","html_url":"https://github.com/bastibe/PySoundCard/pull/43","id":52965585,"number":43,"title":"Add InputStream and OutputStream classes and default object","user":{"login":"mgeier","id":705404,"avatar_url":"https://avatars.githubusercontent.com/u/705404?v=3","gravatar_id":"","url":"https://api.github.com/users/mgeier","html_url":"https://github.com/mgeier","followers_url":"https://api.github.com/users/mgeier/followers","following_url":"https://api.github.com/users/mgeier/following{/other_user}","gists_url":"https://api.github.com/users/mgeier/gists{/gist_id}","starred_url":"https://api.github.com/users/mgeier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgeier/subscriptions","organizations_url":"https://api.github.com/users/mgeier/orgs","repos_url":"https://api.github.com/users/mgeier/repos","events_url":"https://api.github.com/users/mgeier/events{/privacy}","received_events_url":"https://api.github.com/users/mgeier/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bastibe/PySoundCard/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/bastibe/PySoundCard/milestones/2","html_url":"https://github.com/bastibe/PySoundCard/milestones/0.6.0","labels_url":"https://api.github.com/repos/bastibe/PySoundCard/milestones/2/labels","id":941976,"number":2,"title":"0.6.0","description":"","creator":{"login":"mgeier","id":705404,"avatar_url":"https://avatars.githubusercontent.com/u/705404?v=3","gravatar_id":"","url":"https://api.github.com/users/mgeier","html_url":"https://github.com/mgeier","followers_url":"https://api.github.com/users/mgeier/followers","following_url":"https://api.github.com/users/mgeier/following{/other_user}","gists_url":"https://api.github.com/users/mgeier/gists{/gist_id}","starred_url":"https://api.github.com/users/mgeier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgeier/subscriptions","organizations_url":"https://api.github.com/users/mgeier/orgs","repos_url":"https://api.github.com/users/mgeier/repos","events_url":"https://api.github.com/users/mgeier/events{/privacy}","received_events_url":"https://api.github.com/users/mgeier/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":1,"state":"open","created_at":"2015-01-19T14:50:08Z","updated_at":"2015-03-05T10:42:18Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2014-12-27T20:50:29Z","updated_at":"2015-04-17T09:48:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/bastibe/PySoundCard/pulls/43","html_url":"https://github.com/bastibe/PySoundCard/pull/43","diff_url":"https://github.com/bastibe/PySoundCard/pull/43.diff","patch_url":"https://github.com/bastibe/PySoundCard/pull/43.patch"},"body":"This is an alternative to #39.\r\nIt includes most of the changes discussed there.\r\n\r\nThe main difference is that there are not 3 kinds of arguments (e.g. `device`, `input_device` and `output_device`) anymore.\r\nInstead, there is only one kind of argument (e.g. `device`) which can optionally hold a pair of values (first for \"input\", second for \"output\").\r\n\r\nThe attributes of the `default` object can also optionally hold pairs of values, eg. `pa.default.channels = 2, 1`.\r\nThe most common case, however, will be to assign single values which are used for both input and output.\r\nTo get/set single values for only one of input/output, `pa.default[\"input\"].channels` and `pa.default[\"output\"].channels` can be used, respectively.\r\n\r\nAlso, as discussed in #39, the functions `default_input_device()` and `default_output_device()` are incorporated into `pa.default.device`."},"comment":{"url":"https://api.github.com/repos/bastibe/PySoundCard/issues/comments/93954592","html_url":"https://github.com/bastibe/PySoundCard/pull/43#issuecomment-93954592","issue_url":"https://api.github.com/repos/bastibe/PySoundCard/issues/43","id":93954592,"user":{"login":"bastibe","id":649181,"avatar_url":"https://avatars.githubusercontent.com/u/649181?v=3","gravatar_id":"","url":"https://api.github.com/users/bastibe","html_url":"https://github.com/bastibe","followers_url":"https://api.github.com/users/bastibe/followers","following_url":"https://api.github.com/users/bastibe/following{/other_user}","gists_url":"https://api.github.com/users/bastibe/gists{/gist_id}","starred_url":"https://api.github.com/users/bastibe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bastibe/subscriptions","organizations_url":"https://api.github.com/users/bastibe/orgs","repos_url":"https://api.github.com/users/bastibe/repos","events_url":"https://api.github.com/users/bastibe/events{/privacy}","received_events_url":"https://api.github.com/users/bastibe/received_events","type":"User","site_admin":false},"created_at":"2015-04-17T09:48:35Z","updated_at":"2015-04-17T09:48:35Z","body":"It makes no sense to support iterators-that-are-not-sequences, and then check for their length or convert them to tuple. That defeats the purpose of them not being sequences.\r\n\r\nIt's true though that we don't have to support sequences longer than 2:\r\n\r\n```python\r\nif (isinstance(value, collections.Sequence) and \r\n    not isinstance(value, str) and\r\n    len(value) == 2):\r\n    return tuple(value)\r\nelse:\r\n    return value, value\r\n```"}}