{"action":"created","comment":{"url":"https://api.github.com/repos/google/python-fire/pulls/comments/245099950","pull_request_review_id":189140771,"id":245099950,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NTA5OTk1MA==","diff_hunk":"@@ -202,3 +202,25 @@ def _InfoBackup(component):\n     pass\n \n   return info\n+\n+\n+def Isnamedtuple(component):","path":"fire/inspectutils.py","position":null,"original_position":6,"commit_id":"dabc6e665c082c7a5e87d108ef6cfad97a8581b6","original_commit_id":"376f1f631b0fc69983ae9ed19c4b3b4b803099a4","user":{"login":"floscha","id":33159547,"node_id":"MDQ6VXNlcjMzMTU5NTQ3","avatar_url":"https://avatars2.githubusercontent.com/u/33159547?v=4","gravatar_id":"","url":"https://api.github.com/users/floscha","html_url":"https://github.com/floscha","followers_url":"https://api.github.com/users/floscha/followers","following_url":"https://api.github.com/users/floscha/following{/other_user}","gists_url":"https://api.github.com/users/floscha/gists{/gist_id}","starred_url":"https://api.github.com/users/floscha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/floscha/subscriptions","organizations_url":"https://api.github.com/users/floscha/orgs","repos_url":"https://api.github.com/users/floscha/repos","events_url":"https://api.github.com/users/floscha/events{/privacy}","received_events_url":"https://api.github.com/users/floscha/received_events","type":"User","site_admin":false},"body":"Fixed it with dabc6e6.","created_at":"2019-01-03T19:03:07Z","updated_at":"2019-01-03T19:03:08Z","html_url":"https://github.com/google/python-fire/pull/161#discussion_r245099950","pull_request_url":"https://api.github.com/repos/google/python-fire/pulls/161","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/google/python-fire/pulls/comments/245099950"},"html":{"href":"https://github.com/google/python-fire/pull/161#discussion_r245099950"},"pull_request":{"href":"https://api.github.com/repos/google/python-fire/pulls/161"}},"in_reply_to_id":245076940},"pull_request":{"url":"https://api.github.com/repos/google/python-fire/pulls/161","id":241730088,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxNzMwMDg4","html_url":"https://github.com/google/python-fire/pull/161","diff_url":"https://github.com/google/python-fire/pull/161.diff","patch_url":"https://github.com/google/python-fire/pull/161.patch","issue_url":"https://api.github.com/repos/google/python-fire/issues/161","number":161,"state":"open","locked":false,"title":"Make namedtuple fields accessible by their name","user":{"login":"floscha","id":33159547,"node_id":"MDQ6VXNlcjMzMTU5NTQ3","avatar_url":"https://avatars2.githubusercontent.com/u/33159547?v=4","gravatar_id":"","url":"https://api.github.com/users/floscha","html_url":"https://github.com/floscha","followers_url":"https://api.github.com/users/floscha/followers","following_url":"https://api.github.com/users/floscha/following{/other_user}","gists_url":"https://api.github.com/users/floscha/gists{/gist_id}","starred_url":"https://api.github.com/users/floscha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/floscha/subscriptions","organizations_url":"https://api.github.com/users/floscha/orgs","repos_url":"https://api.github.com/users/floscha/repos","events_url":"https://api.github.com/users/floscha/events{/privacy}","received_events_url":"https://api.github.com/users/floscha/received_events","type":"User","site_admin":false},"body":"Hi, this PR makes the fields of namedtuple objects accessible by their name instead of indices as requested in #157. Also, I extended the test suite and made sure that no existing tests broke.\r\n\r\nThe exact behaviour is explained in the following:\r\n\r\nAssuming a `namedtuple_example.py` script:\r\n```python\r\nfrom collections import namedtuple\r\nimport fire\r\n\r\nPoint = namedtuple('Point', ['x', 'y'])\r\np = Point(11, y=22)\r\n\r\nif __name__ == '__main__':\r\n  fire.Fire(p)\r\n```\r\n\r\nBefore the PR:\r\n```\r\npython namedtuple_example.py 0  # 11\r\npython namedtuple_example.py 1  # 22\r\npython namedtuple_example.py x  # Throws an exception.\r\n```\r\n\r\nAfter the PR:\r\n```\r\npython namedtuple_example.py x  # 11\r\npython namedtuple_example.py y  # 22\r\npython namedtuple_example.py 0  # Throws an exception since p has no '0' field.\r\n```","created_at":"2019-01-02T11:56:30Z","updated_at":"2019-01-03T19:03:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a4e56ad5a20a2dab5a28d6611eab653941e1e906","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/google/python-fire/pulls/161/commits","review_comments_url":"https://api.github.com/repos/google/python-fire/pulls/161/comments","review_comment_url":"https://api.github.com/repos/google/python-fire/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/python-fire/issues/161/comments","statuses_url":"https://api.github.com/repos/google/python-fire/statuses/dabc6e665c082c7a5e87d108ef6cfad97a8581b6","head":{"label":"floscha:namedtuple-fieldnames","ref":"namedtuple-fieldnames","sha":"dabc6e665c082c7a5e87d108ef6cfad97a8581b6","user":{"login":"floscha","id":33159547,"node_id":"MDQ6VXNlcjMzMTU5NTQ3","avatar_url":"https://avatars2.githubusercontent.com/u/33159547?v=4","gravatar_id":"","url":"https://api.github.com/users/floscha","html_url":"https://github.com/floscha","followers_url":"https://api.github.com/users/floscha/followers","following_url":"https://api.github.com/users/floscha/following{/other_user}","gists_url":"https://api.github.com/users/floscha/gists{/gist_id}","starred_url":"https://api.github.com/users/floscha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/floscha/subscriptions","organizations_url":"https://api.github.com/users/floscha/orgs","repos_url":"https://api.github.com/users/floscha/repos","events_url":"https://api.github.com/users/floscha/events{/privacy}","received_events_url":"https://api.github.com/users/floscha/received_events","type":"User","site_admin":false},"repo":{"id":163822420,"node_id":"MDEwOlJlcG9zaXRvcnkxNjM4MjI0MjA=","name":"python-fire","full_name":"floscha/python-fire","private":false,"owner":{"login":"floscha","id":33159547,"node_id":"MDQ6VXNlcjMzMTU5NTQ3","avatar_url":"https://avatars2.githubusercontent.com/u/33159547?v=4","gravatar_id":"","url":"https://api.github.com/users/floscha","html_url":"https://github.com/floscha","followers_url":"https://api.github.com/users/floscha/followers","following_url":"https://api.github.com/users/floscha/following{/other_user}","gists_url":"https://api.github.com/users/floscha/gists{/gist_id}","starred_url":"https://api.github.com/users/floscha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/floscha/subscriptions","organizations_url":"https://api.github.com/users/floscha/orgs","repos_url":"https://api.github.com/users/floscha/repos","events_url":"https://api.github.com/users/floscha/events{/privacy}","received_events_url":"https://api.github.com/users/floscha/received_events","type":"User","site_admin":false},"html_url":"https://github.com/floscha/python-fire","description":"Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object.","fork":true,"url":"https://api.github.com/repos/floscha/python-fire","forks_url":"https://api.github.com/repos/floscha/python-fire/forks","keys_url":"https://api.github.com/repos/floscha/python-fire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/floscha/python-fire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/floscha/python-fire/teams","hooks_url":"https://api.github.com/repos/floscha/python-fire/hooks","issue_events_url":"https://api.github.com/repos/floscha/python-fire/issues/events{/number}","events_url":"https://api.github.com/repos/floscha/python-fire/events","assignees_url":"https://api.github.com/repos/floscha/python-fire/assignees{/user}","branches_url":"https://api.github.com/repos/floscha/python-fire/branches{/branch}","tags_url":"https://api.github.com/repos/floscha/python-fire/tags","blobs_url":"https://api.github.com/repos/floscha/python-fire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/floscha/python-fire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/floscha/python-fire/git/refs{/sha}","trees_url":"https://api.github.com/repos/floscha/python-fire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/floscha/python-fire/statuses/{sha}","languages_url":"https://api.github.com/repos/floscha/python-fire/languages","stargazers_url":"https://api.github.com/repos/floscha/python-fire/stargazers","contributors_url":"https://api.github.com/repos/floscha/python-fire/contributors","subscribers_url":"https://api.github.com/repos/floscha/python-fire/subscribers","subscription_url":"https://api.github.com/repos/floscha/python-fire/subscription","commits_url":"https://api.github.com/repos/floscha/python-fire/commits{/sha}","git_commits_url":"https://api.github.com/repos/floscha/python-fire/git/commits{/sha}","comments_url":"https://api.github.com/repos/floscha/python-fire/comments{/number}","issue_comment_url":"https://api.github.com/repos/floscha/python-fire/issues/comments{/number}","contents_url":"https://api.github.com/repos/floscha/python-fire/contents/{+path}","compare_url":"https://api.github.com/repos/floscha/python-fire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/floscha/python-fire/merges","archive_url":"https://api.github.com/repos/floscha/python-fire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/floscha/python-fire/downloads","issues_url":"https://api.github.com/repos/floscha/python-fire/issues{/number}","pulls_url":"https://api.github.com/repos/floscha/python-fire/pulls{/number}","milestones_url":"https://api.github.com/repos/floscha/python-fire/milestones{/number}","notifications_url":"https://api.github.com/repos/floscha/python-fire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/floscha/python-fire/labels{/name}","releases_url":"https://api.github.com/repos/floscha/python-fire/releases{/id}","deployments_url":"https://api.github.com/repos/floscha/python-fire/deployments","created_at":"2019-01-02T09:43:55Z","updated_at":"2019-01-02T09:43:57Z","pushed_at":"2019-01-03T18:55:42Z","git_url":"git://github.com/floscha/python-fire.git","ssh_url":"git@github.com:floscha/python-fire.git","clone_url":"https://github.com/floscha/python-fire.git","svn_url":"https://github.com/floscha/python-fire","homepage":"","size":631,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"871ffabb0015daf9c4a8179d0aef38af01a829c9","user":{"login":"google","id":1342004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDIwMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":82729529,"node_id":"MDEwOlJlcG9zaXRvcnk4MjcyOTUyOQ==","name":"python-fire","full_name":"google/python-fire","private":false,"owner":{"login":"google","id":1342004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDIwMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/google/python-fire","description":"Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object.","fork":false,"url":"https://api.github.com/repos/google/python-fire","forks_url":"https://api.github.com/repos/google/python-fire/forks","keys_url":"https://api.github.com/repos/google/python-fire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/python-fire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/python-fire/teams","hooks_url":"https://api.github.com/repos/google/python-fire/hooks","issue_events_url":"https://api.github.com/repos/google/python-fire/issues/events{/number}","events_url":"https://api.github.com/repos/google/python-fire/events","assignees_url":"https://api.github.com/repos/google/python-fire/assignees{/user}","branches_url":"https://api.github.com/repos/google/python-fire/branches{/branch}","tags_url":"https://api.github.com/repos/google/python-fire/tags","blobs_url":"https://api.github.com/repos/google/python-fire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/python-fire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/python-fire/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/python-fire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/python-fire/statuses/{sha}","languages_url":"https://api.github.com/repos/google/python-fire/languages","stargazers_url":"https://api.github.com/repos/google/python-fire/stargazers","contributors_url":"https://api.github.com/repos/google/python-fire/contributors","subscribers_url":"https://api.github.com/repos/google/python-fire/subscribers","subscription_url":"https://api.github.com/repos/google/python-fire/subscription","commits_url":"https://api.github.com/repos/google/python-fire/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/python-fire/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/python-fire/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/python-fire/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/python-fire/contents/{+path}","compare_url":"https://api.github.com/repos/google/python-fire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/python-fire/merges","archive_url":"https://api.github.com/repos/google/python-fire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/python-fire/downloads","issues_url":"https://api.github.com/repos/google/python-fire/issues{/number}","pulls_url":"https://api.github.com/repos/google/python-fire/pulls{/number}","milestones_url":"https://api.github.com/repos/google/python-fire/milestones{/number}","notifications_url":"https://api.github.com/repos/google/python-fire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/python-fire/labels{/name}","releases_url":"https://api.github.com/repos/google/python-fire/releases{/id}","deployments_url":"https://api.github.com/repos/google/python-fire/deployments","created_at":"2017-02-21T21:35:07Z","updated_at":"2019-01-03T17:48:02Z","pushed_at":"2019-01-03T18:55:44Z","git_url":"git://github.com/google/python-fire.git","ssh_url":"git@github.com:google/python-fire.git","clone_url":"https://github.com/google/python-fire.git","svn_url":"https://github.com/google/python-fire","homepage":"","size":596,"stargazers_count":13133,"watchers_count":13133,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":true,"forks_count":748,"mirror_url":null,"archived":false,"open_issues_count":56,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":748,"open_issues":56,"watchers":13133,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/python-fire/pulls/161"},"html":{"href":"https://github.com/google/python-fire/pull/161"},"issue":{"href":"https://api.github.com/repos/google/python-fire/issues/161"},"comments":{"href":"https://api.github.com/repos/google/python-fire/issues/161/comments"},"review_comments":{"href":"https://api.github.com/repos/google/python-fire/pulls/161/comments"},"review_comment":{"href":"https://api.github.com/repos/google/python-fire/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/python-fire/pulls/161/commits"},"statuses":{"href":"https://api.github.com/repos/google/python-fire/statuses/dabc6e665c082c7a5e87d108ef6cfad97a8581b6"}},"author_association":"NONE"}}
{"actor":{"display_login":"floscha"}}