{"action":"created","issue":{"url":"https://api.github.com/repos/python/mypy/issues/1518","repository_url":"https://api.github.com/repos/python/mypy","labels_url":"https://api.github.com/repos/python/mypy/issues/1518/labels{/name}","comments_url":"https://api.github.com/repos/python/mypy/issues/1518/comments","events_url":"https://api.github.com/repos/python/mypy/issues/1518/events","html_url":"https://github.com/python/mypy/issues/1518","id":154193585,"number":1518,"title":"Support comma delimited string for namedtuple.","user":{"login":"graingert","id":413772,"avatar_url":"https://avatars.githubusercontent.com/u/413772?v=3","gravatar_id":"","url":"https://api.github.com/users/graingert","html_url":"https://github.com/graingert","followers_url":"https://api.github.com/users/graingert/followers","following_url":"https://api.github.com/users/graingert/following{/other_user}","gists_url":"https://api.github.com/users/graingert/gists{/gist_id}","starred_url":"https://api.github.com/users/graingert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graingert/subscriptions","organizations_url":"https://api.github.com/users/graingert/orgs","repos_url":"https://api.github.com/users/graingert/repos","events_url":"https://api.github.com/users/graingert/events{/privacy}","received_events_url":"https://api.github.com/users/graingert/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/python/mypy/labels/difficulty/easy","name":"difficulty/easy","color":"d4c5f9"},{"url":"https://api.github.com/repos/python/mypy/labels/feature","name":"feature","color":"84b6eb"},{"url":"https://api.github.com/repos/python/mypy/labels/namedtuple","name":"namedtuple","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/python/mypy/milestones/5","html_url":"https://github.com/python/mypy/milestones/0.4.x","labels_url":"https://api.github.com/repos/python/mypy/milestones/5/labels","id":1616634,"number":5,"title":"0.4.x","description":"The next release, and the next, within 0.4.x.\r\n\r\n(This is not strictly a milestone, just issues we'd like to get to before 0.5.0. For now we're going to a 6-week release cadence. So since 0.4.3 went out on July 14 and 0.4.4 went out on August 25, 0.4.5 should go out on October 6, 2016.)","creator":{"login":"ddfisher","id":245905,"avatar_url":"https://avatars.githubusercontent.com/u/245905?v=3","gravatar_id":"","url":"https://api.github.com/users/ddfisher","html_url":"https://github.com/ddfisher","followers_url":"https://api.github.com/users/ddfisher/followers","following_url":"https://api.github.com/users/ddfisher/following{/other_user}","gists_url":"https://api.github.com/users/ddfisher/gists{/gist_id}","starred_url":"https://api.github.com/users/ddfisher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddfisher/subscriptions","organizations_url":"https://api.github.com/users/ddfisher/orgs","repos_url":"https://api.github.com/users/ddfisher/repos","events_url":"https://api.github.com/users/ddfisher/events{/privacy}","received_events_url":"https://api.github.com/users/ddfisher/received_events","type":"User","site_admin":false},"open_issues":42,"closed_issues":52,"state":"open","created_at":"2016-03-01T23:19:26Z","updated_at":"2016-08-31T15:25:55Z","due_on":"2016-10-06T00:00:00Z","closed_at":null},"comments":2,"created_at":"2016-05-11T09:02:52Z","updated_at":"2016-08-31T23:07:05Z","closed_at":null,"body":"```python\r\nfrom collections import namedtuple\r\n\r\nX = namedtuple('X', 'a, b')\r\nx = X(1, 'x')\r\nx = X(b='y', a='x')  # error: Unexpected keyword argument \"a\" for \"X\"\r\nx.a + [1]  # error: \"X\" has no attribute \"a\"\r\nclass Y(X): \r\n    \"\"\"you can use a namedtuple class as a base class\"\"\"\r\n```"},"comment":{"url":"https://api.github.com/repos/python/mypy/issues/comments/243929507","html_url":"https://github.com/python/mypy/issues/1518#issuecomment-243929507","issue_url":"https://api.github.com/repos/python/mypy/issues/1518","id":243929507,"user":{"login":"elazarg","id":5108069,"avatar_url":"https://avatars.githubusercontent.com/u/5108069?v=3","gravatar_id":"","url":"https://api.github.com/users/elazarg","html_url":"https://github.com/elazarg","followers_url":"https://api.github.com/users/elazarg/followers","following_url":"https://api.github.com/users/elazarg/following{/other_user}","gists_url":"https://api.github.com/users/elazarg/gists{/gist_id}","starred_url":"https://api.github.com/users/elazarg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elazarg/subscriptions","organizations_url":"https://api.github.com/users/elazarg/orgs","repos_url":"https://api.github.com/users/elazarg/repos","events_url":"https://api.github.com/users/elazarg/events{/privacy}","received_events_url":"https://api.github.com/users/elazarg/received_events","type":"User","site_admin":false},"created_at":"2016-08-31T23:07:05Z","updated_at":"2016-08-31T23:07:05Z","body":"I will add it to PR #1810, although it's easy enough not to wait for it. It requires a single line change [here](../../mypy/blob/master/mypy/semanal.py#L1642). Changing `items = str_expr.value.split()` into `items = str_expr.value.replace(',', ' ').split()`\r\n\r\nHowever, as discussed in the `Enum` case, it's a good idea not to use this form."}}
{"actor":{"display_login":"elazarg"}}