{"action":"created","issue":{"url":"https://api.github.com/repos/python/typing/issues/411","repository_url":"https://api.github.com/repos/python/typing","labels_url":"https://api.github.com/repos/python/typing/issues/411/labels{/name}","comments_url":"https://api.github.com/repos/python/typing/issues/411/comments","events_url":"https://api.github.com/repos/python/typing/issues/411/events","html_url":"https://github.com/python/typing/issues/411","id":221227444,"number":411,"title":"Can not define method in subclass of NamedTuple","user":{"login":"ADR-007","id":7348960,"avatar_url":"https://avatars3.githubusercontent.com/u/7348960?v=3","gravatar_id":"","url":"https://api.github.com/users/ADR-007","html_url":"https://github.com/ADR-007","followers_url":"https://api.github.com/users/ADR-007/followers","following_url":"https://api.github.com/users/ADR-007/following{/other_user}","gists_url":"https://api.github.com/users/ADR-007/gists{/gist_id}","starred_url":"https://api.github.com/users/ADR-007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ADR-007/subscriptions","organizations_url":"https://api.github.com/users/ADR-007/orgs","repos_url":"https://api.github.com/users/ADR-007/repos","events_url":"https://api.github.com/users/ADR-007/events{/privacy}","received_events_url":"https://api.github.com/users/ADR-007/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-12T11:06:03Z","updated_at":"2017-04-12T14:49:29Z","closed_at":null,"body":"I can define method when i use subclass of `NamedTuple('example', (('aaa', int), ('bbb', float)))` but it doesn't work in Python 3.6 style of NamedTuple:\r\n\r\n```\r\nfrom typing import NamedTuple\r\n\r\n\r\nclass NT(NamedTuple):\r\n    aaa: int\r\n    bbb: float\r\n\r\n    def ab(self):\r\n        print(2)\r\n\r\n\r\nNT(1, 0.5).ab()\r\n```\r\n\r\nResult:\r\n```\r\nTraceback (most recent call last):\r\n  File \".../tmp.py\", line 12, in <module>\r\n    NT(1, 0.5).ab()\r\nAttributeError: 'NT' object has no attribute 'ab'\r\n```"},"comment":{"url":"https://api.github.com/repos/python/typing/issues/comments/293601761","html_url":"https://github.com/python/typing/issues/411#issuecomment-293601761","issue_url":"https://api.github.com/repos/python/typing/issues/411","id":293601761,"user":{"login":"ilevkivskyi","id":12005495,"avatar_url":"https://avatars2.githubusercontent.com/u/12005495?v=3","gravatar_id":"","url":"https://api.github.com/users/ilevkivskyi","html_url":"https://github.com/ilevkivskyi","followers_url":"https://api.github.com/users/ilevkivskyi/followers","following_url":"https://api.github.com/users/ilevkivskyi/following{/other_user}","gists_url":"https://api.github.com/users/ilevkivskyi/gists{/gist_id}","starred_url":"https://api.github.com/users/ilevkivskyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilevkivskyi/subscriptions","organizations_url":"https://api.github.com/users/ilevkivskyi/orgs","repos_url":"https://api.github.com/users/ilevkivskyi/repos","events_url":"https://api.github.com/users/ilevkivskyi/events{/privacy}","received_events_url":"https://api.github.com/users/ilevkivskyi/received_events","type":"User","site_admin":false},"created_at":"2017-04-12T14:49:29Z","updated_at":"2017-04-12T14:49:29Z","body":"Which version or Python/typing are you using? I just tried this on master and it works. If you are using 3.6.0, then try upgrading to 3.6.1, or maybe try the master branch (this was fixed only recently IIRC)."}}
{"actor":{"display_login":"ilevkivskyi"}}