{"action":"created","issue":{"url":"https://api.github.com/repos/pytoolz/toolz/issues/297","repository_url":"https://api.github.com/repos/pytoolz/toolz","labels_url":"https://api.github.com/repos/pytoolz/toolz/issues/297/labels{/name}","comments_url":"https://api.github.com/repos/pytoolz/toolz/issues/297/comments","events_url":"https://api.github.com/repos/pytoolz/toolz/issues/297/events","html_url":"https://github.com/pytoolz/toolz/pull/297","id":145551131,"number":297,"title":"Better curry introspection","user":{"login":"eriknw","id":2058401,"avatar_url":"https://avatars.githubusercontent.com/u/2058401?v=3","gravatar_id":"","url":"https://api.github.com/users/eriknw","html_url":"https://github.com/eriknw","followers_url":"https://api.github.com/users/eriknw/followers","following_url":"https://api.github.com/users/eriknw/following{/other_user}","gists_url":"https://api.github.com/users/eriknw/gists{/gist_id}","starred_url":"https://api.github.com/users/eriknw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eriknw/subscriptions","organizations_url":"https://api.github.com/users/eriknw/orgs","repos_url":"https://api.github.com/users/eriknw/repos","events_url":"https://api.github.com/users/eriknw/events{/privacy}","received_events_url":"https://api.github.com/users/eriknw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-04-03T23:12:59Z","updated_at":"2016-04-09T19:46:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pytoolz/toolz/pulls/297","html_url":"https://github.com/pytoolz/toolz/pull/297","diff_url":"https://github.com/pytoolz/toolz/pull/297.diff","patch_url":"https://github.com/pytoolz/toolz/pull/297.patch"},"body":"Much better function introspection for `curry`.  This is my attempt to \"solve\" introspection for `curry` once and for all.\r\n\r\nThe heavy-lifters are `inspect.getargspec` for Python 2 and `inspect.signature` for Python 3.  We use these in our new functions `functoolz.is_valid_args` and `functoolz.is_partial_args`, which determine via introspection whether a function call is valid or incomplete with the possibility of becoming valid.\r\n\r\nSupport for many more builtins was added.  We maintain a registry of valid signatures in \"_signatures.py\" for `builtins`, `functools`, `itertools`, and `operator` modules.  I don't know how to feel about this, but it's done, so why argue?\r\n\r\nAdded `call` and `bind` methods to `curry`.\r\n\r\nRemoved `_num_required_args` as it is no longer needed.\r\n\r\nThis is a WIP and is based on discussions and suggestions from several issues.  I'll xref the relevant issues and PRs and give a more thorough discussion of the current PR a little later.  I need a break.  This was as much work as expected, but I hope it's worth it!\r\n\r\nIt appears we can support Python 2.7, 3,3, 3.4 and 3.5.  More tests are encouraged.  We can probably support Python 2.6 by not using `inspect.getcallargs`, but I'd be okay with dropping 2.6 (it's old!).\r\n\r\nI don't know what to do about `pypy`.  IMHO, `pypy` failures should be fixed upstream in `pypy`.  We should probably drop `pypy3` support until it mirrors at least Python 3.3 (right now it's Python 3.2, which we don't support).\r\n _**edit** Tests now pass for Python 2.6 and pypy.  pypy3 does not have `inspect.signature`, so we can no longer support it._"},"comment":{"url":"https://api.github.com/repos/pytoolz/toolz/issues/comments/207842750","html_url":"https://github.com/pytoolz/toolz/pull/297#issuecomment-207842750","issue_url":"https://api.github.com/repos/pytoolz/toolz/issues/297","id":207842750,"user":{"login":"mrocklin","id":306380,"avatar_url":"https://avatars.githubusercontent.com/u/306380?v=3","gravatar_id":"","url":"https://api.github.com/users/mrocklin","html_url":"https://github.com/mrocklin","followers_url":"https://api.github.com/users/mrocklin/followers","following_url":"https://api.github.com/users/mrocklin/following{/other_user}","gists_url":"https://api.github.com/users/mrocklin/gists{/gist_id}","starred_url":"https://api.github.com/users/mrocklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrocklin/subscriptions","organizations_url":"https://api.github.com/users/mrocklin/orgs","repos_url":"https://api.github.com/users/mrocklin/repos","events_url":"https://api.github.com/users/mrocklin/events{/privacy}","received_events_url":"https://api.github.com/users/mrocklin/received_events","type":"User","site_admin":false},"created_at":"2016-04-09T19:46:22Z","updated_at":"2016-04-09T19:46:22Z","body":"Thank you for taking this on @eriknw .  This sounds like it was not an easy problem to solve."}}