{"action":"opened","issue":{"url":"https://api.github.com/repos/google/pytype/issues/76","repository_url":"https://api.github.com/repos/google/pytype","labels_url":"https://api.github.com/repos/google/pytype/issues/76/labels{/name}","comments_url":"https://api.github.com/repos/google/pytype/issues/76/comments","events_url":"https://api.github.com/repos/google/pytype/issues/76/events","html_url":"https://github.com/google/pytype/issues/76","id":304986109,"number":76,"title":"Invalid error from argparse.ArgumentParser.add_argument","user":{"login":"kamahen","id":34629301,"avatar_url":"https://avatars1.githubusercontent.com/u/34629301?v=4","gravatar_id":"","url":"https://api.github.com/users/kamahen","html_url":"https://github.com/kamahen","followers_url":"https://api.github.com/users/kamahen/followers","following_url":"https://api.github.com/users/kamahen/following{/other_user}","gists_url":"https://api.github.com/users/kamahen/gists{/gist_id}","starred_url":"https://api.github.com/users/kamahen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kamahen/subscriptions","organizations_url":"https://api.github.com/users/kamahen/orgs","repos_url":"https://api.github.com/users/kamahen/repos","events_url":"https://api.github.com/users/kamahen/events{/privacy}","received_events_url":"https://api.github.com/users/kamahen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-14T00:51:49Z","updated_at":"2018-03-14T00:51:49Z","closed_at":null,"author_association":"NONE","body":"File `/tmp/zz.py`\r\n```python\r\nimport argparse\r\nparser = argparse.ArgumentParser(description='Parse a file')\r\nparser.add_argument('--src', required=True, help='Input file')\r\n```\r\n\r\nproduces this error message (from the command `/usr/local/bin/pytype -V3.6 /tmp/zz.py`):\r\n```\r\nFile \"/tmp/zz.py\", line 3, in <module>: Function ArgumentParser.add_argument was called with the wrong arguments [wrong-arg-types]\r\n  Expected: (self, *name_or_flags, action, choices, const, default, dest, help, metavar, nargs, required: Optional[bool] = ..., ...)\r\n  Actually passed: (self, _, help, required: int)\r\n```\r\n\r\nMypy is happy with it. This seems that this is the relevant declaration in `typeshed/stdlib/2and3/argparse.pyi` (perhaps the `*` isn't processed properly?):\r\n```python\r\n    def add_argument(self,\r\n                     *name_or_flags: Union[_Text, Sequence[_Text]],\r\n                     action: Union[_Text, Type[Action]] = ...,\r\n                     nargs: Union[int, _Text] = ...,\r\n                     const: Any = ...,\r\n                     default: Any = ...,\r\n                     type: Union[Callable[[str], _T], FileType] = ...,\r\n                     choices: Iterable[_T] = ...,\r\n                     required: bool = ...,\r\n                     help: _Text = ...,\r\n                     metavar: Union[_Text, Tuple[_Text, ...]] = ...,\r\n                     dest: _Text = ...,\r\n                     version: _Text = ...) -> None: ...  # weirdly documented\r\n```"}}
{"actor":{"display_login":"kamahen"}}