{"action":"created","issue":{"url":"https://api.github.com/repos/python/typeshed/issues/520","repository_url":"https://api.github.com/repos/python/typeshed","labels_url":"https://api.github.com/repos/python/typeshed/issues/520/labels{/name}","comments_url":"https://api.github.com/repos/python/typeshed/issues/520/comments","events_url":"https://api.github.com/repos/python/typeshed/issues/520/events","html_url":"https://github.com/python/typeshed/issues/520","id":174634032,"number":520,"title":"Non-existent class attributes in stub for ast module","user":{"login":"markshannon","id":9448417,"avatar_url":"https://avatars.githubusercontent.com/u/9448417?v=3","gravatar_id":"","url":"https://api.github.com/users/markshannon","html_url":"https://github.com/markshannon","followers_url":"https://api.github.com/users/markshannon/followers","following_url":"https://api.github.com/users/markshannon/following{/other_user}","gists_url":"https://api.github.com/users/markshannon/gists{/gist_id}","starred_url":"https://api.github.com/users/markshannon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markshannon/subscriptions","organizations_url":"https://api.github.com/users/markshannon/orgs","repos_url":"https://api.github.com/users/markshannon/repos","events_url":"https://api.github.com/users/markshannon/events{/privacy}","received_events_url":"https://api.github.com/users/markshannon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-01T21:47:47Z","updated_at":"2016-09-02T03:57:10Z","closed_at":null,"body":"github.com/python/typeshed/blob/master/third_party/3/typed_ast/ast35.pyi\r\ncontains this code:\r\n```python\r\nclass stmt(AST):\r\n    lineno = ...  # type: int\r\n    col_offset = ...  # type: int\r\n```\r\nBut `ast.stmt` doesn't have those attributes:\r\n```python\r\n>>> import ast\r\n>>> ast.stmt.lineno\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\nAttributeError: type object 'stmt' has no attribute 'lineno' \r\n```\r\nShouldn't the stub should read something like:\r\n```python\r\nclass stmt(AST):\r\n    def __init__(self, *args):\r\n        self.lineno = ...  # type: int\r\n        self.col_offset = ...  # type: int\r\n```\r\n\r\nIt is the instances of `ast.stmt`, not the class itself, that have `lineno` and `col_offset`. The stub file should reflect that."},"comment":{"url":"https://api.github.com/repos/python/typeshed/issues/comments/244277389","html_url":"https://github.com/python/typeshed/issues/520#issuecomment-244277389","issue_url":"https://api.github.com/repos/python/typeshed/issues/520","id":244277389,"user":{"login":"gvanrossum","id":2894642,"avatar_url":"https://avatars.githubusercontent.com/u/2894642?v=3","gravatar_id":"","url":"https://api.github.com/users/gvanrossum","html_url":"https://github.com/gvanrossum","followers_url":"https://api.github.com/users/gvanrossum/followers","following_url":"https://api.github.com/users/gvanrossum/following{/other_user}","gists_url":"https://api.github.com/users/gvanrossum/gists{/gist_id}","starred_url":"https://api.github.com/users/gvanrossum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gvanrossum/subscriptions","organizations_url":"https://api.github.com/users/gvanrossum/orgs","repos_url":"https://api.github.com/users/gvanrossum/repos","events_url":"https://api.github.com/users/gvanrossum/events{/privacy}","received_events_url":"https://api.github.com/users/gvanrossum/received_events","type":"User","site_admin":false},"created_at":"2016-09-02T03:57:09Z","updated_at":"2016-09-02T03:57:09Z","body":"Actually I prefer the first syntax, it's more readable. (And PEP 526 makes\nit even more so.)\n\nOn Thursday, September 1, 2016, Mark Shannon <notifications@github.com>\nwrote:\n\n> github.com/python/typeshed/blob/master/third_party/3/typed_ast/ast35.pyi\n> contains this code:\n>\n> class stmt(AST):\n>     lineno = ...  # type: int\n>     col_offset = ...  # type: int\n>\n> But ast.stmt doesn't have those attributes:\n>\n> >>> import ast>>> ast.stmt.lineno\n> Traceback (most recent call last):\n>   File \"<stdin>\", line 1, in <module>AttributeError: type object 'stmt' has no attribute 'lineno'\n>\n> Shouldn't the stub should read something like:\n>\n> class stmt(AST):\n>     def __init__(self, *args):\n>         self.lineno = ...  # type: int\n>         self.col_offset = ...  # type: int\n>\n> It is the instances of ast.stmt, not the class itself, that have lineno\n> and col_offset. The stub file should reflect that.\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/python/typeshed/issues/520>, or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/ACwrMprt5E2R00fWQ4p05ommfCD0gmgIks5ql0gFgaJpZM4JzKn3>\n> .\n>\n\n\n-- \n--Guido (mobile)\n"}}
{"actor":{"display_login":"gvanrossum"}}