{"action":"created","comment":{"url":"https://api.github.com/repos/Polyconseil/getconf/pulls/comments/54406018","id":54406018,"diff_hunk":"@@ -23,7 +23,46 @@\n     logger.addHandler(compat.NullHandler())\n \n \n-ConfigKey = collections.namedtuple('ConfigKey', ['section', 'entry', 'envvar', 'doc'])\n+_ConfigKey = collections.namedtuple(\n+    'ConfigKey',\n+    ['section', 'entry', 'envvar', 'doc', 'default', 'type_hint']\n+)\n+\n+\n+class ConfigKey(_ConfigKey):\n+\n+    def __hash__(self):\n+        if self.type_hint == 'list' and self.default is not None:\n+            # Make sure we can hash default\n+            default = tuple(self.default)\n+        else:\n+            default = self.default\n+        return hash((self.section, self.entry, self.envvar, self.doc, default, self.type_hint))\n+\n+    def as_ini_entry(self):\n+        \"\"\"Format as a commented entry in INI format (section is omitted)\n+\n+        ; type=str - The provided documentation\n+        ;entry = default_value\n+        \"\"\"\n+        # Remove any new line in self.doc\n+        one_line_doc = ' '.join(self.doc.split())\n+        doc_part = ' - %s' % one_line_doc if one_line_doc else ''","path":"getconf/base.py","position":29,"original_position":29,"commit_id":"61338ae8c1c1e242e0c0b10633575879751f056e","original_commit_id":"61338ae8c1c1e242e0c0b10633575879751f056e","user":{"login":"xavfernandez","id":1089744,"avatar_url":"https://avatars.githubusercontent.com/u/1089744?v=3","gravatar_id":"","url":"https://api.github.com/users/xavfernandez","html_url":"https://github.com/xavfernandez","followers_url":"https://api.github.com/users/xavfernandez/followers","following_url":"https://api.github.com/users/xavfernandez/following{/other_user}","gists_url":"https://api.github.com/users/xavfernandez/gists{/gist_id}","starred_url":"https://api.github.com/users/xavfernandez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xavfernandez/subscriptions","organizations_url":"https://api.github.com/users/xavfernandez/orgs","repos_url":"https://api.github.com/users/xavfernandez/repos","events_url":"https://api.github.com/users/xavfernandez/events{/privacy}","received_events_url":"https://api.github.com/users/xavfernandez/received_events","type":"User","site_admin":false},"body":"The first one :) Should I add parenthesis ?","created_at":"2016-02-29T13:00:27Z","updated_at":"2016-02-29T13:00:27Z","html_url":"https://github.com/Polyconseil/getconf/pull/18#discussion_r54406018","pull_request_url":"https://api.github.com/repos/Polyconseil/getconf/pulls/18","_links":{"self":{"href":"https://api.github.com/repos/Polyconseil/getconf/pulls/comments/54406018"},"html":{"href":"https://github.com/Polyconseil/getconf/pull/18#discussion_r54406018"},"pull_request":{"href":"https://api.github.com/repos/Polyconseil/getconf/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/Polyconseil/getconf/pulls/18","id":60694602,"html_url":"https://github.com/Polyconseil/getconf/pull/18","diff_url":"https://github.com/Polyconseil/getconf/pull/18.diff","patch_url":"https://github.com/Polyconseil/getconf/pull/18.patch","issue_url":"https://api.github.com/repos/Polyconseil/getconf/issues/18","number":18,"state":"open","locked":false,"title":"Also store type and defaults in ConfigKey and add to_INI method","user":{"login":"xavfernandez","id":1089744,"avatar_url":"https://avatars.githubusercontent.com/u/1089744?v=3","gravatar_id":"","url":"https://api.github.com/users/xavfernandez","html_url":"https://github.com/xavfernandez","followers_url":"https://api.github.com/users/xavfernandez/followers","following_url":"https://api.github.com/users/xavfernandez/following{/other_user}","gists_url":"https://api.github.com/users/xavfernandez/gists{/gist_id}","starred_url":"https://api.github.com/users/xavfernandez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xavfernandez/subscriptions","organizations_url":"https://api.github.com/users/xavfernandez/orgs","repos_url":"https://api.github.com/users/xavfernandez/repos","events_url":"https://api.github.com/users/xavfernandez/events{/privacy}","received_events_url":"https://api.github.com/users/xavfernandez/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-25T15:21:00Z","updated_at":"2016-02-29T13:00:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8ec4980eef8712691f6bf1ecd7f2bd5c883eeece","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Polyconseil/getconf/pulls/18/commits","review_comments_url":"https://api.github.com/repos/Polyconseil/getconf/pulls/18/comments","review_comment_url":"https://api.github.com/repos/Polyconseil/getconf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Polyconseil/getconf/issues/18/comments","statuses_url":"https://api.github.com/repos/Polyconseil/getconf/statuses/61338ae8c1c1e242e0c0b10633575879751f056e","head":{"label":"Polyconseil:xfernandez/extract_infos","ref":"xfernandez/extract_infos","sha":"61338ae8c1c1e242e0c0b10633575879751f056e","user":{"login":"Polyconseil","id":818669,"avatar_url":"https://avatars.githubusercontent.com/u/818669?v=3","gravatar_id":"","url":"https://api.github.com/users/Polyconseil","html_url":"https://github.com/Polyconseil","followers_url":"https://api.github.com/users/Polyconseil/followers","following_url":"https://api.github.com/users/Polyconseil/following{/other_user}","gists_url":"https://api.github.com/users/Polyconseil/gists{/gist_id}","starred_url":"https://api.github.com/users/Polyconseil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polyconseil/subscriptions","organizations_url":"https://api.github.com/users/Polyconseil/orgs","repos_url":"https://api.github.com/users/Polyconseil/repos","events_url":"https://api.github.com/users/Polyconseil/events{/privacy}","received_events_url":"https://api.github.com/users/Polyconseil/received_events","type":"Organization","site_admin":false},"repo":{"id":18727588,"name":"getconf","full_name":"Polyconseil/getconf","owner":{"login":"Polyconseil","id":818669,"avatar_url":"https://avatars.githubusercontent.com/u/818669?v=3","gravatar_id":"","url":"https://api.github.com/users/Polyconseil","html_url":"https://github.com/Polyconseil","followers_url":"https://api.github.com/users/Polyconseil/followers","following_url":"https://api.github.com/users/Polyconseil/following{/other_user}","gists_url":"https://api.github.com/users/Polyconseil/gists{/gist_id}","starred_url":"https://api.github.com/users/Polyconseil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polyconseil/subscriptions","organizations_url":"https://api.github.com/users/Polyconseil/orgs","repos_url":"https://api.github.com/users/Polyconseil/repos","events_url":"https://api.github.com/users/Polyconseil/events{/privacy}","received_events_url":"https://api.github.com/users/Polyconseil/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Polyconseil/getconf","description":"Simple Python configuration utilities.","fork":false,"url":"https://api.github.com/repos/Polyconseil/getconf","forks_url":"https://api.github.com/repos/Polyconseil/getconf/forks","keys_url":"https://api.github.com/repos/Polyconseil/getconf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Polyconseil/getconf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Polyconseil/getconf/teams","hooks_url":"https://api.github.com/repos/Polyconseil/getconf/hooks","issue_events_url":"https://api.github.com/repos/Polyconseil/getconf/issues/events{/number}","events_url":"https://api.github.com/repos/Polyconseil/getconf/events","assignees_url":"https://api.github.com/repos/Polyconseil/getconf/assignees{/user}","branches_url":"https://api.github.com/repos/Polyconseil/getconf/branches{/branch}","tags_url":"https://api.github.com/repos/Polyconseil/getconf/tags","blobs_url":"https://api.github.com/repos/Polyconseil/getconf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Polyconseil/getconf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Polyconseil/getconf/git/refs{/sha}","trees_url":"https://api.github.com/repos/Polyconseil/getconf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Polyconseil/getconf/statuses/{sha}","languages_url":"https://api.github.com/repos/Polyconseil/getconf/languages","stargazers_url":"https://api.github.com/repos/Polyconseil/getconf/stargazers","contributors_url":"https://api.github.com/repos/Polyconseil/getconf/contributors","subscribers_url":"https://api.github.com/repos/Polyconseil/getconf/subscribers","subscription_url":"https://api.github.com/repos/Polyconseil/getconf/subscription","commits_url":"https://api.github.com/repos/Polyconseil/getconf/commits{/sha}","git_commits_url":"https://api.github.com/repos/Polyconseil/getconf/git/commits{/sha}","comments_url":"https://api.github.com/repos/Polyconseil/getconf/comments{/number}","issue_comment_url":"https://api.github.com/repos/Polyconseil/getconf/issues/comments{/number}","contents_url":"https://api.github.com/repos/Polyconseil/getconf/contents/{+path}","compare_url":"https://api.github.com/repos/Polyconseil/getconf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Polyconseil/getconf/merges","archive_url":"https://api.github.com/repos/Polyconseil/getconf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Polyconseil/getconf/downloads","issues_url":"https://api.github.com/repos/Polyconseil/getconf/issues{/number}","pulls_url":"https://api.github.com/repos/Polyconseil/getconf/pulls{/number}","milestones_url":"https://api.github.com/repos/Polyconseil/getconf/milestones{/number}","notifications_url":"https://api.github.com/repos/Polyconseil/getconf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Polyconseil/getconf/labels{/name}","releases_url":"https://api.github.com/repos/Polyconseil/getconf/releases{/id}","deployments_url":"https://api.github.com/repos/Polyconseil/getconf/deployments","created_at":"2014-04-13T11:27:01Z","updated_at":"2016-01-15T13:29:51Z","pushed_at":"2016-02-29T10:56:07Z","git_url":"git://github.com/Polyconseil/getconf.git","ssh_url":"git@github.com:Polyconseil/getconf.git","clone_url":"https://github.com/Polyconseil/getconf.git","svn_url":"https://github.com/Polyconseil/getconf","homepage":null,"size":111,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":4,"default_branch":"master"}},"base":{"label":"Polyconseil:master","ref":"master","sha":"6083749900ff96bd7ea82035f42f0c2bcf3f6c15","user":{"login":"Polyconseil","id":818669,"avatar_url":"https://avatars.githubusercontent.com/u/818669?v=3","gravatar_id":"","url":"https://api.github.com/users/Polyconseil","html_url":"https://github.com/Polyconseil","followers_url":"https://api.github.com/users/Polyconseil/followers","following_url":"https://api.github.com/users/Polyconseil/following{/other_user}","gists_url":"https://api.github.com/users/Polyconseil/gists{/gist_id}","starred_url":"https://api.github.com/users/Polyconseil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polyconseil/subscriptions","organizations_url":"https://api.github.com/users/Polyconseil/orgs","repos_url":"https://api.github.com/users/Polyconseil/repos","events_url":"https://api.github.com/users/Polyconseil/events{/privacy}","received_events_url":"https://api.github.com/users/Polyconseil/received_events","type":"Organization","site_admin":false},"repo":{"id":18727588,"name":"getconf","full_name":"Polyconseil/getconf","owner":{"login":"Polyconseil","id":818669,"avatar_url":"https://avatars.githubusercontent.com/u/818669?v=3","gravatar_id":"","url":"https://api.github.com/users/Polyconseil","html_url":"https://github.com/Polyconseil","followers_url":"https://api.github.com/users/Polyconseil/followers","following_url":"https://api.github.com/users/Polyconseil/following{/other_user}","gists_url":"https://api.github.com/users/Polyconseil/gists{/gist_id}","starred_url":"https://api.github.com/users/Polyconseil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polyconseil/subscriptions","organizations_url":"https://api.github.com/users/Polyconseil/orgs","repos_url":"https://api.github.com/users/Polyconseil/repos","events_url":"https://api.github.com/users/Polyconseil/events{/privacy}","received_events_url":"https://api.github.com/users/Polyconseil/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Polyconseil/getconf","description":"Simple Python configuration utilities.","fork":false,"url":"https://api.github.com/repos/Polyconseil/getconf","forks_url":"https://api.github.com/repos/Polyconseil/getconf/forks","keys_url":"https://api.github.com/repos/Polyconseil/getconf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Polyconseil/getconf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Polyconseil/getconf/teams","hooks_url":"https://api.github.com/repos/Polyconseil/getconf/hooks","issue_events_url":"https://api.github.com/repos/Polyconseil/getconf/issues/events{/number}","events_url":"https://api.github.com/repos/Polyconseil/getconf/events","assignees_url":"https://api.github.com/repos/Polyconseil/getconf/assignees{/user}","branches_url":"https://api.github.com/repos/Polyconseil/getconf/branches{/branch}","tags_url":"https://api.github.com/repos/Polyconseil/getconf/tags","blobs_url":"https://api.github.com/repos/Polyconseil/getconf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Polyconseil/getconf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Polyconseil/getconf/git/refs{/sha}","trees_url":"https://api.github.com/repos/Polyconseil/getconf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Polyconseil/getconf/statuses/{sha}","languages_url":"https://api.github.com/repos/Polyconseil/getconf/languages","stargazers_url":"https://api.github.com/repos/Polyconseil/getconf/stargazers","contributors_url":"https://api.github.com/repos/Polyconseil/getconf/contributors","subscribers_url":"https://api.github.com/repos/Polyconseil/getconf/subscribers","subscription_url":"https://api.github.com/repos/Polyconseil/getconf/subscription","commits_url":"https://api.github.com/repos/Polyconseil/getconf/commits{/sha}","git_commits_url":"https://api.github.com/repos/Polyconseil/getconf/git/commits{/sha}","comments_url":"https://api.github.com/repos/Polyconseil/getconf/comments{/number}","issue_comment_url":"https://api.github.com/repos/Polyconseil/getconf/issues/comments{/number}","contents_url":"https://api.github.com/repos/Polyconseil/getconf/contents/{+path}","compare_url":"https://api.github.com/repos/Polyconseil/getconf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Polyconseil/getconf/merges","archive_url":"https://api.github.com/repos/Polyconseil/getconf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Polyconseil/getconf/downloads","issues_url":"https://api.github.com/repos/Polyconseil/getconf/issues{/number}","pulls_url":"https://api.github.com/repos/Polyconseil/getconf/pulls{/number}","milestones_url":"https://api.github.com/repos/Polyconseil/getconf/milestones{/number}","notifications_url":"https://api.github.com/repos/Polyconseil/getconf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Polyconseil/getconf/labels{/name}","releases_url":"https://api.github.com/repos/Polyconseil/getconf/releases{/id}","deployments_url":"https://api.github.com/repos/Polyconseil/getconf/deployments","created_at":"2014-04-13T11:27:01Z","updated_at":"2016-01-15T13:29:51Z","pushed_at":"2016-02-29T10:56:07Z","git_url":"git://github.com/Polyconseil/getconf.git","ssh_url":"git@github.com:Polyconseil/getconf.git","clone_url":"https://github.com/Polyconseil/getconf.git","svn_url":"https://github.com/Polyconseil/getconf","homepage":null,"size":111,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Polyconseil/getconf/pulls/18"},"html":{"href":"https://github.com/Polyconseil/getconf/pull/18"},"issue":{"href":"https://api.github.com/repos/Polyconseil/getconf/issues/18"},"comments":{"href":"https://api.github.com/repos/Polyconseil/getconf/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/Polyconseil/getconf/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/Polyconseil/getconf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Polyconseil/getconf/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/Polyconseil/getconf/statuses/61338ae8c1c1e242e0c0b10633575879751f056e"}}}}