{"action":"created","comment":{"url":"https://api.github.com/repos/numpy/numpy/pulls/comments/134909797","pull_request_review_id":58257365,"id":134909797,"diff_hunk":"@@ -1009,7 +1009,7 @@ PyArray_NewFromDescr_int(PyTypeObject *subtype, PyArray_Descr *descr, int nd,\n         }\n     }\n     else {\n-        fa->flags = (flags & ~NPY_ARRAY_UPDATEIFCOPY);\n+        fa->flags = (flags & ~NPY_ARRAY_UPDATEIFCOPY_CLEAR_B4_EXIT);","path":"numpy/core/src/multiarray/ctors.c","position":5,"original_position":5,"commit_id":"586d53eed65c158cedc16c7102ef4557bb53ad7b","original_commit_id":"586d53eed65c158cedc16c7102ef4557bb53ad7b","user":{"login":"njsmith","id":609896,"avatar_url":"https://avatars0.githubusercontent.com/u/609896?v=4","gravatar_id":"","url":"https://api.github.com/users/njsmith","html_url":"https://github.com/njsmith","followers_url":"https://api.github.com/users/njsmith/followers","following_url":"https://api.github.com/users/njsmith/following{/other_user}","gists_url":"https://api.github.com/users/njsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/njsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njsmith/subscriptions","organizations_url":"https://api.github.com/users/njsmith/orgs","repos_url":"https://api.github.com/users/njsmith/repos","events_url":"https://api.github.com/users/njsmith/events{/privacy}","received_events_url":"https://api.github.com/users/njsmith/received_events","type":"User","site_admin":false},"body":"This should clear both versions of the flag, I think?","created_at":"2017-08-24T01:39:01Z","updated_at":"2017-08-24T02:03:54Z","html_url":"https://github.com/numpy/numpy/pull/9451#discussion_r134909797","pull_request_url":"https://api.github.com/repos/numpy/numpy/pulls/9451","_links":{"self":{"href":"https://api.github.com/repos/numpy/numpy/pulls/comments/134909797"},"html":{"href":"https://github.com/numpy/numpy/pull/9451#discussion_r134909797"},"pull_request":{"href":"https://api.github.com/repos/numpy/numpy/pulls/9451"}}},"pull_request":{"url":"https://api.github.com/repos/numpy/numpy/pulls/9451","id":131947236,"html_url":"https://github.com/numpy/numpy/pull/9451","diff_url":"https://github.com/numpy/numpy/pull/9451.diff","patch_url":"https://github.com/numpy/numpy/pull/9451.patch","issue_url":"https://api.github.com/repos/numpy/numpy/issues/9451","number":9451,"state":"open","locked":false,"title":"ENH, DEP refactor updateifcopy","user":{"login":"mattip","id":823911,"avatar_url":"https://avatars0.githubusercontent.com/u/823911?v=4","gravatar_id":"","url":"https://api.github.com/users/mattip","html_url":"https://github.com/mattip","followers_url":"https://api.github.com/users/mattip/followers","following_url":"https://api.github.com/users/mattip/following{/other_user}","gists_url":"https://api.github.com/users/mattip/gists{/gist_id}","starred_url":"https://api.github.com/users/mattip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattip/subscriptions","organizations_url":"https://api.github.com/users/mattip/orgs","repos_url":"https://api.github.com/users/mattip/repos","events_url":"https://api.github.com/users/mattip/events{/privacy}","received_events_url":"https://api.github.com/users/mattip/received_events","type":"User","site_admin":false},"body":"Replaces pull request #9269, related to issues #9257, #7054 \r\n\r\nCommit b2837ab refactors the resolution of ``UPDATEIFCOPY`` into a new private API function ``PyArray_ResolveUpdateIfCopy``. Add a call to the function wherever a temporary ``ndarray`` with that flag is created, and added tests for calls that exercise the new function. This commit changes no behaviour on CPython but will raise a DeprecationWarning on PyPy (or if compiled with DEPRECATE_UPDATEIFCOPY defined) if ``PyArray_ResolveUpdateIfCopy`` actually does resolve anything in ``array_deallocate``.\r\n\r\nCommit ec86410 changes the C API flag ``NPY_ARRAY_UPDATEIFCOPY`` to ``NPY_ARRAY_UPDATEIFCOPY_CLEAR_B4_EXIT`` and raise a DeprecationWarning if a ndarray is created with the old flag. The goal here is to encourage downstream projects to be sure they are properly resolving the UPDATEIFCOPY semantics before calling ``array_deallocate``\r\n\r\nStill TODO:\r\n\r\n* Do I need to make ``PyArray_ResolveUpdateIfCopy`` into a public API function for downstream users to be able to use it? What should the public name be?\r\n* Before we can enable or strengthen the DeprecationWarning at ``array_dealloc``, we need to deal with nditer. Pull request #9269 suggested making nditer into a context manager, we could also simply disallow creation of nditers with UDATEIFCOPY semantics.\r\n* There should be some test of the ``NPY_ARRAY_UPDATEIFCOPY`` to ``NPY_ARRAY_UPDATEIFCOPY_CLEAR_B4_EXIT`` change\r\n\r\nIs this approach more acceptable than #9269 ?","created_at":"2017-07-23T20:16:12Z","updated_at":"2017-08-24T02:03:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c6482efcf0d124e455c08ae0f77e6794631a6d0c","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/numpy/numpy/pulls/9451/commits","review_comments_url":"https://api.github.com/repos/numpy/numpy/pulls/9451/comments","review_comment_url":"https://api.github.com/repos/numpy/numpy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/9451/comments","statuses_url":"https://api.github.com/repos/numpy/numpy/statuses/586d53eed65c158cedc16c7102ef4557bb53ad7b","head":{"label":"mattip:refactor-updateifcopy2","ref":"refactor-updateifcopy2","sha":"586d53eed65c158cedc16c7102ef4557bb53ad7b","user":{"login":"mattip","id":823911,"avatar_url":"https://avatars0.githubusercontent.com/u/823911?v=4","gravatar_id":"","url":"https://api.github.com/users/mattip","html_url":"https://github.com/mattip","followers_url":"https://api.github.com/users/mattip/followers","following_url":"https://api.github.com/users/mattip/following{/other_user}","gists_url":"https://api.github.com/users/mattip/gists{/gist_id}","starred_url":"https://api.github.com/users/mattip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattip/subscriptions","organizations_url":"https://api.github.com/users/mattip/orgs","repos_url":"https://api.github.com/users/mattip/repos","events_url":"https://api.github.com/users/mattip/events{/privacy}","received_events_url":"https://api.github.com/users/mattip/received_events","type":"User","site_admin":false},"repo":{"id":60840628,"name":"numpy","full_name":"mattip/numpy","owner":{"login":"mattip","id":823911,"avatar_url":"https://avatars0.githubusercontent.com/u/823911?v=4","gravatar_id":"","url":"https://api.github.com/users/mattip","html_url":"https://github.com/mattip","followers_url":"https://api.github.com/users/mattip/followers","following_url":"https://api.github.com/users/mattip/following{/other_user}","gists_url":"https://api.github.com/users/mattip/gists{/gist_id}","starred_url":"https://api.github.com/users/mattip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattip/subscriptions","organizations_url":"https://api.github.com/users/mattip/orgs","repos_url":"https://api.github.com/users/mattip/repos","events_url":"https://api.github.com/users/mattip/events{/privacy}","received_events_url":"https://api.github.com/users/mattip/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mattip/numpy","description":"Numpy main repository","fork":true,"url":"https://api.github.com/repos/mattip/numpy","forks_url":"https://api.github.com/repos/mattip/numpy/forks","keys_url":"https://api.github.com/repos/mattip/numpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattip/numpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattip/numpy/teams","hooks_url":"https://api.github.com/repos/mattip/numpy/hooks","issue_events_url":"https://api.github.com/repos/mattip/numpy/issues/events{/number}","events_url":"https://api.github.com/repos/mattip/numpy/events","assignees_url":"https://api.github.com/repos/mattip/numpy/assignees{/user}","branches_url":"https://api.github.com/repos/mattip/numpy/branches{/branch}","tags_url":"https://api.github.com/repos/mattip/numpy/tags","blobs_url":"https://api.github.com/repos/mattip/numpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattip/numpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattip/numpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattip/numpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattip/numpy/statuses/{sha}","languages_url":"https://api.github.com/repos/mattip/numpy/languages","stargazers_url":"https://api.github.com/repos/mattip/numpy/stargazers","contributors_url":"https://api.github.com/repos/mattip/numpy/contributors","subscribers_url":"https://api.github.com/repos/mattip/numpy/subscribers","subscription_url":"https://api.github.com/repos/mattip/numpy/subscription","commits_url":"https://api.github.com/repos/mattip/numpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattip/numpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattip/numpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattip/numpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/mattip/numpy/contents/{+path}","compare_url":"https://api.github.com/repos/mattip/numpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattip/numpy/merges","archive_url":"https://api.github.com/repos/mattip/numpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattip/numpy/downloads","issues_url":"https://api.github.com/repos/mattip/numpy/issues{/number}","pulls_url":"https://api.github.com/repos/mattip/numpy/pulls{/number}","milestones_url":"https://api.github.com/repos/mattip/numpy/milestones{/number}","notifications_url":"https://api.github.com/repos/mattip/numpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattip/numpy/labels{/name}","releases_url":"https://api.github.com/repos/mattip/numpy/releases{/id}","deployments_url":"https://api.github.com/repos/mattip/numpy/deployments","created_at":"2016-06-10T10:38:48Z","updated_at":"2016-06-10T10:38:54Z","pushed_at":"2017-08-19T21:39:45Z","git_url":"git://github.com/mattip/numpy.git","ssh_url":"git@github.com:mattip/numpy.git","clone_url":"https://github.com/mattip/numpy.git","svn_url":"https://github.com/mattip/numpy","homepage":"http://www.numpy.org/","size":49675,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"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":"numpy:master","ref":"master","sha":"a0c5f64f4f1a7f6ee80dc9b95aa813df28a87d72","user":{"login":"numpy","id":288276,"avatar_url":"https://avatars2.githubusercontent.com/u/288276?v=4","gravatar_id":"","url":"https://api.github.com/users/numpy","html_url":"https://github.com/numpy","followers_url":"https://api.github.com/users/numpy/followers","following_url":"https://api.github.com/users/numpy/following{/other_user}","gists_url":"https://api.github.com/users/numpy/gists{/gist_id}","starred_url":"https://api.github.com/users/numpy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numpy/subscriptions","organizations_url":"https://api.github.com/users/numpy/orgs","repos_url":"https://api.github.com/users/numpy/repos","events_url":"https://api.github.com/users/numpy/events{/privacy}","received_events_url":"https://api.github.com/users/numpy/received_events","type":"Organization","site_admin":false},"repo":{"id":908607,"name":"numpy","full_name":"numpy/numpy","owner":{"login":"numpy","id":288276,"avatar_url":"https://avatars2.githubusercontent.com/u/288276?v=4","gravatar_id":"","url":"https://api.github.com/users/numpy","html_url":"https://github.com/numpy","followers_url":"https://api.github.com/users/numpy/followers","following_url":"https://api.github.com/users/numpy/following{/other_user}","gists_url":"https://api.github.com/users/numpy/gists{/gist_id}","starred_url":"https://api.github.com/users/numpy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numpy/subscriptions","organizations_url":"https://api.github.com/users/numpy/orgs","repos_url":"https://api.github.com/users/numpy/repos","events_url":"https://api.github.com/users/numpy/events{/privacy}","received_events_url":"https://api.github.com/users/numpy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/numpy/numpy","description":"Numpy main repository","fork":false,"url":"https://api.github.com/repos/numpy/numpy","forks_url":"https://api.github.com/repos/numpy/numpy/forks","keys_url":"https://api.github.com/repos/numpy/numpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/numpy/numpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/numpy/numpy/teams","hooks_url":"https://api.github.com/repos/numpy/numpy/hooks","issue_events_url":"https://api.github.com/repos/numpy/numpy/issues/events{/number}","events_url":"https://api.github.com/repos/numpy/numpy/events","assignees_url":"https://api.github.com/repos/numpy/numpy/assignees{/user}","branches_url":"https://api.github.com/repos/numpy/numpy/branches{/branch}","tags_url":"https://api.github.com/repos/numpy/numpy/tags","blobs_url":"https://api.github.com/repos/numpy/numpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/numpy/numpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/numpy/numpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/numpy/numpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/numpy/numpy/statuses/{sha}","languages_url":"https://api.github.com/repos/numpy/numpy/languages","stargazers_url":"https://api.github.com/repos/numpy/numpy/stargazers","contributors_url":"https://api.github.com/repos/numpy/numpy/contributors","subscribers_url":"https://api.github.com/repos/numpy/numpy/subscribers","subscription_url":"https://api.github.com/repos/numpy/numpy/subscription","commits_url":"https://api.github.com/repos/numpy/numpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/numpy/numpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/numpy/numpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/numpy/numpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/numpy/numpy/contents/{+path}","compare_url":"https://api.github.com/repos/numpy/numpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/numpy/numpy/merges","archive_url":"https://api.github.com/repos/numpy/numpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/numpy/numpy/downloads","issues_url":"https://api.github.com/repos/numpy/numpy/issues{/number}","pulls_url":"https://api.github.com/repos/numpy/numpy/pulls{/number}","milestones_url":"https://api.github.com/repos/numpy/numpy/milestones{/number}","notifications_url":"https://api.github.com/repos/numpy/numpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/numpy/numpy/labels{/name}","releases_url":"https://api.github.com/repos/numpy/numpy/releases{/id}","deployments_url":"https://api.github.com/repos/numpy/numpy/deployments","created_at":"2010-09-13T23:02:39Z","updated_at":"2017-08-24T00:13:56Z","pushed_at":"2017-08-23T18:45:25Z","git_url":"git://github.com/numpy/numpy.git","ssh_url":"git@github.com:numpy/numpy.git","clone_url":"https://github.com/numpy/numpy.git","svn_url":"https://github.com/numpy/numpy","homepage":"http://www.numpy.org/","size":51745,"stargazers_count":4889,"watchers_count":4889,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2218,"mirror_url":null,"open_issues_count":1673,"forks":2218,"open_issues":1673,"watchers":4889,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/numpy/numpy/pulls/9451"},"html":{"href":"https://github.com/numpy/numpy/pull/9451"},"issue":{"href":"https://api.github.com/repos/numpy/numpy/issues/9451"},"comments":{"href":"https://api.github.com/repos/numpy/numpy/issues/9451/comments"},"review_comments":{"href":"https://api.github.com/repos/numpy/numpy/pulls/9451/comments"},"review_comment":{"href":"https://api.github.com/repos/numpy/numpy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/numpy/numpy/pulls/9451/commits"},"statuses":{"href":"https://api.github.com/repos/numpy/numpy/statuses/586d53eed65c158cedc16c7102ef4557bb53ad7b"}}}}
{"actor":{"display_login":"njsmith"}}