{"action":"created","comment":{"url":"https://api.github.com/repos/sympy/sympy/pulls/comments/167085219","pull_request_review_id":95253971,"id":167085219,"diff_hunk":"@@ -626,16 +620,98 @@ def convert_xor(tokens, local_dict, global_dict):\n \n     return result\n \n+def repeated_decimals(tokens, local_dict, global_dict):\n+    \"\"\"\n+    Allows 0.2[1] notation to represent the repeated decimal 0.2111... (19/90)\n+\n+    Run this before auto_number.\n+\n+    \"\"\"\n+    result = []\n+\n+    # num will running match any DECIMAL [ INTEGER ]\n+    num = []\n+    for toknum, tokval in tokens:\n+        if toknum == NUMBER:\n+            if (not num and '.' in tokval and 'e' not in tokval.lower() and\n+                'j' not in tokval.lower()):\n+                num.append((toknum, tokval))\n+            elif tokval.isdigit() and len(num) == 2:\n+                num.append((toknum, tokval))\n+            elif tokval.isdigit() and len(num) == 3 and num[-1][1].isdigit():\n+                # Python 3 tokenizes 00123 as '00', '123'\n+                # Python 3 tokenizes 01289 as '012', '89'\n+                num.append((toknum, tokval))\n+            else:\n+                num = []\n+        elif toknum == OP:\n+            if tokval == '[' and len(num) == 1:\n+                num.append((OP, tokval))\n+            elif tokval == ']' and len(num) >= 3:\n+                num.append((OP, tokval))\n+            elif tokval == '.' and not num:\n+                # handle .[1]\n+                num.append((NUMBER, '0.'))\n+            else:\n+                num = []\n+        else:\n+            num = []\n+\n+        result.append((toknum, tokval))\n+\n+        if num and num[-1][1] == ']':\n+            # pre.post[repetend] = a + b/c + d/e where a = pre, b/c = post,\n+            # and d/e = repetend\n+            result = result[:-len(num)]\n+            pre, post = num[0][1].split('.')\n+            repetend = num[2][1]\n+            if len(num) == 5:\n+                repetend += num[3][1]","path":"sympy/parsing/sympy_parser.py","position":114,"original_position":114,"commit_id":"c8838979200db5c251377468f17aae17a26cc9c1","original_commit_id":"898c03622eafca9cc7862962e1e1f09d006a5056","user":{"login":"asmeurer","id":71486,"avatar_url":"https://avatars3.githubusercontent.com/u/71486?v=4","gravatar_id":"","url":"https://api.github.com/users/asmeurer","html_url":"https://github.com/asmeurer","followers_url":"https://api.github.com/users/asmeurer/followers","following_url":"https://api.github.com/users/asmeurer/following{/other_user}","gists_url":"https://api.github.com/users/asmeurer/gists{/gist_id}","starred_url":"https://api.github.com/users/asmeurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asmeurer/subscriptions","organizations_url":"https://api.github.com/users/asmeurer/orgs","repos_url":"https://api.github.com/users/asmeurer/repos","events_url":"https://api.github.com/users/asmeurer/events{/privacy}","received_events_url":"https://api.github.com/users/asmeurer/received_events","type":"User","site_admin":false},"body":"In case anyone is wondering why the joining is done here instead of [above](https://github.com/sympy/sympy/pull/14085/files#diff-c3f3cb4004234277039032a7201a70a8R644) it's because we still have to account for truncating `result` [here](https://github.com/sympy/sympy/pull/14085/files#diff-c3f3cb4004234277039032a7201a70a8R665). If we simply join and keep `len(num) == 4`, the size of `result` will be off.","created_at":"2018-02-08T22:18:57Z","updated_at":"2018-02-08T22:18:57Z","html_url":"https://github.com/sympy/sympy/pull/14085#discussion_r167085219","pull_request_url":"https://api.github.com/repos/sympy/sympy/pulls/14085","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/sympy/sympy/pulls/comments/167085219"},"html":{"href":"https://github.com/sympy/sympy/pull/14085#discussion_r167085219"},"pull_request":{"href":"https://api.github.com/repos/sympy/sympy/pulls/14085"}}},"pull_request":{"url":"https://api.github.com/repos/sympy/sympy/pulls/14085","id":167274288,"html_url":"https://github.com/sympy/sympy/pull/14085","diff_url":"https://github.com/sympy/sympy/pull/14085.diff","patch_url":"https://github.com/sympy/sympy/pull/14085.patch","issue_url":"https://api.github.com/repos/sympy/sympy/issues/14085","number":14085,"state":"open","locked":false,"title":"Remove the sympy_tokenize module in favor of the standard library tokenize","user":{"login":"asmeurer","id":71486,"avatar_url":"https://avatars3.githubusercontent.com/u/71486?v=4","gravatar_id":"","url":"https://api.github.com/users/asmeurer","html_url":"https://github.com/asmeurer","followers_url":"https://api.github.com/users/asmeurer/followers","following_url":"https://api.github.com/users/asmeurer/following{/other_user}","gists_url":"https://api.github.com/users/asmeurer/gists{/gist_id}","starred_url":"https://api.github.com/users/asmeurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asmeurer/subscriptions","organizations_url":"https://api.github.com/users/asmeurer/orgs","repos_url":"https://api.github.com/users/asmeurer/repos","events_url":"https://api.github.com/users/asmeurer/events{/privacy}","received_events_url":"https://api.github.com/users/asmeurer/received_events","type":"User","site_admin":false},"body":"<strike>I have not yet fixed the modifications to the tokenize module, which are\r\n\r\n- factorial (x!)\r\n- repeated decimals (0.[1])\r\n\r\nI also need to add tests for sympify('α') in Python 3.</strike>\r\n\r\nThis is ready for review.\r\n\r\nFixes #4862.\r\n","created_at":"2018-02-05T22:40:31Z","updated_at":"2018-02-08T22:18:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"22cb4b3d44514ce980ae5c3cb40847dc3639f309","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/sympy/sympy/pulls/14085/commits","review_comments_url":"https://api.github.com/repos/sympy/sympy/pulls/14085/comments","review_comment_url":"https://api.github.com/repos/sympy/sympy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sympy/sympy/issues/14085/comments","statuses_url":"https://api.github.com/repos/sympy/sympy/statuses/c8838979200db5c251377468f17aae17a26cc9c1","head":{"label":"asmeurer:tokenize","ref":"tokenize","sha":"c8838979200db5c251377468f17aae17a26cc9c1","user":{"login":"asmeurer","id":71486,"avatar_url":"https://avatars3.githubusercontent.com/u/71486?v=4","gravatar_id":"","url":"https://api.github.com/users/asmeurer","html_url":"https://github.com/asmeurer","followers_url":"https://api.github.com/users/asmeurer/followers","following_url":"https://api.github.com/users/asmeurer/following{/other_user}","gists_url":"https://api.github.com/users/asmeurer/gists{/gist_id}","starred_url":"https://api.github.com/users/asmeurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asmeurer/subscriptions","organizations_url":"https://api.github.com/users/asmeurer/orgs","repos_url":"https://api.github.com/users/asmeurer/repos","events_url":"https://api.github.com/users/asmeurer/events{/privacy}","received_events_url":"https://api.github.com/users/asmeurer/received_events","type":"User","site_admin":false},"repo":{"id":1206937,"name":"sympy","full_name":"asmeurer/sympy","owner":{"login":"asmeurer","id":71486,"avatar_url":"https://avatars3.githubusercontent.com/u/71486?v=4","gravatar_id":"","url":"https://api.github.com/users/asmeurer","html_url":"https://github.com/asmeurer","followers_url":"https://api.github.com/users/asmeurer/followers","following_url":"https://api.github.com/users/asmeurer/following{/other_user}","gists_url":"https://api.github.com/users/asmeurer/gists{/gist_id}","starred_url":"https://api.github.com/users/asmeurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asmeurer/subscriptions","organizations_url":"https://api.github.com/users/asmeurer/orgs","repos_url":"https://api.github.com/users/asmeurer/repos","events_url":"https://api.github.com/users/asmeurer/events{/privacy}","received_events_url":"https://api.github.com/users/asmeurer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/asmeurer/sympy","description":"A computer algebra system written in pure Python.","fork":true,"url":"https://api.github.com/repos/asmeurer/sympy","forks_url":"https://api.github.com/repos/asmeurer/sympy/forks","keys_url":"https://api.github.com/repos/asmeurer/sympy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/asmeurer/sympy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/asmeurer/sympy/teams","hooks_url":"https://api.github.com/repos/asmeurer/sympy/hooks","issue_events_url":"https://api.github.com/repos/asmeurer/sympy/issues/events{/number}","events_url":"https://api.github.com/repos/asmeurer/sympy/events","assignees_url":"https://api.github.com/repos/asmeurer/sympy/assignees{/user}","branches_url":"https://api.github.com/repos/asmeurer/sympy/branches{/branch}","tags_url":"https://api.github.com/repos/asmeurer/sympy/tags","blobs_url":"https://api.github.com/repos/asmeurer/sympy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/asmeurer/sympy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/asmeurer/sympy/git/refs{/sha}","trees_url":"https://api.github.com/repos/asmeurer/sympy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/asmeurer/sympy/statuses/{sha}","languages_url":"https://api.github.com/repos/asmeurer/sympy/languages","stargazers_url":"https://api.github.com/repos/asmeurer/sympy/stargazers","contributors_url":"https://api.github.com/repos/asmeurer/sympy/contributors","subscribers_url":"https://api.github.com/repos/asmeurer/sympy/subscribers","subscription_url":"https://api.github.com/repos/asmeurer/sympy/subscription","commits_url":"https://api.github.com/repos/asmeurer/sympy/commits{/sha}","git_commits_url":"https://api.github.com/repos/asmeurer/sympy/git/commits{/sha}","comments_url":"https://api.github.com/repos/asmeurer/sympy/comments{/number}","issue_comment_url":"https://api.github.com/repos/asmeurer/sympy/issues/comments{/number}","contents_url":"https://api.github.com/repos/asmeurer/sympy/contents/{+path}","compare_url":"https://api.github.com/repos/asmeurer/sympy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/asmeurer/sympy/merges","archive_url":"https://api.github.com/repos/asmeurer/sympy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/asmeurer/sympy/downloads","issues_url":"https://api.github.com/repos/asmeurer/sympy/issues{/number}","pulls_url":"https://api.github.com/repos/asmeurer/sympy/pulls{/number}","milestones_url":"https://api.github.com/repos/asmeurer/sympy/milestones{/number}","notifications_url":"https://api.github.com/repos/asmeurer/sympy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/asmeurer/sympy/labels{/name}","releases_url":"https://api.github.com/repos/asmeurer/sympy/releases{/id}","deployments_url":"https://api.github.com/repos/asmeurer/sympy/deployments","created_at":"2010-12-29T21:33:53Z","updated_at":"2017-06-06T04:18:31Z","pushed_at":"2018-02-08T22:16:49Z","git_url":"git://github.com/asmeurer/sympy.git","ssh_url":"git@github.com:asmeurer/sympy.git","clone_url":"https://github.com/asmeurer/sympy.git","svn_url":"https://github.com/asmeurer/sympy","homepage":"http://sympy.org/","size":93395,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":3,"open_issues":2,"watchers":7,"default_branch":"master"}},"base":{"label":"sympy:master","ref":"master","sha":"b95ffadae8cfad3acf15fada28140373c896b766","user":{"login":"sympy","id":260832,"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,"name":"sympy","full_name":"sympy/sympy","owner":{"login":"sympy","id":260832,"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},"private":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":"2018-02-08T14:24:26Z","pushed_at":"2018-02-08T22:16:52Z","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":"http://sympy.org/","size":88293,"stargazers_count":4591,"watchers_count":4591,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2184,"mirror_url":null,"archived":false,"open_issues_count":3101,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":2184,"open_issues":3101,"watchers":4591,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sympy/sympy/pulls/14085"},"html":{"href":"https://github.com/sympy/sympy/pull/14085"},"issue":{"href":"https://api.github.com/repos/sympy/sympy/issues/14085"},"comments":{"href":"https://api.github.com/repos/sympy/sympy/issues/14085/comments"},"review_comments":{"href":"https://api.github.com/repos/sympy/sympy/pulls/14085/comments"},"review_comment":{"href":"https://api.github.com/repos/sympy/sympy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sympy/sympy/pulls/14085/commits"},"statuses":{"href":"https://api.github.com/repos/sympy/sympy/statuses/c8838979200db5c251377468f17aae17a26cc9c1"}},"author_association":"OWNER"}}
{"actor":{"display_login":"asmeurer"}}