{"action":"created","issue":{"url":"https://api.github.com/repos/google/openhtf/issues/284","repository_url":"https://api.github.com/repos/google/openhtf","labels_url":"https://api.github.com/repos/google/openhtf/issues/284/labels{/name}","comments_url":"https://api.github.com/repos/google/openhtf/issues/284/comments","events_url":"https://api.github.com/repos/google/openhtf/issues/284/events","html_url":"https://github.com/google/openhtf/pull/284","id":157569555,"number":284,"title":"phases can take phase_data in *args or **kwargs","user":{"login":"fahhem","id":306100,"avatar_url":"https://avatars.githubusercontent.com/u/306100?v=3","gravatar_id":"","url":"https://api.github.com/users/fahhem","html_url":"https://github.com/fahhem","followers_url":"https://api.github.com/users/fahhem/followers","following_url":"https://api.github.com/users/fahhem/following{/other_user}","gists_url":"https://api.github.com/users/fahhem/gists{/gist_id}","starred_url":"https://api.github.com/users/fahhem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fahhem/subscriptions","organizations_url":"https://api.github.com/users/fahhem/orgs","repos_url":"https://api.github.com/users/fahhem/repos","events_url":"https://api.github.com/users/fahhem/events{/privacy}","received_events_url":"https://api.github.com/users/fahhem/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-05-31T00:28:11Z","updated_at":"2016-05-31T03:54:51Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/google/openhtf/pulls/284","html_url":"https://github.com/google/openhtf/pull/284","diff_url":"https://github.com/google/openhtf/pull/284.diff","patch_url":"https://github.com/google/openhtf/pull/284.patch"},"body":"```py\r\ndef Phase(test, **kwargs):\r\n  pass\r\n\r\ngetargspec(Phase) == ArgSpec(args=('test',), varargs=None, keywords='kwargs', defaults=None)\r\n```\r\n\r\nWhich means doing Phase.WithArgs(something=1) makes that phase no longer take the test object, whether it wanted it or not.\r\n\r\nI have an inkling there's a case where this isn't a good idea, but I can't make it do the wrong thing at the moment. "},"comment":{"url":"https://api.github.com/repos/google/openhtf/issues/comments/222587140","html_url":"https://github.com/google/openhtf/pull/284#issuecomment-222587140","issue_url":"https://api.github.com/repos/google/openhtf/issues/284","id":222587140,"user":{"login":"fahhem","id":306100,"avatar_url":"https://avatars.githubusercontent.com/u/306100?v=3","gravatar_id":"","url":"https://api.github.com/users/fahhem","html_url":"https://github.com/fahhem","followers_url":"https://api.github.com/users/fahhem/followers","following_url":"https://api.github.com/users/fahhem/following{/other_user}","gists_url":"https://api.github.com/users/fahhem/gists{/gist_id}","starred_url":"https://api.github.com/users/fahhem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fahhem/subscriptions","organizations_url":"https://api.github.com/users/fahhem/orgs","repos_url":"https://api.github.com/users/fahhem/repos","events_url":"https://api.github.com/users/fahhem/events{/privacy}","received_events_url":"https://api.github.com/users/fahhem/received_events","type":"User","site_admin":false},"created_at":"2016-05-31T03:54:51Z","updated_at":"2016-05-31T03:54:51Z","body":"Ah, I misnamed the pr, it's still passed in as the first positional\nargument. I was distracted at the time and didn't realize this, sorry.\n\nThe real change is that if a phase takes args or kwargs, extra_args won't\ncount against it and it'll pass in phase_data anyway. On second thought, I\nthink I figured out my inkling, which is that the phase has to take at\nleast one positional arg if it takes kwargs to get phase_data passed in.\n\nOn May 30, 2016 8:22 PM, \"grybmadsci\" <notifications@github.com> wrote:\n\n> Specifically, it opens up a class of failure modes where someone has\n> something like this:\n>\n> def foo_phase(foo, bar, test):\n>   pass\n>\n> and they alter the code and accidentally end up with\n>\n> def foo_phase(foo, bar):\n>   pass\n>\n> and now the PhaseData is getting passed in as foo positionally, and\n> that's a pretty big \"uh wtf just happened\". I think if we were to do kwarg\n> support, we would want to enforce that it's *always* the same keyword and\n> never pass it positionally.\n>\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/google/openhtf/pull/284#issuecomment-222584301>, or mute\n> the thread\n> <https://github.com/notifications/unsubscribe/AASrtFaYBHaoRTsNvHv2FTJSiguEa8Rzks5qG6l7gaJpZM4IqFyN>\n> .\n>\n"}}
{"actor":{"display_login":"fahhem"}}