{"action":"created","comment":{"url":"https://api.github.com/repos/sympy/sympy/pulls/comments/314852887","pull_request_review_id":276118850,"id":314852887,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMxNDg1Mjg4Nw==","diff_hunk":"@@ -253,27 +253,26 @@ def doit(self):\n         if not self.is_shape_numeric:\n             return self\n \n-        return ImmutableDenseNDimArray(self._expand_array())\n+        return self._expand_array()\n \n     def _expand_array(self):\n-        # To perform a subs at every element of the array.\n-        def _array_subs(arr, var, val):\n-            arr = MutableDenseNDimArray(arr)\n-            for i in range(len(arr)):\n-                index = arr._get_tuple_index(i)\n-                arr[index] = arr[index].subs(var, val)\n-            return arr.tolist()\n-\n-        list_gen = self.function\n-        for var, inf, sup in reversed(self._limits):\n-            list_expr = list_gen\n-            list_gen = []\n-            for val in range(inf, sup+1):\n-                if not isinstance(list_expr, Iterable):\n-                    list_gen.append(list_expr.subs(var, val))\n-                else:\n-                    list_gen.append(_array_subs(list_expr, var, val))\n-        return list_gen\n+        res = []","path":"sympy/tensor/array/array_comprehension.py","position":33,"original_position":33,"commit_id":"8b6f8b030d1462a666d14849fe8ab3fc487793b6","original_commit_id":"e0612b201eca78787aaa99417e42038d010fe889","user":{"login":"Upabjojr","id":4128856,"node_id":"MDQ6VXNlcjQxMjg4NTY=","avatar_url":"https://avatars0.githubusercontent.com/u/4128856?v=4","gravatar_id":"","url":"https://api.github.com/users/Upabjojr","html_url":"https://github.com/Upabjojr","followers_url":"https://api.github.com/users/Upabjojr/followers","following_url":"https://api.github.com/users/Upabjojr/following{/other_user}","gists_url":"https://api.github.com/users/Upabjojr/gists{/gist_id}","starred_url":"https://api.github.com/users/Upabjojr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Upabjojr/subscriptions","organizations_url":"https://api.github.com/users/Upabjojr/orgs","repos_url":"https://api.github.com/users/Upabjojr/repos","events_url":"https://api.github.com/users/Upabjojr/events{/privacy}","received_events_url":"https://api.github.com/users/Upabjojr/received_events","type":"User","site_admin":false},"body":"You can use a `res = MutableDenseNDimArray.zeros(shape)` object. At the end, call `res.as_immutable()` to make it immutable.","created_at":"2019-08-16T19:04:44Z","updated_at":"2019-08-16T19:04:50Z","html_url":"https://github.com/sympy/sympy/pull/17408#discussion_r314852887","pull_request_url":"https://api.github.com/repos/sympy/sympy/pulls/17408","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/sympy/sympy/pulls/comments/314852887"},"html":{"href":"https://github.com/sympy/sympy/pull/17408#discussion_r314852887"},"pull_request":{"href":"https://api.github.com/repos/sympy/sympy/pulls/17408"}}},"pull_request":{"url":"https://api.github.com/repos/sympy/sympy/pulls/17408","id":307027852,"node_id":"MDExOlB1bGxSZXF1ZXN0MzA3MDI3ODUy","html_url":"https://github.com/sympy/sympy/pull/17408","diff_url":"https://github.com/sympy/sympy/pull/17408.diff","patch_url":"https://github.com/sympy/sympy/pull/17408.patch","issue_url":"https://api.github.com/repos/sympy/sympy/issues/17408","number":17408,"state":"open","locked":false,"title":"Added support for lambda in ArrayComprehension","user":{"login":"kangzhiq","id":32410422,"node_id":"MDQ6VXNlcjMyNDEwNDIy","avatar_url":"https://avatars0.githubusercontent.com/u/32410422?v=4","gravatar_id":"","url":"https://api.github.com/users/kangzhiq","html_url":"https://github.com/kangzhiq","followers_url":"https://api.github.com/users/kangzhiq/followers","following_url":"https://api.github.com/users/kangzhiq/following{/other_user}","gists_url":"https://api.github.com/users/kangzhiq/gists{/gist_id}","starred_url":"https://api.github.com/users/kangzhiq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kangzhiq/subscriptions","organizations_url":"https://api.github.com/users/kangzhiq/orgs","repos_url":"https://api.github.com/users/kangzhiq/repos","events_url":"https://api.github.com/users/kangzhiq/events{/privacy}","received_events_url":"https://api.github.com/users/kangzhiq/received_events","type":"User","site_admin":false},"body":"\r\n\r\n<!-- Your title above should be a short description of what\r\nwas changed. Do not include the issue number in the title. -->\r\n\r\n#### References to other Issues or PRs\r\n<!-- If this pull request fixes an issue, write \"Fixes #NNNN\" in that exact\r\nformat, e.g. \"Fixes #1234\". See\r\nhttps://github.com/blog/1506-closing-issues-via-pull-requests . Please also\r\nwrite a comment on that issue linking back to this pull request once it is\r\nopen. -->\r\n#17057\r\n\r\n\r\n#### Brief description of what is fixed or changed\r\n- Added support for lambda expression in ArrayComprehension\r\nThanks to this PR, ArrayComprehension can accept lambda expression as a function to be extended.\r\nAt most 1 element can be passed to the lambda expression in order to avoid ambiguous expression.\r\nNow:\r\n```python\r\n>>> ArrayComprehension(lambda: 3, (i, 1, 5)).doit()\r\n[3, 3, 3, 3, 3]\r\n>>> ArrayComprehension(lambda i: i+1, (i, 1, 5)).doit()\r\n[2, 3, 4, 5, 6]\r\n```\r\n\r\n- Added tests accordingly\r\n\r\n#### Other comments\r\n\r\n\r\n#### Release Notes\r\n\r\n<!-- Write the release notes for this release below. See\r\nhttps://github.com/sympy/sympy/wiki/Writing-Release-Notes for more information\r\non how to write release notes. The bot will check your release notes\r\nautomatically to see if they are formatted correctly. -->\r\n\r\n<!-- BEGIN RELEASE NOTES -->\r\n* tensor\r\n  * Enabled lamda expression in ArrayComprehension\r\n<!-- END RELEASE NOTES -->\r\n","created_at":"2019-08-13T18:36:30Z","updated_at":"2019-08-16T19:04:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a9772c2c39c5bc961c55b43228b30d3f38e8dd0e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":200654473,"node_id":"MDU6TGFiZWwyMDA2NTQ0NzM=","url":"https://api.github.com/repos/sympy/sympy/labels/tensor","name":"tensor","color":"0000FF","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/sympy/sympy/pulls/17408/commits","review_comments_url":"https://api.github.com/repos/sympy/sympy/pulls/17408/comments","review_comment_url":"https://api.github.com/repos/sympy/sympy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sympy/sympy/issues/17408/comments","statuses_url":"https://api.github.com/repos/sympy/sympy/statuses/8b6f8b030d1462a666d14849fe8ab3fc487793b6","head":{"label":"kangzhiq:enable_lambda","ref":"enable_lambda","sha":"8b6f8b030d1462a666d14849fe8ab3fc487793b6","user":{"login":"kangzhiq","id":32410422,"node_id":"MDQ6VXNlcjMyNDEwNDIy","avatar_url":"https://avatars0.githubusercontent.com/u/32410422?v=4","gravatar_id":"","url":"https://api.github.com/users/kangzhiq","html_url":"https://github.com/kangzhiq","followers_url":"https://api.github.com/users/kangzhiq/followers","following_url":"https://api.github.com/users/kangzhiq/following{/other_user}","gists_url":"https://api.github.com/users/kangzhiq/gists{/gist_id}","starred_url":"https://api.github.com/users/kangzhiq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kangzhiq/subscriptions","organizations_url":"https://api.github.com/users/kangzhiq/orgs","repos_url":"https://api.github.com/users/kangzhiq/repos","events_url":"https://api.github.com/users/kangzhiq/events{/privacy}","received_events_url":"https://api.github.com/users/kangzhiq/received_events","type":"User","site_admin":false},"repo":{"id":176237964,"node_id":"MDEwOlJlcG9zaXRvcnkxNzYyMzc5NjQ=","name":"sympy","full_name":"kangzhiq/sympy","private":false,"owner":{"login":"kangzhiq","id":32410422,"node_id":"MDQ6VXNlcjMyNDEwNDIy","avatar_url":"https://avatars0.githubusercontent.com/u/32410422?v=4","gravatar_id":"","url":"https://api.github.com/users/kangzhiq","html_url":"https://github.com/kangzhiq","followers_url":"https://api.github.com/users/kangzhiq/followers","following_url":"https://api.github.com/users/kangzhiq/following{/other_user}","gists_url":"https://api.github.com/users/kangzhiq/gists{/gist_id}","starred_url":"https://api.github.com/users/kangzhiq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kangzhiq/subscriptions","organizations_url":"https://api.github.com/users/kangzhiq/orgs","repos_url":"https://api.github.com/users/kangzhiq/repos","events_url":"https://api.github.com/users/kangzhiq/events{/privacy}","received_events_url":"https://api.github.com/users/kangzhiq/received_events","type":"User","site_admin":false},"html_url":"https://github.com/kangzhiq/sympy","description":"A computer algebra system written in pure Python","fork":true,"url":"https://api.github.com/repos/kangzhiq/sympy","forks_url":"https://api.github.com/repos/kangzhiq/sympy/forks","keys_url":"https://api.github.com/repos/kangzhiq/sympy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kangzhiq/sympy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kangzhiq/sympy/teams","hooks_url":"https://api.github.com/repos/kangzhiq/sympy/hooks","issue_events_url":"https://api.github.com/repos/kangzhiq/sympy/issues/events{/number}","events_url":"https://api.github.com/repos/kangzhiq/sympy/events","assignees_url":"https://api.github.com/repos/kangzhiq/sympy/assignees{/user}","branches_url":"https://api.github.com/repos/kangzhiq/sympy/branches{/branch}","tags_url":"https://api.github.com/repos/kangzhiq/sympy/tags","blobs_url":"https://api.github.com/repos/kangzhiq/sympy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kangzhiq/sympy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kangzhiq/sympy/git/refs{/sha}","trees_url":"https://api.github.com/repos/kangzhiq/sympy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kangzhiq/sympy/statuses/{sha}","languages_url":"https://api.github.com/repos/kangzhiq/sympy/languages","stargazers_url":"https://api.github.com/repos/kangzhiq/sympy/stargazers","contributors_url":"https://api.github.com/repos/kangzhiq/sympy/contributors","subscribers_url":"https://api.github.com/repos/kangzhiq/sympy/subscribers","subscription_url":"https://api.github.com/repos/kangzhiq/sympy/subscription","commits_url":"https://api.github.com/repos/kangzhiq/sympy/commits{/sha}","git_commits_url":"https://api.github.com/repos/kangzhiq/sympy/git/commits{/sha}","comments_url":"https://api.github.com/repos/kangzhiq/sympy/comments{/number}","issue_comment_url":"https://api.github.com/repos/kangzhiq/sympy/issues/comments{/number}","contents_url":"https://api.github.com/repos/kangzhiq/sympy/contents/{+path}","compare_url":"https://api.github.com/repos/kangzhiq/sympy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kangzhiq/sympy/merges","archive_url":"https://api.github.com/repos/kangzhiq/sympy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kangzhiq/sympy/downloads","issues_url":"https://api.github.com/repos/kangzhiq/sympy/issues{/number}","pulls_url":"https://api.github.com/repos/kangzhiq/sympy/pulls{/number}","milestones_url":"https://api.github.com/repos/kangzhiq/sympy/milestones{/number}","notifications_url":"https://api.github.com/repos/kangzhiq/sympy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kangzhiq/sympy/labels{/name}","releases_url":"https://api.github.com/repos/kangzhiq/sympy/releases{/id}","deployments_url":"https://api.github.com/repos/kangzhiq/sympy/deployments","created_at":"2019-03-18T08:35:01Z","updated_at":"2019-08-13T17:47:37Z","pushed_at":"2019-08-16T19:02:31Z","git_url":"git://github.com/kangzhiq/sympy.git","ssh_url":"git@github.com:kangzhiq/sympy.git","clone_url":"https://github.com/kangzhiq/sympy.git","svn_url":"https://github.com/kangzhiq/sympy","homepage":"https://sympy.org/","size":109377,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sympy:master","ref":"master","sha":"fbcf583eaa9996cd8931eaeb6384cdfb2e0da632","user":{"login":"sympy","id":260832,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2MDgzMg==","avatar_url":"https://avatars1.githubusercontent.com/u/260832?v=4","gravatar_id":"","url":"https://api.github.com/users/sympy","html_url":"https://github.com/sympy","followers_url":"https://api.github.com/users/sympy/followers","following_url":"https://api.github.com/users/sympy/following{/other_user}","gists_url":"https://api.github.com/users/sympy/gists{/gist_id}","starred_url":"https://api.github.com/users/sympy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sympy/subscriptions","organizations_url":"https://api.github.com/users/sympy/orgs","repos_url":"https://api.github.com/users/sympy/repos","events_url":"https://api.github.com/users/sympy/events{/privacy}","received_events_url":"https://api.github.com/users/sympy/received_events","type":"Organization","site_admin":false},"repo":{"id":640534,"node_id":"MDEwOlJlcG9zaXRvcnk2NDA1MzQ=","name":"sympy","full_name":"sympy/sympy","private":false,"owner":{"login":"sympy","id":260832,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2MDgzMg==","avatar_url":"https://avatars1.githubusercontent.com/u/260832?v=4","gravatar_id":"","url":"https://api.github.com/users/sympy","html_url":"https://github.com/sympy","followers_url":"https://api.github.com/users/sympy/followers","following_url":"https://api.github.com/users/sympy/following{/other_user}","gists_url":"https://api.github.com/users/sympy/gists{/gist_id}","starred_url":"https://api.github.com/users/sympy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sympy/subscriptions","organizations_url":"https://api.github.com/users/sympy/orgs","repos_url":"https://api.github.com/users/sympy/repos","events_url":"https://api.github.com/users/sympy/events{/privacy}","received_events_url":"https://api.github.com/users/sympy/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/sympy/sympy","description":"A computer algebra system written in pure Python","fork":false,"url":"https://api.github.com/repos/sympy/sympy","forks_url":"https://api.github.com/repos/sympy/sympy/forks","keys_url":"https://api.github.com/repos/sympy/sympy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sympy/sympy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sympy/sympy/teams","hooks_url":"https://api.github.com/repos/sympy/sympy/hooks","issue_events_url":"https://api.github.com/repos/sympy/sympy/issues/events{/number}","events_url":"https://api.github.com/repos/sympy/sympy/events","assignees_url":"https://api.github.com/repos/sympy/sympy/assignees{/user}","branches_url":"https://api.github.com/repos/sympy/sympy/branches{/branch}","tags_url":"https://api.github.com/repos/sympy/sympy/tags","blobs_url":"https://api.github.com/repos/sympy/sympy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sympy/sympy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sympy/sympy/git/refs{/sha}","trees_url":"https://api.github.com/repos/sympy/sympy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sympy/sympy/statuses/{sha}","languages_url":"https://api.github.com/repos/sympy/sympy/languages","stargazers_url":"https://api.github.com/repos/sympy/sympy/stargazers","contributors_url":"https://api.github.com/repos/sympy/sympy/contributors","subscribers_url":"https://api.github.com/repos/sympy/sympy/subscribers","subscription_url":"https://api.github.com/repos/sympy/sympy/subscription","commits_url":"https://api.github.com/repos/sympy/sympy/commits{/sha}","git_commits_url":"https://api.github.com/repos/sympy/sympy/git/commits{/sha}","comments_url":"https://api.github.com/repos/sympy/sympy/comments{/number}","issue_comment_url":"https://api.github.com/repos/sympy/sympy/issues/comments{/number}","contents_url":"https://api.github.com/repos/sympy/sympy/contents/{+path}","compare_url":"https://api.github.com/repos/sympy/sympy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sympy/sympy/merges","archive_url":"https://api.github.com/repos/sympy/sympy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sympy/sympy/downloads","issues_url":"https://api.github.com/repos/sympy/sympy/issues{/number}","pulls_url":"https://api.github.com/repos/sympy/sympy/pulls{/number}","milestones_url":"https://api.github.com/repos/sympy/sympy/milestones{/number}","notifications_url":"https://api.github.com/repos/sympy/sympy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sympy/sympy/labels{/name}","releases_url":"https://api.github.com/repos/sympy/sympy/releases{/id}","deployments_url":"https://api.github.com/repos/sympy/sympy/deployments","created_at":"2010-04-30T20:37:14Z","updated_at":"2019-08-16T16:49:48Z","pushed_at":"2019-08-16T19:02:35Z","git_url":"git://github.com/sympy/sympy.git","ssh_url":"git@github.com:sympy/sympy.git","clone_url":"https://github.com/sympy/sympy.git","svn_url":"https://github.com/sympy/sympy","homepage":"https://sympy.org/","size":109930,"stargazers_count":6126,"watchers_count":6126,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2680,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":3605,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2680,"open_issues":3605,"watchers":6126,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sympy/sympy/pulls/17408"},"html":{"href":"https://github.com/sympy/sympy/pull/17408"},"issue":{"href":"https://api.github.com/repos/sympy/sympy/issues/17408"},"comments":{"href":"https://api.github.com/repos/sympy/sympy/issues/17408/comments"},"review_comments":{"href":"https://api.github.com/repos/sympy/sympy/pulls/17408/comments"},"review_comment":{"href":"https://api.github.com/repos/sympy/sympy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sympy/sympy/pulls/17408/commits"},"statuses":{"href":"https://api.github.com/repos/sympy/sympy/statuses/8b6f8b030d1462a666d14849fe8ab3fc487793b6"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Upabjojr"}}