{"action":"created","issue":{"url":"https://api.github.com/repos/pytest-dev/pluggy/issues/15","repository_url":"https://api.github.com/repos/pytest-dev/pluggy","labels_url":"https://api.github.com/repos/pytest-dev/pluggy/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/pytest-dev/pluggy/issues/15/comments","events_url":"https://api.github.com/repos/pytest-dev/pluggy/issues/15/events","html_url":"https://github.com/pytest-dev/pluggy/issues/15","id":132737261,"number":15,"title":"support defaults to enable deprecation","user":{"login":"RonnyPfannschmidt","id":156838,"avatar_url":"https://avatars.githubusercontent.com/u/156838?v=3","gravatar_id":"","url":"https://api.github.com/users/RonnyPfannschmidt","html_url":"https://github.com/RonnyPfannschmidt","followers_url":"https://api.github.com/users/RonnyPfannschmidt/followers","following_url":"https://api.github.com/users/RonnyPfannschmidt/following{/other_user}","gists_url":"https://api.github.com/users/RonnyPfannschmidt/gists{/gist_id}","starred_url":"https://api.github.com/users/RonnyPfannschmidt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RonnyPfannschmidt/subscriptions","organizations_url":"https://api.github.com/users/RonnyPfannschmidt/orgs","repos_url":"https://api.github.com/users/RonnyPfannschmidt/repos","events_url":"https://api.github.com/users/RonnyPfannschmidt/events{/privacy}","received_events_url":"https://api.github.com/users/RonnyPfannschmidt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":22,"created_at":"2016-02-10T15:50:35Z","updated_at":"2016-11-14T16:28:43Z","closed_at":null,"body":"this is to help pytest-dev/pytest#1372\n\nthe idea is, that if a hook is invoked with a missing, but specced argument, then the default is used instead\n\nso if a hook caller would call `hook.pytest_deselected(items=...)'\nand the hook was defined with`def pytest_deselected(items, reason='No Reason Given)`\nthen the receivers would receive the defined default reason\n\nin order to support deprecation of such usage we could later devise a mark for deprecated defaults\n"},"comment":{"url":"https://api.github.com/repos/pytest-dev/pluggy/issues/comments/260384619","html_url":"https://github.com/pytest-dev/pluggy/issues/15#issuecomment-260384619","issue_url":"https://api.github.com/repos/pytest-dev/pluggy/issues/15","id":260384619,"user":{"login":"tgoodlet","id":291685,"avatar_url":"https://avatars.githubusercontent.com/u/291685?v=3","gravatar_id":"","url":"https://api.github.com/users/tgoodlet","html_url":"https://github.com/tgoodlet","followers_url":"https://api.github.com/users/tgoodlet/followers","following_url":"https://api.github.com/users/tgoodlet/following{/other_user}","gists_url":"https://api.github.com/users/tgoodlet/gists{/gist_id}","starred_url":"https://api.github.com/users/tgoodlet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgoodlet/subscriptions","organizations_url":"https://api.github.com/users/tgoodlet/orgs","repos_url":"https://api.github.com/users/tgoodlet/repos","events_url":"https://api.github.com/users/tgoodlet/events{/privacy}","received_events_url":"https://api.github.com/users/tgoodlet/received_events","type":"User","site_admin":false},"created_at":"2016-11-14T16:28:43Z","updated_at":"2016-11-14T16:28:43Z","body":">the transformation to positional arguments was introduced to gain performance (and did work out)\r\n\r\n@RonnyPfannschmidt that I don't doubt. I just don't know how much faster the list comprehension + `func(*list_compr_results)` is then a `func(**kwargs_from_call)`.\r\n\r\nHere's some very rudimentary benchmarks of what's going on inside `_MultiCall.execute()`:\r\n```python\r\nIn [19]: kwargs= {'doggy':10, 'kitty':'yey', 'mouse':1908}\r\n\r\nIn [20]: def f(kitty, doggy, mouse=None):\r\n    ...:     pass\r\n    ...: \r\n\r\nIn [22]: fargnames = pluggy.varnames(f)\r\n\r\nIn [23]: fargnames\r\nOut[23]: ('kitty', 'doggy')\r\n\r\n# the current implementation\r\nIn [24]: timeit f(*[kwargs[argname] for argname in fargnames])\r\nThe slowest run took 4.67 times longer than the fastest. This could mean that an intermediate result is being cached.\r\n1000000 loops, best of 3: 556 ns per loop\r\n\r\nIn [26]: timeit f(**kwargs)\r\nThe slowest run took 6.64 times longer than the fastest. This could mean that an intermediate result is being cached.\r\n1000000 loops, best of 3: 211 ns per loop\r\n```\r\n\r\nSo if we're going to keep the *call by keyword argument names* interface then we might gain some performance by using `**`.\r\n"}}
{"actor":{"display_login":"tgoodlet"}}