{"action":"created","issue":{"url":"https://api.github.com/repos/pika/pika/issues/941","repository_url":"https://api.github.com/repos/pika/pika","labels_url":"https://api.github.com/repos/pika/pika/issues/941/labels{/name}","comments_url":"https://api.github.com/repos/pika/pika/issues/941/comments","events_url":"https://api.github.com/repos/pika/pika/issues/941/events","html_url":"https://github.com/pika/pika/pull/941","id":293368615,"number":941,"title":"Consistently validate callback and nowait parameters","user":{"login":"lukebakken","id":514926,"avatar_url":"https://avatars2.githubusercontent.com/u/514926?v=4","gravatar_id":"","url":"https://api.github.com/users/lukebakken","html_url":"https://github.com/lukebakken","followers_url":"https://api.github.com/users/lukebakken/followers","following_url":"https://api.github.com/users/lukebakken/following{/other_user}","gists_url":"https://api.github.com/users/lukebakken/gists{/gist_id}","starred_url":"https://api.github.com/users/lukebakken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukebakken/subscriptions","organizations_url":"https://api.github.com/users/lukebakken/orgs","repos_url":"https://api.github.com/users/lukebakken/repos","events_url":"https://api.github.com/users/lukebakken/events{/privacy}","received_events_url":"https://api.github.com/users/lukebakken/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"lukebakken","id":514926,"avatar_url":"https://avatars2.githubusercontent.com/u/514926?v=4","gravatar_id":"","url":"https://api.github.com/users/lukebakken","html_url":"https://github.com/lukebakken","followers_url":"https://api.github.com/users/lukebakken/followers","following_url":"https://api.github.com/users/lukebakken/following{/other_user}","gists_url":"https://api.github.com/users/lukebakken/gists{/gist_id}","starred_url":"https://api.github.com/users/lukebakken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukebakken/subscriptions","organizations_url":"https://api.github.com/users/lukebakken/orgs","repos_url":"https://api.github.com/users/lukebakken/repos","events_url":"https://api.github.com/users/lukebakken/events{/privacy}","received_events_url":"https://api.github.com/users/lukebakken/received_events","type":"User","site_admin":false},"assignees":[{"login":"lukebakken","id":514926,"avatar_url":"https://avatars2.githubusercontent.com/u/514926?v=4","gravatar_id":"","url":"https://api.github.com/users/lukebakken","html_url":"https://github.com/lukebakken","followers_url":"https://api.github.com/users/lukebakken/followers","following_url":"https://api.github.com/users/lukebakken/following{/other_user}","gists_url":"https://api.github.com/users/lukebakken/gists{/gist_id}","starred_url":"https://api.github.com/users/lukebakken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukebakken/subscriptions","organizations_url":"https://api.github.com/users/lukebakken/orgs","repos_url":"https://api.github.com/users/lukebakken/repos","events_url":"https://api.github.com/users/lukebakken/events{/privacy}","received_events_url":"https://api.github.com/users/lukebakken/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/pika/pika/milestones/8","html_url":"https://github.com/pika/pika/milestone/8","labels_url":"https://api.github.com/repos/pika/pika/milestones/8/labels","id":2664000,"number":8,"title":"1.0.0","description":"","creator":{"login":"lukebakken","id":514926,"avatar_url":"https://avatars2.githubusercontent.com/u/514926?v=4","gravatar_id":"","url":"https://api.github.com/users/lukebakken","html_url":"https://github.com/lukebakken","followers_url":"https://api.github.com/users/lukebakken/followers","following_url":"https://api.github.com/users/lukebakken/following{/other_user}","gists_url":"https://api.github.com/users/lukebakken/gists{/gist_id}","starred_url":"https://api.github.com/users/lukebakken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukebakken/subscriptions","organizations_url":"https://api.github.com/users/lukebakken/orgs","repos_url":"https://api.github.com/users/lukebakken/repos","events_url":"https://api.github.com/users/lukebakken/events{/privacy}","received_events_url":"https://api.github.com/users/lukebakken/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":28,"state":"open","created_at":"2017-07-26T21:40:33Z","updated_at":"2018-02-06T16:01:24Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2018-02-01T01:05:47Z","updated_at":"2018-02-06T18:47:13Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/pika/pika/pulls/941","html_url":"https://github.com/pika/pika/pull/941","diff_url":"https://github.com/pika/pika/pull/941.diff","patch_url":"https://github.com/pika/pika/pull/941.patch"},"body":"These are pretty big pre-`1.0.0` changes to the API, with the thought of adding a feature for passing user-defined data to callbacks when they are called (#158).\r\n\r\nOther event-loop driven frameworks / environments (I'm thinking of javascript / node, especially) always pass the callback as the last parameter to a method that takes a callback.\r\n\r\nThis PR makes the following changes:\r\n\r\n* Moves the callback parameter for all methods that take one to the end of the method that requires a callback\r\n* Changes the parameter name to `callback` in all cases\r\n* Adds validation for `callback` and `nowait` if both are part of the method signature. If `nowait=False` (the default), then a callback must be passed and `ValueError` will be raised if one isn't. #925 raised the issue that the default method parameters will result in `ValueError` and that behavior will remain the same.\r\n\r\nTo address #158, we could add a `userdata` parameter after `callback`, *or*, if callback is passed as a two-tuple, the first element could be validated as the callback method, and the second the userdata."},"comment":{"url":"https://api.github.com/repos/pika/pika/issues/comments/363524361","html_url":"https://github.com/pika/pika/pull/941#issuecomment-363524361","issue_url":"https://api.github.com/repos/pika/pika/issues/941","id":363524361,"user":{"login":"vitaly-krugl","id":1441066,"avatar_url":"https://avatars2.githubusercontent.com/u/1441066?v=4","gravatar_id":"","url":"https://api.github.com/users/vitaly-krugl","html_url":"https://github.com/vitaly-krugl","followers_url":"https://api.github.com/users/vitaly-krugl/followers","following_url":"https://api.github.com/users/vitaly-krugl/following{/other_user}","gists_url":"https://api.github.com/users/vitaly-krugl/gists{/gist_id}","starred_url":"https://api.github.com/users/vitaly-krugl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vitaly-krugl/subscriptions","organizations_url":"https://api.github.com/users/vitaly-krugl/orgs","repos_url":"https://api.github.com/users/vitaly-krugl/repos","events_url":"https://api.github.com/users/vitaly-krugl/events{/privacy}","received_events_url":"https://api.github.com/users/vitaly-krugl/received_events","type":"User","site_admin":false},"created_at":"2018-02-06T18:47:13Z","updated_at":"2018-02-06T18:47:13Z","author_association":"MEMBER","body":"@lukebakken: we should really stick to PEP-0008. I am surprised that yapf snuck into pika in a non-PEP8-compatible way. This also conflicts with the pylintrc settings that had been used to validate majority of the code. The vast majority of the code was PEP8 compatible. \r\n\r\nRegarding indentation, see https://www.python.org/dev/peps/pep-0008/#indentation."}}
{"actor":{"display_login":"vitaly-krugl"}}