{"action":"created","comment":{"url":"https://api.github.com/repos/matplotlib/cycler/pulls/comments/37655337","id":37655337,"diff_hunk":"@@ -124,6 +124,43 @@ def keys(self):\n         \"\"\"\n         return set(self._keys)\n \n+    def change_key(self, old, new):\n+        \"\"\"\n+        Change a key in this cycler to a new name.\n+        Modification is performed in-place.\n+\n+        Does nothing if the old key is the same as the new key.\n+        Raises a ValueError if the new key is already a key.\n+        Raises a KeyError if the old key isn't a key.\n+\n+        \"\"\"\n+        if old == new:\n+            return\n+        if new in self._keys:\n+            raise ValueError(\"Can't replace %s with %s, %s is already a key\" %\n+                             (old, new, new))\n+        if old not in self._keys:\n+            raise KeyError(\"Can't replace %s with %s, %s is not a key\" %\n+                           (old, new, old))\n+\n+        self._keys.remove(old)\n+        self._keys.add(new)\n+\n+        if self._right is not None and old in self._right.keys:\n+            self._right.change_key(old, new)\n+\n+        # self._left should always be non-None\n+        # if self._keys is non-empty.\n+        elif isinstance(self._left, Cycler):\n+            self._left.change_key(old, new)\n+        else:\n+            # It should be completely safe at this point to\n+            # assume that the old key can be found in each\n+            # iteration.\n+            for entry in self._left:\n+                entry[new] = entry[old]","path":"cycler.py","position":38,"original_position":38,"commit_id":"7ece38c482cd09ce4f905f391ce7e9ec39c3f873","original_commit_id":"7ece38c482cd09ce4f905f391ce7e9ec39c3f873","user":{"login":"WeatherGod","id":291576,"avatar_url":"https://avatars.githubusercontent.com/u/291576?v=3","gravatar_id":"","url":"https://api.github.com/users/WeatherGod","html_url":"https://github.com/WeatherGod","followers_url":"https://api.github.com/users/WeatherGod/followers","following_url":"https://api.github.com/users/WeatherGod/following{/other_user}","gists_url":"https://api.github.com/users/WeatherGod/gists{/gist_id}","starred_url":"https://api.github.com/users/WeatherGod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WeatherGod/subscriptions","organizations_url":"https://api.github.com/users/WeatherGod/orgs","repos_url":"https://api.github.com/users/WeatherGod/repos","events_url":"https://api.github.com/users/WeatherGod/events{/privacy}","received_events_url":"https://api.github.com/users/WeatherGod/received_events","type":"User","site_admin":false},"body":"Did a bit more digging... there is something definitely broken.\r\n`cycler('linewidth', c2)` is returning a None. This is also true after rebasing onto master.","created_at":"2015-08-21T17:10:31Z","updated_at":"2015-08-21T17:10:31Z","html_url":"https://github.com/matplotlib/cycler/pull/13#discussion_r37655337","pull_request_url":"https://api.github.com/repos/matplotlib/cycler/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/matplotlib/cycler/pulls/comments/37655337"},"html":{"href":"https://github.com/matplotlib/cycler/pull/13#discussion_r37655337"},"pull_request":{"href":"https://api.github.com/repos/matplotlib/cycler/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/matplotlib/cycler/pulls/13","id":42971726,"html_url":"https://github.com/matplotlib/cycler/pull/13","diff_url":"https://github.com/matplotlib/cycler/pull/13.diff","patch_url":"https://github.com/matplotlib/cycler/pull/13.patch","issue_url":"https://api.github.com/repos/matplotlib/cycler/issues/13","number":13,"state":"open","locked":false,"title":"Implement key changing","user":{"login":"WeatherGod","id":291576,"avatar_url":"https://avatars.githubusercontent.com/u/291576?v=3","gravatar_id":"","url":"https://api.github.com/users/WeatherGod","html_url":"https://github.com/WeatherGod","followers_url":"https://api.github.com/users/WeatherGod/followers","following_url":"https://api.github.com/users/WeatherGod/following{/other_user}","gists_url":"https://api.github.com/users/WeatherGod/gists{/gist_id}","starred_url":"https://api.github.com/users/WeatherGod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WeatherGod/subscriptions","organizations_url":"https://api.github.com/users/WeatherGod/orgs","repos_url":"https://api.github.com/users/WeatherGod/repos","events_url":"https://api.github.com/users/WeatherGod/events{/privacy}","received_events_url":"https://api.github.com/users/WeatherGod/received_events","type":"User","site_admin":false},"body":"closes #11 ","created_at":"2015-08-20T20:02:11Z","updated_at":"2015-08-21T17:10:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7c09c67c79978ad955d61296f077ed3b3e9729cc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/matplotlib/cycler/pulls/13/commits","review_comments_url":"https://api.github.com/repos/matplotlib/cycler/pulls/13/comments","review_comment_url":"https://api.github.com/repos/matplotlib/cycler/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matplotlib/cycler/issues/13/comments","statuses_url":"https://api.github.com/repos/matplotlib/cycler/statuses/7ece38c482cd09ce4f905f391ce7e9ec39c3f873","head":{"label":"WeatherGod:key_change","ref":"key_change","sha":"7ece38c482cd09ce4f905f391ce7e9ec39c3f873","user":{"login":"WeatherGod","id":291576,"avatar_url":"https://avatars.githubusercontent.com/u/291576?v=3","gravatar_id":"","url":"https://api.github.com/users/WeatherGod","html_url":"https://github.com/WeatherGod","followers_url":"https://api.github.com/users/WeatherGod/followers","following_url":"https://api.github.com/users/WeatherGod/following{/other_user}","gists_url":"https://api.github.com/users/WeatherGod/gists{/gist_id}","starred_url":"https://api.github.com/users/WeatherGod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WeatherGod/subscriptions","organizations_url":"https://api.github.com/users/WeatherGod/orgs","repos_url":"https://api.github.com/users/WeatherGod/repos","events_url":"https://api.github.com/users/WeatherGod/events{/privacy}","received_events_url":"https://api.github.com/users/WeatherGod/received_events","type":"User","site_admin":false},"repo":{"id":38941810,"name":"cycler","full_name":"WeatherGod/cycler","owner":{"login":"WeatherGod","id":291576,"avatar_url":"https://avatars.githubusercontent.com/u/291576?v=3","gravatar_id":"","url":"https://api.github.com/users/WeatherGod","html_url":"https://github.com/WeatherGod","followers_url":"https://api.github.com/users/WeatherGod/followers","following_url":"https://api.github.com/users/WeatherGod/following{/other_user}","gists_url":"https://api.github.com/users/WeatherGod/gists{/gist_id}","starred_url":"https://api.github.com/users/WeatherGod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WeatherGod/subscriptions","organizations_url":"https://api.github.com/users/WeatherGod/orgs","repos_url":"https://api.github.com/users/WeatherGod/repos","events_url":"https://api.github.com/users/WeatherGod/events{/privacy}","received_events_url":"https://api.github.com/users/WeatherGod/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/WeatherGod/cycler","description":"cycler: composable cycles","fork":true,"url":"https://api.github.com/repos/WeatherGod/cycler","forks_url":"https://api.github.com/repos/WeatherGod/cycler/forks","keys_url":"https://api.github.com/repos/WeatherGod/cycler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WeatherGod/cycler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WeatherGod/cycler/teams","hooks_url":"https://api.github.com/repos/WeatherGod/cycler/hooks","issue_events_url":"https://api.github.com/repos/WeatherGod/cycler/issues/events{/number}","events_url":"https://api.github.com/repos/WeatherGod/cycler/events","assignees_url":"https://api.github.com/repos/WeatherGod/cycler/assignees{/user}","branches_url":"https://api.github.com/repos/WeatherGod/cycler/branches{/branch}","tags_url":"https://api.github.com/repos/WeatherGod/cycler/tags","blobs_url":"https://api.github.com/repos/WeatherGod/cycler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WeatherGod/cycler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WeatherGod/cycler/git/refs{/sha}","trees_url":"https://api.github.com/repos/WeatherGod/cycler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WeatherGod/cycler/statuses/{sha}","languages_url":"https://api.github.com/repos/WeatherGod/cycler/languages","stargazers_url":"https://api.github.com/repos/WeatherGod/cycler/stargazers","contributors_url":"https://api.github.com/repos/WeatherGod/cycler/contributors","subscribers_url":"https://api.github.com/repos/WeatherGod/cycler/subscribers","subscription_url":"https://api.github.com/repos/WeatherGod/cycler/subscription","commits_url":"https://api.github.com/repos/WeatherGod/cycler/commits{/sha}","git_commits_url":"https://api.github.com/repos/WeatherGod/cycler/git/commits{/sha}","comments_url":"https://api.github.com/repos/WeatherGod/cycler/comments{/number}","issue_comment_url":"https://api.github.com/repos/WeatherGod/cycler/issues/comments{/number}","contents_url":"https://api.github.com/repos/WeatherGod/cycler/contents/{+path}","compare_url":"https://api.github.com/repos/WeatherGod/cycler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WeatherGod/cycler/merges","archive_url":"https://api.github.com/repos/WeatherGod/cycler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WeatherGod/cycler/downloads","issues_url":"https://api.github.com/repos/WeatherGod/cycler/issues{/number}","pulls_url":"https://api.github.com/repos/WeatherGod/cycler/pulls{/number}","milestones_url":"https://api.github.com/repos/WeatherGod/cycler/milestones{/number}","notifications_url":"https://api.github.com/repos/WeatherGod/cycler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WeatherGod/cycler/labels{/name}","releases_url":"https://api.github.com/repos/WeatherGod/cycler/releases{/id}","created_at":"2015-07-11T21:58:37Z","updated_at":"2015-07-11T21:58:38Z","pushed_at":"2015-08-21T15:28:59Z","git_url":"git://github.com/WeatherGod/cycler.git","ssh_url":"git@github.com:WeatherGod/cycler.git","clone_url":"https://github.com/WeatherGod/cycler.git","svn_url":"https://github.com/WeatherGod/cycler","homepage":"","size":1007,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"matplotlib:master","ref":"master","sha":"ddc6e11be3f983297d09bcc6fa59c73b0379709c","user":{"login":"matplotlib","id":215947,"avatar_url":"https://avatars.githubusercontent.com/u/215947?v=3","gravatar_id":"","url":"https://api.github.com/users/matplotlib","html_url":"https://github.com/matplotlib","followers_url":"https://api.github.com/users/matplotlib/followers","following_url":"https://api.github.com/users/matplotlib/following{/other_user}","gists_url":"https://api.github.com/users/matplotlib/gists{/gist_id}","starred_url":"https://api.github.com/users/matplotlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matplotlib/subscriptions","organizations_url":"https://api.github.com/users/matplotlib/orgs","repos_url":"https://api.github.com/users/matplotlib/repos","events_url":"https://api.github.com/users/matplotlib/events{/privacy}","received_events_url":"https://api.github.com/users/matplotlib/received_events","type":"Organization","site_admin":false},"repo":{"id":37756764,"name":"cycler","full_name":"matplotlib/cycler","owner":{"login":"matplotlib","id":215947,"avatar_url":"https://avatars.githubusercontent.com/u/215947?v=3","gravatar_id":"","url":"https://api.github.com/users/matplotlib","html_url":"https://github.com/matplotlib","followers_url":"https://api.github.com/users/matplotlib/followers","following_url":"https://api.github.com/users/matplotlib/following{/other_user}","gists_url":"https://api.github.com/users/matplotlib/gists{/gist_id}","starred_url":"https://api.github.com/users/matplotlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matplotlib/subscriptions","organizations_url":"https://api.github.com/users/matplotlib/orgs","repos_url":"https://api.github.com/users/matplotlib/repos","events_url":"https://api.github.com/users/matplotlib/events{/privacy}","received_events_url":"https://api.github.com/users/matplotlib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matplotlib/cycler","description":"cycler: composable cycles","fork":false,"url":"https://api.github.com/repos/matplotlib/cycler","forks_url":"https://api.github.com/repos/matplotlib/cycler/forks","keys_url":"https://api.github.com/repos/matplotlib/cycler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matplotlib/cycler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matplotlib/cycler/teams","hooks_url":"https://api.github.com/repos/matplotlib/cycler/hooks","issue_events_url":"https://api.github.com/repos/matplotlib/cycler/issues/events{/number}","events_url":"https://api.github.com/repos/matplotlib/cycler/events","assignees_url":"https://api.github.com/repos/matplotlib/cycler/assignees{/user}","branches_url":"https://api.github.com/repos/matplotlib/cycler/branches{/branch}","tags_url":"https://api.github.com/repos/matplotlib/cycler/tags","blobs_url":"https://api.github.com/repos/matplotlib/cycler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matplotlib/cycler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matplotlib/cycler/git/refs{/sha}","trees_url":"https://api.github.com/repos/matplotlib/cycler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matplotlib/cycler/statuses/{sha}","languages_url":"https://api.github.com/repos/matplotlib/cycler/languages","stargazers_url":"https://api.github.com/repos/matplotlib/cycler/stargazers","contributors_url":"https://api.github.com/repos/matplotlib/cycler/contributors","subscribers_url":"https://api.github.com/repos/matplotlib/cycler/subscribers","subscription_url":"https://api.github.com/repos/matplotlib/cycler/subscription","commits_url":"https://api.github.com/repos/matplotlib/cycler/commits{/sha}","git_commits_url":"https://api.github.com/repos/matplotlib/cycler/git/commits{/sha}","comments_url":"https://api.github.com/repos/matplotlib/cycler/comments{/number}","issue_comment_url":"https://api.github.com/repos/matplotlib/cycler/issues/comments{/number}","contents_url":"https://api.github.com/repos/matplotlib/cycler/contents/{+path}","compare_url":"https://api.github.com/repos/matplotlib/cycler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matplotlib/cycler/merges","archive_url":"https://api.github.com/repos/matplotlib/cycler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matplotlib/cycler/downloads","issues_url":"https://api.github.com/repos/matplotlib/cycler/issues{/number}","pulls_url":"https://api.github.com/repos/matplotlib/cycler/pulls{/number}","milestones_url":"https://api.github.com/repos/matplotlib/cycler/milestones{/number}","notifications_url":"https://api.github.com/repos/matplotlib/cycler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matplotlib/cycler/labels{/name}","releases_url":"https://api.github.com/repos/matplotlib/cycler/releases{/id}","created_at":"2015-06-20T03:46:04Z","updated_at":"2015-08-16T17:53:07Z","pushed_at":"2015-08-21T16:33:53Z","git_url":"git://github.com/matplotlib/cycler.git","ssh_url":"git@github.com:matplotlib/cycler.git","clone_url":"https://github.com/matplotlib/cycler.git","svn_url":"https://github.com/matplotlib/cycler","homepage":"","size":1102,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4,"mirror_url":null,"open_issues_count":6,"forks":4,"open_issues":6,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matplotlib/cycler/pulls/13"},"html":{"href":"https://github.com/matplotlib/cycler/pull/13"},"issue":{"href":"https://api.github.com/repos/matplotlib/cycler/issues/13"},"comments":{"href":"https://api.github.com/repos/matplotlib/cycler/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/matplotlib/cycler/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/matplotlib/cycler/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matplotlib/cycler/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/matplotlib/cycler/statuses/7ece38c482cd09ce4f905f391ce7e9ec39c3f873"}}}}