{"action":"created","comment":{"url":"https://api.github.com/repos/numpy/numpy/pulls/comments/74710367","id":74710367,"diff_hunk":"@@ -266,7 +272,19 @@ def iscomplexobj(x):\n     True\n \n     \"\"\"\n-    return issubclass(asarray(x).dtype.type, _nx.complexfloating)\n+    try:\n+        dtype = x.dtype\n+    except AttributeError:\n+        dtype = asarray(x).dtype\n+        try:\n+            return issubclass(dtype.type, _nx.complexfloating)\n+        except AttributeError:\n+            # The numpy.testing.utils.assert_equal routine relies on calling\n+            # iscomplexobj with weird arguments (types) and catches ValueErrors\n+            # only. We therefore convert AttributeError to ValueError to\n+            # maintain a compatible interface.","path":"numpy/lib/type_check.py","position":28,"original_position":28,"commit_id":"c9113c5e0221a06200a468e8fb6374548f6af9be","original_commit_id":"c9113c5e0221a06200a468e8fb6374548f6af9be","user":{"login":"shoyer","id":1217238,"avatar_url":"https://avatars.githubusercontent.com/u/1217238?v=3","gravatar_id":"","url":"https://api.github.com/users/shoyer","html_url":"https://github.com/shoyer","followers_url":"https://api.github.com/users/shoyer/followers","following_url":"https://api.github.com/users/shoyer/following{/other_user}","gists_url":"https://api.github.com/users/shoyer/gists{/gist_id}","starred_url":"https://api.github.com/users/shoyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoyer/subscriptions","organizations_url":"https://api.github.com/users/shoyer/orgs","repos_url":"https://api.github.com/users/shoyer/repos","events_url":"https://api.github.com/users/shoyer/events{/privacy}","received_events_url":"https://api.github.com/users/shoyer/received_events","type":"User","site_admin":false},"body":"Is this really part of the public API? Could we simply fix `assert_equal` instead?\r\n\r\nThis seems like an unfortunate work around to preserve for backwards compatibility.","created_at":"2016-08-14T23:09:04Z","updated_at":"2016-08-14T23:09:04Z","html_url":"https://github.com/numpy/numpy/pull/7936#discussion_r74710367","pull_request_url":"https://api.github.com/repos/numpy/numpy/pulls/7936","_links":{"self":{"href":"https://api.github.com/repos/numpy/numpy/pulls/comments/74710367"},"html":{"href":"https://github.com/numpy/numpy/pull/7936#discussion_r74710367"},"pull_request":{"href":"https://api.github.com/repos/numpy/numpy/pulls/7936"}}},"pull_request":{"url":"https://api.github.com/repos/numpy/numpy/pulls/7936","id":81254312,"html_url":"https://github.com/numpy/numpy/pull/7936","diff_url":"https://github.com/numpy/numpy/pull/7936.diff","patch_url":"https://github.com/numpy/numpy/pull/7936.patch","issue_url":"https://api.github.com/repos/numpy/numpy/issues/7936","number":7936,"state":"open","locked":false,"title":"ENH: improve duck typing inside iscomplexobj","user":{"login":"goerz","id":112306,"avatar_url":"https://avatars.githubusercontent.com/u/112306?v=3","gravatar_id":"","url":"https://api.github.com/users/goerz","html_url":"https://github.com/goerz","followers_url":"https://api.github.com/users/goerz/followers","following_url":"https://api.github.com/users/goerz/following{/other_user}","gists_url":"https://api.github.com/users/goerz/gists{/gist_id}","starred_url":"https://api.github.com/users/goerz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goerz/subscriptions","organizations_url":"https://api.github.com/users/goerz/orgs","repos_url":"https://api.github.com/users/goerz/repos","events_url":"https://api.github.com/users/goerz/events{/privacy}","received_events_url":"https://api.github.com/users/goerz/received_events","type":"User","site_admin":false},"body":"Both `iscomplexobj` and `isrealobj` now try to refer to the argument's\r\n`dtype` attribute if it exists. This significantly extends the types for\r\nwhich `iscomplexobj` returns correct results (to e.g. scipy sparse\r\nmatrices).\r\n\r\nThis fixes #7924","created_at":"2016-08-14T21:01:53Z","updated_at":"2016-08-14T23:09:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eb054dd1ca34a6d2b1cd2d9dacb6678f7848e5a7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/numpy/numpy/pulls/7936/commits","review_comments_url":"https://api.github.com/repos/numpy/numpy/pulls/7936/comments","review_comment_url":"https://api.github.com/repos/numpy/numpy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/7936/comments","statuses_url":"https://api.github.com/repos/numpy/numpy/statuses/c9113c5e0221a06200a468e8fb6374548f6af9be","head":{"label":"goerz:sparse-type-check","ref":"sparse-type-check","sha":"c9113c5e0221a06200a468e8fb6374548f6af9be","user":{"login":"goerz","id":112306,"avatar_url":"https://avatars.githubusercontent.com/u/112306?v=3","gravatar_id":"","url":"https://api.github.com/users/goerz","html_url":"https://github.com/goerz","followers_url":"https://api.github.com/users/goerz/followers","following_url":"https://api.github.com/users/goerz/following{/other_user}","gists_url":"https://api.github.com/users/goerz/gists{/gist_id}","starred_url":"https://api.github.com/users/goerz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goerz/subscriptions","organizations_url":"https://api.github.com/users/goerz/orgs","repos_url":"https://api.github.com/users/goerz/repos","events_url":"https://api.github.com/users/goerz/events{/privacy}","received_events_url":"https://api.github.com/users/goerz/received_events","type":"User","site_admin":false},"repo":{"id":65685588,"name":"numpy","full_name":"goerz/numpy","owner":{"login":"goerz","id":112306,"avatar_url":"https://avatars.githubusercontent.com/u/112306?v=3","gravatar_id":"","url":"https://api.github.com/users/goerz","html_url":"https://github.com/goerz","followers_url":"https://api.github.com/users/goerz/followers","following_url":"https://api.github.com/users/goerz/following{/other_user}","gists_url":"https://api.github.com/users/goerz/gists{/gist_id}","starred_url":"https://api.github.com/users/goerz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goerz/subscriptions","organizations_url":"https://api.github.com/users/goerz/orgs","repos_url":"https://api.github.com/users/goerz/repos","events_url":"https://api.github.com/users/goerz/events{/privacy}","received_events_url":"https://api.github.com/users/goerz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/goerz/numpy","description":"Numpy main repository","fork":true,"url":"https://api.github.com/repos/goerz/numpy","forks_url":"https://api.github.com/repos/goerz/numpy/forks","keys_url":"https://api.github.com/repos/goerz/numpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/goerz/numpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/goerz/numpy/teams","hooks_url":"https://api.github.com/repos/goerz/numpy/hooks","issue_events_url":"https://api.github.com/repos/goerz/numpy/issues/events{/number}","events_url":"https://api.github.com/repos/goerz/numpy/events","assignees_url":"https://api.github.com/repos/goerz/numpy/assignees{/user}","branches_url":"https://api.github.com/repos/goerz/numpy/branches{/branch}","tags_url":"https://api.github.com/repos/goerz/numpy/tags","blobs_url":"https://api.github.com/repos/goerz/numpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/goerz/numpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/goerz/numpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/goerz/numpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/goerz/numpy/statuses/{sha}","languages_url":"https://api.github.com/repos/goerz/numpy/languages","stargazers_url":"https://api.github.com/repos/goerz/numpy/stargazers","contributors_url":"https://api.github.com/repos/goerz/numpy/contributors","subscribers_url":"https://api.github.com/repos/goerz/numpy/subscribers","subscription_url":"https://api.github.com/repos/goerz/numpy/subscription","commits_url":"https://api.github.com/repos/goerz/numpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/goerz/numpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/goerz/numpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/goerz/numpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/goerz/numpy/contents/{+path}","compare_url":"https://api.github.com/repos/goerz/numpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/goerz/numpy/merges","archive_url":"https://api.github.com/repos/goerz/numpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/goerz/numpy/downloads","issues_url":"https://api.github.com/repos/goerz/numpy/issues{/number}","pulls_url":"https://api.github.com/repos/goerz/numpy/pulls{/number}","milestones_url":"https://api.github.com/repos/goerz/numpy/milestones{/number}","notifications_url":"https://api.github.com/repos/goerz/numpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/goerz/numpy/labels{/name}","releases_url":"https://api.github.com/repos/goerz/numpy/releases{/id}","deployments_url":"https://api.github.com/repos/goerz/numpy/deployments","created_at":"2016-08-14T20:43:24Z","updated_at":"2016-08-14T20:43:30Z","pushed_at":"2016-08-14T22:24:55Z","git_url":"git://github.com/goerz/numpy.git","ssh_url":"git@github.com:goerz/numpy.git","clone_url":"https://github.com/goerz/numpy.git","svn_url":"https://github.com/goerz/numpy","homepage":"http://www.numpy.org/","size":41700,"stargazers_count":0,"watchers_count":0,"language":"C","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":"numpy:master","ref":"master","sha":"e1f191c46f2eebd6cb892a4bfe14d9dd43a06c4e","user":{"login":"numpy","id":288276,"avatar_url":"https://avatars.githubusercontent.com/u/288276?v=3","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://avatars.githubusercontent.com/u/288276?v=3","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":"2016-08-14T13:00:05Z","pushed_at":"2016-08-14T22:24:57Z","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":78656,"stargazers_count":3246,"watchers_count":3246,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1643,"mirror_url":null,"open_issues_count":1263,"forks":1643,"open_issues":1263,"watchers":3246,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/numpy/numpy/pulls/7936"},"html":{"href":"https://github.com/numpy/numpy/pull/7936"},"issue":{"href":"https://api.github.com/repos/numpy/numpy/issues/7936"},"comments":{"href":"https://api.github.com/repos/numpy/numpy/issues/7936/comments"},"review_comments":{"href":"https://api.github.com/repos/numpy/numpy/pulls/7936/comments"},"review_comment":{"href":"https://api.github.com/repos/numpy/numpy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/numpy/numpy/pulls/7936/commits"},"statuses":{"href":"https://api.github.com/repos/numpy/numpy/statuses/c9113c5e0221a06200a468e8fb6374548f6af9be"}}}}
{"actor":{"display_login":"shoyer"}}