{"action":"created","comment":{"url":"https://api.github.com/repos/pytoolz/toolz/pulls/comments/36596819","id":36596819,"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":"e1d92757267dd3a5dd595d02ff2c96eb8b4187f4","original_commit_id":"2e961b92051e29f83d2325818c34bd16ac1665a4","user":{"login":"mrocklin","id":306380,"avatar_url":"https://avatars.githubusercontent.com/u/306380?v=3","gravatar_id":"","url":"https://api.github.com/users/mrocklin","html_url":"https://github.com/mrocklin","followers_url":"https://api.github.com/users/mrocklin/followers","following_url":"https://api.github.com/users/mrocklin/following{/other_user}","gists_url":"https://api.github.com/users/mrocklin/gists{/gist_id}","starred_url":"https://api.github.com/users/mrocklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrocklin/subscriptions","organizations_url":"https://api.github.com/users/mrocklin/orgs","repos_url":"https://api.github.com/users/mrocklin/repos","events_url":"https://api.github.com/users/mrocklin/events{/privacy}","received_events_url":"https://api.github.com/users/mrocklin/received_events","type":"User","site_admin":false},"body":"Yes, that could happen.  My approach here would be to just make the string more strange.\r\n\r\nFancy methods also invite time bombs, but they're harder to reason about.  For example this object apparently isn't picklable.  \r\n\r\n```python\r\nIn [1]: from toolz.utils import no_default\r\n\r\nIn [2]: no_default\r\nOut[2]: <object no_default>\r\n\r\nIn [3]: import pickle\r\n\r\nIn [4]: pickle.dumps(no_default)\r\nPicklingError: Can't pickle <class 'toolz.utils.no_default'>: it's not the same object as toolz.utils.no_default\r\n```\r\n\r\nEven if you were to fix this particular error (perhaps by making a `__getstate__` method) this is still an open Pandoras box.  It didn't take me long to find this particular issue.  I'm confident that there are more surprises with how an object like this would interact with the rest of the ecosystem.  Custom tricks like this are hard for me to reason about; my intuition for them isn't as built up as it is for strings.\r\n\r\nI'm more comfortable with a very slowly ticking time bomb (that we can make arbitrarily slow) than with a Pandora's box.\r\n\r\nAlso, I avoid the term `class` within `toolz` to an arguably irrational extent.","created_at":"2015-08-10T01:18:26Z","updated_at":"2015-08-10T01:18:26Z","html_url":"https://github.com/pytoolz/toolz/pull/253#discussion_r36596819","pull_request_url":"https://api.github.com/repos/pytoolz/toolz/pulls/253","_links":{"self":{"href":"https://api.github.com/repos/pytoolz/toolz/pulls/comments/36596819"},"html":{"href":"https://github.com/pytoolz/toolz/pull/253#discussion_r36596819"},"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-10T01:18:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a9d55dc280b55c22442e5aa48c4292f689798578","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/e1d92757267dd3a5dd595d02ff2c96eb8b4187f4","head":{"label":"llllllllll:scanl","ref":"scanl","sha":"e1d92757267dd3a5dd595d02ff2c96eb8b4187f4","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-10T00:49:50Z","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:49:50Z","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/e1d92757267dd3a5dd595d02ff2c96eb8b4187f4"}}}}