{"action":"created","issue":{"url":"https://api.github.com/repos/go-python/gopy/issues/17","labels_url":"https://api.github.com/repos/go-python/gopy/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/go-python/gopy/issues/17/comments","events_url":"https://api.github.com/repos/go-python/gopy/issues/17/events","html_url":"https://github.com/go-python/gopy/issues/17","id":97965395,"number":17,"title":"support for kwargs calls","user":{"login":"sbinet","id":1070920,"avatar_url":"https://avatars.githubusercontent.com/u/1070920?v=3","gravatar_id":"","url":"https://api.github.com/users/sbinet","html_url":"https://github.com/sbinet","followers_url":"https://api.github.com/users/sbinet/followers","following_url":"https://api.github.com/users/sbinet/following{/other_user}","gists_url":"https://api.github.com/users/sbinet/gists{/gist_id}","starred_url":"https://api.github.com/users/sbinet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbinet/subscriptions","organizations_url":"https://api.github.com/users/sbinet/orgs","repos_url":"https://api.github.com/users/sbinet/repos","events_url":"https://api.github.com/users/sbinet/events{/privacy}","received_events_url":"https://api.github.com/users/sbinet/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/go-python/gopy/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"sbinet","id":1070920,"avatar_url":"https://avatars.githubusercontent.com/u/1070920?v=3","gravatar_id":"","url":"https://api.github.com/users/sbinet","html_url":"https://github.com/sbinet","followers_url":"https://api.github.com/users/sbinet/followers","following_url":"https://api.github.com/users/sbinet/following{/other_user}","gists_url":"https://api.github.com/users/sbinet/gists{/gist_id}","starred_url":"https://api.github.com/users/sbinet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbinet/subscriptions","organizations_url":"https://api.github.com/users/sbinet/orgs","repos_url":"https://api.github.com/users/sbinet/repos","events_url":"https://api.github.com/users/sbinet/events{/privacy}","received_events_url":"https://api.github.com/users/sbinet/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-07-29T15:42:23Z","updated_at":"2015-08-31T20:21:52Z","closed_at":null,"body":"`gopy` should perhaps generate code with support for kwargs.\r\n\r\nconsider:\r\n```go\r\npackage pkg\r\nfunc Hello(arg1, arg2 string) string {...}\r\n```\r\n\r\nshould be callable from `python` like so:\r\n```py\r\nimport pkg\r\npkg.Hello(\"1\",\"2\")\r\npkg.Hello(arg1=\"1\", arg2=\"2\")\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/go-python/gopy/issues/comments/136488331","html_url":"https://github.com/go-python/gopy/issues/17#issuecomment-136488331","issue_url":"https://api.github.com/repos/go-python/gopy/issues/17","id":136488331,"user":{"login":"sbinet","id":1070920,"avatar_url":"https://avatars.githubusercontent.com/u/1070920?v=3","gravatar_id":"","url":"https://api.github.com/users/sbinet","html_url":"https://github.com/sbinet","followers_url":"https://api.github.com/users/sbinet/followers","following_url":"https://api.github.com/users/sbinet/following{/other_user}","gists_url":"https://api.github.com/users/sbinet/gists{/gist_id}","starred_url":"https://api.github.com/users/sbinet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbinet/subscriptions","organizations_url":"https://api.github.com/users/sbinet/orgs","repos_url":"https://api.github.com/users/sbinet/repos","events_url":"https://api.github.com/users/sbinet/events{/privacy}","received_events_url":"https://api.github.com/users/sbinet/received_events","type":"User","site_admin":false},"created_at":"2015-08-31T20:21:52Z","updated_at":"2015-08-31T20:21:52Z","body":"you're correct: I wasn't very clear.\r\n\r\nmy intention was always to have (with the same definition than in the issue):\r\n\r\n```python\r\nimport pkg\r\npkg.Hello(\"1\",\"2\")  # OK\r\npkg.Hello(arg1=\"1\", arg2=\"2\") # OK\r\n\r\npkg.Hello(arg1=\"1\") # ERROR: missing an argument\r\npkg.Hello(arg2=\"2\") # ERROR: missing an argument\r\n```\r\n\r\nall the arguments would always have to be passed to the function or method, but they could also be named.\r\nso it would be mostly syntactic sugar, or self-explaining code.\r\n\r\nand you're also right that the not-clearly stated goal of `gopy` is to be able to wrap all `go` packages without any modification to these `go` packages, packages over which you may not have control.\r\n\r\nthat said, it is still just an idea (with not even a dev-branch in my local git repo), nothing's written in stone yet.\r\nbesides, the rejected proposal golang/go#12296 indicates that **if** **maybe** some kind of support for functions with named arguments lands in `go` it would be more like:\r\n\r\n```go\r\ntype Point struct{x, y int}\r\nfunc Distance(p Point) float64 { ... }\r\n\r\nDistance(Point{1, 2}) // currently permitted\r\nDistance(Point{x: 1, y: 2}) // currently permitted\r\nDistance({1, 2}) // would be permitted if struct type were inferred\r\nDistance({x: 1, y: 2}) // would be permitted if struct type were inferred\r\n```\r\n\r\nI am not sure what would be the best pythonization of such a mechanism...\r\n\r\n(I'll cross-ref with the new proposal once it appears on go/issues)"}}