{"action":"opened","number":207,"pull_request":{"url":"https://api.github.com/repos/stevengj/PyCall.jl/pulls/207","id":49280504,"html_url":"https://github.com/stevengj/PyCall.jl/pull/207","diff_url":"https://github.com/stevengj/PyCall.jl/pull/207.diff","patch_url":"https://github.com/stevengj/PyCall.jl/pull/207.patch","issue_url":"https://api.github.com/repos/stevengj/PyCall.jl/issues/207","number":207,"state":"open","locked":false,"title":"Added weak references support to jlwrap types (for #21 and #158)","user":{"login":"amyascwk","id":3915352,"avatar_url":"https://avatars.githubusercontent.com/u/3915352?v=3","gravatar_id":"","url":"https://api.github.com/users/amyascwk","html_url":"https://github.com/amyascwk","followers_url":"https://api.github.com/users/amyascwk/followers","following_url":"https://api.github.com/users/amyascwk/following{/other_user}","gists_url":"https://api.github.com/users/amyascwk/gists{/gist_id}","starred_url":"https://api.github.com/users/amyascwk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amyascwk/subscriptions","organizations_url":"https://api.github.com/users/amyascwk/orgs","repos_url":"https://api.github.com/users/amyascwk/repos","events_url":"https://api.github.com/users/amyascwk/events{/privacy}","received_events_url":"https://api.github.com/users/amyascwk/received_events","type":"User","site_admin":false},"body":"I've managed to get weak references to work (#158), and have mainly tested it directly with the python weakref module and on julia functions:\r\n\r\n    using PyCall\r\n    @pyimport weakref\r\n    \r\n    po = PyObject(x -> x + 1)  #create jl_FunctionType\r\n    r = weakref.ref(po)\r\n    r()                        #returns (anonymous function)\r\n    \r\n    po = 1                     #remove reference to the PyObject\r\n    gc()                       #run gc\r\n    r()                        #returns nothing\r\n\r\nI've also tested it on connecting julia functions to matplotlib's figure events (#21):\r\n\r\n    import PyPlot.plt\r\n    \r\n    plt[:plot]()\r\n    fig = plt[:gcf]()\r\n    onpress(mev) = println(\"($(mev[:xdata]),$(mev[:ydata]))\")\r\n    cid = fig[:canvas][:mpl_connect](\"button_press_event\", onpress)\r\n\r\nLeft clicking within the axes outputs pairs of data coordinates at the location of the click.","created_at":"2015-10-30T15:06:43Z","updated_at":"2015-10-30T15:06:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/stevengj/PyCall.jl/pulls/207/commits","review_comments_url":"https://api.github.com/repos/stevengj/PyCall.jl/pulls/207/comments","review_comment_url":"https://api.github.com/repos/stevengj/PyCall.jl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stevengj/PyCall.jl/issues/207/comments","statuses_url":"https://api.github.com/repos/stevengj/PyCall.jl/statuses/72e5017148134a5ac56b884c82dea44c4ef7d61b","head":{"label":"amyascwk:weakrefs","ref":"weakrefs","sha":"72e5017148134a5ac56b884c82dea44c4ef7d61b","user":{"login":"amyascwk","id":3915352,"avatar_url":"https://avatars.githubusercontent.com/u/3915352?v=3","gravatar_id":"","url":"https://api.github.com/users/amyascwk","html_url":"https://github.com/amyascwk","followers_url":"https://api.github.com/users/amyascwk/followers","following_url":"https://api.github.com/users/amyascwk/following{/other_user}","gists_url":"https://api.github.com/users/amyascwk/gists{/gist_id}","starred_url":"https://api.github.com/users/amyascwk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amyascwk/subscriptions","organizations_url":"https://api.github.com/users/amyascwk/orgs","repos_url":"https://api.github.com/users/amyascwk/repos","events_url":"https://api.github.com/users/amyascwk/events{/privacy}","received_events_url":"https://api.github.com/users/amyascwk/received_events","type":"User","site_admin":false},"repo":{"id":45257256,"name":"PyCall.jl","full_name":"amyascwk/PyCall.jl","owner":{"login":"amyascwk","id":3915352,"avatar_url":"https://avatars.githubusercontent.com/u/3915352?v=3","gravatar_id":"","url":"https://api.github.com/users/amyascwk","html_url":"https://github.com/amyascwk","followers_url":"https://api.github.com/users/amyascwk/followers","following_url":"https://api.github.com/users/amyascwk/following{/other_user}","gists_url":"https://api.github.com/users/amyascwk/gists{/gist_id}","starred_url":"https://api.github.com/users/amyascwk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amyascwk/subscriptions","organizations_url":"https://api.github.com/users/amyascwk/orgs","repos_url":"https://api.github.com/users/amyascwk/repos","events_url":"https://api.github.com/users/amyascwk/events{/privacy}","received_events_url":"https://api.github.com/users/amyascwk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/amyascwk/PyCall.jl","description":"Package to call Python functions from the Julia language","fork":true,"url":"https://api.github.com/repos/amyascwk/PyCall.jl","forks_url":"https://api.github.com/repos/amyascwk/PyCall.jl/forks","keys_url":"https://api.github.com/repos/amyascwk/PyCall.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amyascwk/PyCall.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amyascwk/PyCall.jl/teams","hooks_url":"https://api.github.com/repos/amyascwk/PyCall.jl/hooks","issue_events_url":"https://api.github.com/repos/amyascwk/PyCall.jl/issues/events{/number}","events_url":"https://api.github.com/repos/amyascwk/PyCall.jl/events","assignees_url":"https://api.github.com/repos/amyascwk/PyCall.jl/assignees{/user}","branches_url":"https://api.github.com/repos/amyascwk/PyCall.jl/branches{/branch}","tags_url":"https://api.github.com/repos/amyascwk/PyCall.jl/tags","blobs_url":"https://api.github.com/repos/amyascwk/PyCall.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amyascwk/PyCall.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amyascwk/PyCall.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/amyascwk/PyCall.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amyascwk/PyCall.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/amyascwk/PyCall.jl/languages","stargazers_url":"https://api.github.com/repos/amyascwk/PyCall.jl/stargazers","contributors_url":"https://api.github.com/repos/amyascwk/PyCall.jl/contributors","subscribers_url":"https://api.github.com/repos/amyascwk/PyCall.jl/subscribers","subscription_url":"https://api.github.com/repos/amyascwk/PyCall.jl/subscription","commits_url":"https://api.github.com/repos/amyascwk/PyCall.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/amyascwk/PyCall.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/amyascwk/PyCall.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/amyascwk/PyCall.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/amyascwk/PyCall.jl/contents/{+path}","compare_url":"https://api.github.com/repos/amyascwk/PyCall.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amyascwk/PyCall.jl/merges","archive_url":"https://api.github.com/repos/amyascwk/PyCall.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amyascwk/PyCall.jl/downloads","issues_url":"https://api.github.com/repos/amyascwk/PyCall.jl/issues{/number}","pulls_url":"https://api.github.com/repos/amyascwk/PyCall.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/amyascwk/PyCall.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/amyascwk/PyCall.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amyascwk/PyCall.jl/labels{/name}","releases_url":"https://api.github.com/repos/amyascwk/PyCall.jl/releases{/id}","created_at":"2015-10-30T14:53:05Z","updated_at":"2015-10-30T14:53:06Z","pushed_at":"2015-10-30T14:54:16Z","git_url":"git://github.com/amyascwk/PyCall.jl.git","ssh_url":"git@github.com:amyascwk/PyCall.jl.git","clone_url":"https://github.com/amyascwk/PyCall.jl.git","svn_url":"https://github.com/amyascwk/PyCall.jl","homepage":null,"size":1679,"stargazers_count":0,"watchers_count":0,"language":"Julia","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"stevengj:master","ref":"master","sha":"0e0343f62c284e374789981d8e13b345617e7d75","user":{"login":"stevengj","id":2913679,"avatar_url":"https://avatars.githubusercontent.com/u/2913679?v=3","gravatar_id":"","url":"https://api.github.com/users/stevengj","html_url":"https://github.com/stevengj","followers_url":"https://api.github.com/users/stevengj/followers","following_url":"https://api.github.com/users/stevengj/following{/other_user}","gists_url":"https://api.github.com/users/stevengj/gists{/gist_id}","starred_url":"https://api.github.com/users/stevengj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevengj/subscriptions","organizations_url":"https://api.github.com/users/stevengj/orgs","repos_url":"https://api.github.com/users/stevengj/repos","events_url":"https://api.github.com/users/stevengj/events{/privacy}","received_events_url":"https://api.github.com/users/stevengj/received_events","type":"User","site_admin":false},"repo":{"id":8219717,"name":"PyCall.jl","full_name":"stevengj/PyCall.jl","owner":{"login":"stevengj","id":2913679,"avatar_url":"https://avatars.githubusercontent.com/u/2913679?v=3","gravatar_id":"","url":"https://api.github.com/users/stevengj","html_url":"https://github.com/stevengj","followers_url":"https://api.github.com/users/stevengj/followers","following_url":"https://api.github.com/users/stevengj/following{/other_user}","gists_url":"https://api.github.com/users/stevengj/gists{/gist_id}","starred_url":"https://api.github.com/users/stevengj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevengj/subscriptions","organizations_url":"https://api.github.com/users/stevengj/orgs","repos_url":"https://api.github.com/users/stevengj/repos","events_url":"https://api.github.com/users/stevengj/events{/privacy}","received_events_url":"https://api.github.com/users/stevengj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stevengj/PyCall.jl","description":"Package to call Python functions from the Julia language","fork":false,"url":"https://api.github.com/repos/stevengj/PyCall.jl","forks_url":"https://api.github.com/repos/stevengj/PyCall.jl/forks","keys_url":"https://api.github.com/repos/stevengj/PyCall.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stevengj/PyCall.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stevengj/PyCall.jl/teams","hooks_url":"https://api.github.com/repos/stevengj/PyCall.jl/hooks","issue_events_url":"https://api.github.com/repos/stevengj/PyCall.jl/issues/events{/number}","events_url":"https://api.github.com/repos/stevengj/PyCall.jl/events","assignees_url":"https://api.github.com/repos/stevengj/PyCall.jl/assignees{/user}","branches_url":"https://api.github.com/repos/stevengj/PyCall.jl/branches{/branch}","tags_url":"https://api.github.com/repos/stevengj/PyCall.jl/tags","blobs_url":"https://api.github.com/repos/stevengj/PyCall.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stevengj/PyCall.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stevengj/PyCall.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/stevengj/PyCall.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stevengj/PyCall.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/stevengj/PyCall.jl/languages","stargazers_url":"https://api.github.com/repos/stevengj/PyCall.jl/stargazers","contributors_url":"https://api.github.com/repos/stevengj/PyCall.jl/contributors","subscribers_url":"https://api.github.com/repos/stevengj/PyCall.jl/subscribers","subscription_url":"https://api.github.com/repos/stevengj/PyCall.jl/subscription","commits_url":"https://api.github.com/repos/stevengj/PyCall.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/stevengj/PyCall.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/stevengj/PyCall.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/stevengj/PyCall.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/stevengj/PyCall.jl/contents/{+path}","compare_url":"https://api.github.com/repos/stevengj/PyCall.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stevengj/PyCall.jl/merges","archive_url":"https://api.github.com/repos/stevengj/PyCall.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stevengj/PyCall.jl/downloads","issues_url":"https://api.github.com/repos/stevengj/PyCall.jl/issues{/number}","pulls_url":"https://api.github.com/repos/stevengj/PyCall.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/stevengj/PyCall.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/stevengj/PyCall.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stevengj/PyCall.jl/labels{/name}","releases_url":"https://api.github.com/repos/stevengj/PyCall.jl/releases{/id}","created_at":"2013-02-15T14:32:47Z","updated_at":"2015-10-27T22:06:46Z","pushed_at":"2015-10-30T15:06:44Z","git_url":"git://github.com/stevengj/PyCall.jl.git","ssh_url":"git@github.com:stevengj/PyCall.jl.git","clone_url":"https://github.com/stevengj/PyCall.jl.git","svn_url":"https://github.com/stevengj/PyCall.jl","homepage":null,"size":1679,"stargazers_count":205,"watchers_count":205,"language":"Julia","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":47,"mirror_url":null,"open_issues_count":33,"forks":47,"open_issues":33,"watchers":205,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stevengj/PyCall.jl/pulls/207"},"html":{"href":"https://github.com/stevengj/PyCall.jl/pull/207"},"issue":{"href":"https://api.github.com/repos/stevengj/PyCall.jl/issues/207"},"comments":{"href":"https://api.github.com/repos/stevengj/PyCall.jl/issues/207/comments"},"review_comments":{"href":"https://api.github.com/repos/stevengj/PyCall.jl/pulls/207/comments"},"review_comment":{"href":"https://api.github.com/repos/stevengj/PyCall.jl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stevengj/PyCall.jl/pulls/207/commits"},"statuses":{"href":"https://api.github.com/repos/stevengj/PyCall.jl/statuses/72e5017148134a5ac56b884c82dea44c4ef7d61b"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":14,"deletions":1,"changed_files":2}}