{"action":"created","comment":{"url":"https://api.github.com/repos/pytoolz/toolz/pulls/comments/36596295","id":36596295,"diff_hunk":"@@ -6,4 +6,11 @@ def raises(err, lamda):\n         return True\n \n \n-no_default = '__no__default__'\n+@object.__new__\n+class no_default(object):\n+    def __new__(self):\n+        raise TypeError(\"cannot create 'no_default' instances\")\n+\n+    def __str__(self):\n+        return '<object no_default>'\n+    __repr__ = __str__","path":"toolz/utils.py","position":12,"original_position":12,"commit_id":"2e961b92051e29f83d2325818c34bd16ac1665a4","original_commit_id":"2e961b92051e29f83d2325818c34bd16ac1665a4","user":{"login":"llllllllll","id":3064397,"avatar_url":"https://avatars.githubusercontent.com/u/3064397?v=3","gravatar_id":"","url":"https://api.github.com/users/llllllllll","html_url":"https://github.com/llllllllll","followers_url":"https://api.github.com/users/llllllllll/followers","following_url":"https://api.github.com/users/llllllllll/following{/other_user}","gists_url":"https://api.github.com/users/llllllllll/gists{/gist_id}","starred_url":"https://api.github.com/users/llllllllll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/llllllllll/subscriptions","organizations_url":"https://api.github.com/users/llllllllll/orgs","repos_url":"https://api.github.com/users/llllllllll/repos","events_url":"https://api.github.com/users/llllllllll/events{/privacy}","received_events_url":"https://api.github.com/users/llllllllll/received_events","type":"User","site_admin":false},"body":"My main concern with the original implementation is that `__no_default__` is a valid element of the domain for the default value. If you use a sentinal object and do pointer equality on it, the only way to get that value is by explicitly importing it which means you know what you are doing. The sentinal object effectivly removes the chance of ignoring a default that you actually wanted.\r\n\r\nThe instance of `no_default` here is to address @eriknw's concern that we lost information when debugging.","created_at":"2015-08-10T00:49:09Z","updated_at":"2015-08-10T00:49:09Z","html_url":"https://github.com/pytoolz/toolz/pull/253#discussion_r36596295","pull_request_url":"https://api.github.com/repos/pytoolz/toolz/pulls/253","_links":{"self":{"href":"https://api.github.com/repos/pytoolz/toolz/pulls/comments/36596295"},"html":{"href":"https://github.com/pytoolz/toolz/pull/253#discussion_r36596295"},"pull_request":{"href":"https://api.github.com/repos/pytoolz/toolz/pulls/253"}}},"pull_request":{"url":"https://api.github.com/repos/pytoolz/toolz/pulls/253","id":40952844,"html_url":"https://github.com/pytoolz/toolz/pull/253","diff_url":"https://github.com/pytoolz/toolz/pull/253.diff","patch_url":"https://github.com/pytoolz/toolz/pull/253.patch","issue_url":"https://api.github.com/repos/pytoolz/toolz/issues/253","number":253,"state":"open","locked":false,"title":"ENH: Adds `start` argument to accumulate","user":{"login":"llllllllll","id":3064397,"avatar_url":"https://avatars.githubusercontent.com/u/3064397?v=3","gravatar_id":"","url":"https://api.github.com/users/llllllllll","html_url":"https://github.com/llllllllll","followers_url":"https://api.github.com/users/llllllllll/followers","following_url":"https://api.github.com/users/llllllllll/following{/other_user}","gists_url":"https://api.github.com/users/llllllllll/gists{/gist_id}","starred_url":"https://api.github.com/users/llllllllll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/llllllllll/subscriptions","organizations_url":"https://api.github.com/users/llllllllll/orgs","repos_url":"https://api.github.com/users/llllllllll/repos","events_url":"https://api.github.com/users/llllllllll/events{/privacy}","received_events_url":"https://api.github.com/users/llllllllll/received_events","type":"User","site_admin":false},"body":"http://hackage.haskell.org/package/base-4.8.1.0/docs/Prelude.html#v:scanl\r\n\r\nThis is a function I use constantly. This python implementation sort of mixes scanl and scanl1. I think it is more pythonic to have this as a single function with an optional argument even if it means flipping the args.` on the scanl case.\r\n\r\n__edit__: Updated pr to add the argument to accumulate.","created_at":"2015-07-27T21:41:46Z","updated_at":"2015-08-10T00:49:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17aae721eacc1d560f728a80d7fb250977b51731","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pytoolz/toolz/pulls/253/commits","review_comments_url":"https://api.github.com/repos/pytoolz/toolz/pulls/253/comments","review_comment_url":"https://api.github.com/repos/pytoolz/toolz/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pytoolz/toolz/issues/253/comments","statuses_url":"https://api.github.com/repos/pytoolz/toolz/statuses/2e961b92051e29f83d2325818c34bd16ac1665a4","head":{"label":"llllllllll:scanl","ref":"scanl","sha":"2e961b92051e29f83d2325818c34bd16ac1665a4","user":{"login":"llllllllll","id":3064397,"avatar_url":"https://avatars.githubusercontent.com/u/3064397?v=3","gravatar_id":"","url":"https://api.github.com/users/llllllllll","html_url":"https://github.com/llllllllll","followers_url":"https://api.github.com/users/llllllllll/followers","following_url":"https://api.github.com/users/llllllllll/following{/other_user}","gists_url":"https://api.github.com/users/llllllllll/gists{/gist_id}","starred_url":"https://api.github.com/users/llllllllll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/llllllllll/subscriptions","organizations_url":"https://api.github.com/users/llllllllll/orgs","repos_url":"https://api.github.com/users/llllllllll/repos","events_url":"https://api.github.com/users/llllllllll/events{/privacy}","received_events_url":"https://api.github.com/users/llllllllll/received_events","type":"User","site_admin":false},"repo":{"id":39269079,"name":"toolz","full_name":"llllllllll/toolz","owner":{"login":"llllllllll","id":3064397,"avatar_url":"https://avatars.githubusercontent.com/u/3064397?v=3","gravatar_id":"","url":"https://api.github.com/users/llllllllll","html_url":"https://github.com/llllllllll","followers_url":"https://api.github.com/users/llllllllll/followers","following_url":"https://api.github.com/users/llllllllll/following{/other_user}","gists_url":"https://api.github.com/users/llllllllll/gists{/gist_id}","starred_url":"https://api.github.com/users/llllllllll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/llllllllll/subscriptions","organizations_url":"https://api.github.com/users/llllllllll/orgs","repos_url":"https://api.github.com/users/llllllllll/repos","events_url":"https://api.github.com/users/llllllllll/events{/privacy}","received_events_url":"https://api.github.com/users/llllllllll/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/llllllllll/toolz","description":"A functional standard library for Python.","fork":true,"url":"https://api.github.com/repos/llllllllll/toolz","forks_url":"https://api.github.com/repos/llllllllll/toolz/forks","keys_url":"https://api.github.com/repos/llllllllll/toolz/keys{/key_id}","collaborators_url":"https://api.github.com/repos/llllllllll/toolz/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/llllllllll/toolz/teams","hooks_url":"https://api.github.com/repos/llllllllll/toolz/hooks","issue_events_url":"https://api.github.com/repos/llllllllll/toolz/issues/events{/number}","events_url":"https://api.github.com/repos/llllllllll/toolz/events","assignees_url":"https://api.github.com/repos/llllllllll/toolz/assignees{/user}","branches_url":"https://api.github.com/repos/llllllllll/toolz/branches{/branch}","tags_url":"https://api.github.com/repos/llllllllll/toolz/tags","blobs_url":"https://api.github.com/repos/llllllllll/toolz/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/llllllllll/toolz/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/llllllllll/toolz/git/refs{/sha}","trees_url":"https://api.github.com/repos/llllllllll/toolz/git/trees{/sha}","statuses_url":"https://api.github.com/repos/llllllllll/toolz/statuses/{sha}","languages_url":"https://api.github.com/repos/llllllllll/toolz/languages","stargazers_url":"https://api.github.com/repos/llllllllll/toolz/stargazers","contributors_url":"https://api.github.com/repos/llllllllll/toolz/contributors","subscribers_url":"https://api.github.com/repos/llllllllll/toolz/subscribers","subscription_url":"https://api.github.com/repos/llllllllll/toolz/subscription","commits_url":"https://api.github.com/repos/llllllllll/toolz/commits{/sha}","git_commits_url":"https://api.github.com/repos/llllllllll/toolz/git/commits{/sha}","comments_url":"https://api.github.com/repos/llllllllll/toolz/comments{/number}","issue_comment_url":"https://api.github.com/repos/llllllllll/toolz/issues/comments{/number}","contents_url":"https://api.github.com/repos/llllllllll/toolz/contents/{+path}","compare_url":"https://api.github.com/repos/llllllllll/toolz/compare/{base}...{head}","merges_url":"https://api.github.com/repos/llllllllll/toolz/merges","archive_url":"https://api.github.com/repos/llllllllll/toolz/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/llllllllll/toolz/downloads","issues_url":"https://api.github.com/repos/llllllllll/toolz/issues{/number}","pulls_url":"https://api.github.com/repos/llllllllll/toolz/pulls{/number}","milestones_url":"https://api.github.com/repos/llllllllll/toolz/milestones{/number}","notifications_url":"https://api.github.com/repos/llllllllll/toolz/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/llllllllll/toolz/labels{/name}","releases_url":"https://api.github.com/repos/llllllllll/toolz/releases{/id}","created_at":"2015-07-17T18:24:34Z","updated_at":"2015-07-17T18:24:34Z","pushed_at":"2015-08-07T22:05:47Z","git_url":"git://github.com/llllllllll/toolz.git","ssh_url":"git@github.com:llllllllll/toolz.git","clone_url":"https://github.com/llllllllll/toolz.git","svn_url":"https://github.com/llllllllll/toolz","homepage":"http://toolz.readthedocs.org/","size":721,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"pytoolz:master","ref":"master","sha":"330f8279adf531b4b509c033441615ea547bf164","user":{"login":"pytoolz","id":5448828,"avatar_url":"https://avatars.githubusercontent.com/u/5448828?v=3","gravatar_id":"","url":"https://api.github.com/users/pytoolz","html_url":"https://github.com/pytoolz","followers_url":"https://api.github.com/users/pytoolz/followers","following_url":"https://api.github.com/users/pytoolz/following{/other_user}","gists_url":"https://api.github.com/users/pytoolz/gists{/gist_id}","starred_url":"https://api.github.com/users/pytoolz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pytoolz/subscriptions","organizations_url":"https://api.github.com/users/pytoolz/orgs","repos_url":"https://api.github.com/users/pytoolz/repos","events_url":"https://api.github.com/users/pytoolz/events{/privacy}","received_events_url":"https://api.github.com/users/pytoolz/received_events","type":"Organization","site_admin":false},"repo":{"id":12799539,"name":"toolz","full_name":"pytoolz/toolz","owner":{"login":"pytoolz","id":5448828,"avatar_url":"https://avatars.githubusercontent.com/u/5448828?v=3","gravatar_id":"","url":"https://api.github.com/users/pytoolz","html_url":"https://github.com/pytoolz","followers_url":"https://api.github.com/users/pytoolz/followers","following_url":"https://api.github.com/users/pytoolz/following{/other_user}","gists_url":"https://api.github.com/users/pytoolz/gists{/gist_id}","starred_url":"https://api.github.com/users/pytoolz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pytoolz/subscriptions","organizations_url":"https://api.github.com/users/pytoolz/orgs","repos_url":"https://api.github.com/users/pytoolz/repos","events_url":"https://api.github.com/users/pytoolz/events{/privacy}","received_events_url":"https://api.github.com/users/pytoolz/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pytoolz/toolz","description":"A functional standard library for Python.","fork":false,"url":"https://api.github.com/repos/pytoolz/toolz","forks_url":"https://api.github.com/repos/pytoolz/toolz/forks","keys_url":"https://api.github.com/repos/pytoolz/toolz/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pytoolz/toolz/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pytoolz/toolz/teams","hooks_url":"https://api.github.com/repos/pytoolz/toolz/hooks","issue_events_url":"https://api.github.com/repos/pytoolz/toolz/issues/events{/number}","events_url":"https://api.github.com/repos/pytoolz/toolz/events","assignees_url":"https://api.github.com/repos/pytoolz/toolz/assignees{/user}","branches_url":"https://api.github.com/repos/pytoolz/toolz/branches{/branch}","tags_url":"https://api.github.com/repos/pytoolz/toolz/tags","blobs_url":"https://api.github.com/repos/pytoolz/toolz/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pytoolz/toolz/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pytoolz/toolz/git/refs{/sha}","trees_url":"https://api.github.com/repos/pytoolz/toolz/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pytoolz/toolz/statuses/{sha}","languages_url":"https://api.github.com/repos/pytoolz/toolz/languages","stargazers_url":"https://api.github.com/repos/pytoolz/toolz/stargazers","contributors_url":"https://api.github.com/repos/pytoolz/toolz/contributors","subscribers_url":"https://api.github.com/repos/pytoolz/toolz/subscribers","subscription_url":"https://api.github.com/repos/pytoolz/toolz/subscription","commits_url":"https://api.github.com/repos/pytoolz/toolz/commits{/sha}","git_commits_url":"https://api.github.com/repos/pytoolz/toolz/git/commits{/sha}","comments_url":"https://api.github.com/repos/pytoolz/toolz/comments{/number}","issue_comment_url":"https://api.github.com/repos/pytoolz/toolz/issues/comments{/number}","contents_url":"https://api.github.com/repos/pytoolz/toolz/contents/{+path}","compare_url":"https://api.github.com/repos/pytoolz/toolz/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pytoolz/toolz/merges","archive_url":"https://api.github.com/repos/pytoolz/toolz/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pytoolz/toolz/downloads","issues_url":"https://api.github.com/repos/pytoolz/toolz/issues{/number}","pulls_url":"https://api.github.com/repos/pytoolz/toolz/pulls{/number}","milestones_url":"https://api.github.com/repos/pytoolz/toolz/milestones{/number}","notifications_url":"https://api.github.com/repos/pytoolz/toolz/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pytoolz/toolz/labels{/name}","releases_url":"https://api.github.com/repos/pytoolz/toolz/releases{/id}","created_at":"2013-09-13T02:18:43Z","updated_at":"2015-08-09T01:44:22Z","pushed_at":"2015-08-10T00:37:35Z","git_url":"git://github.com/pytoolz/toolz.git","ssh_url":"git@github.com:pytoolz/toolz.git","clone_url":"https://github.com/pytoolz/toolz.git","svn_url":"https://github.com/pytoolz/toolz","homepage":"http://toolz.readthedocs.org/","size":2161,"stargazers_count":826,"watchers_count":826,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":66,"mirror_url":null,"open_issues_count":38,"forks":66,"open_issues":38,"watchers":826,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pytoolz/toolz/pulls/253"},"html":{"href":"https://github.com/pytoolz/toolz/pull/253"},"issue":{"href":"https://api.github.com/repos/pytoolz/toolz/issues/253"},"comments":{"href":"https://api.github.com/repos/pytoolz/toolz/issues/253/comments"},"review_comments":{"href":"https://api.github.com/repos/pytoolz/toolz/pulls/253/comments"},"review_comment":{"href":"https://api.github.com/repos/pytoolz/toolz/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pytoolz/toolz/pulls/253/commits"},"statuses":{"href":"https://api.github.com/repos/pytoolz/toolz/statuses/2e961b92051e29f83d2325818c34bd16ac1665a4"}}}}