{"action":"created","issue":{"url":"https://api.github.com/repos/python/typeshed/issues/2591","repository_url":"https://api.github.com/repos/python/typeshed","labels_url":"https://api.github.com/repos/python/typeshed/issues/2591/labels{/name}","comments_url":"https://api.github.com/repos/python/typeshed/issues/2591/comments","events_url":"https://api.github.com/repos/python/typeshed/issues/2591/events","html_url":"https://github.com/python/typeshed/issues/2591","id":378710401,"node_id":"MDU6SXNzdWUzNzg3MTA0MDE=","number":2591,"title":"Inconsistency in Optional check depending on unrelated variables in __init__","user":{"login":"ShadowTemplate","id":8094369,"node_id":"MDQ6VXNlcjgwOTQzNjk=","avatar_url":"https://avatars2.githubusercontent.com/u/8094369?v=4","gravatar_id":"","url":"https://api.github.com/users/ShadowTemplate","html_url":"https://github.com/ShadowTemplate","followers_url":"https://api.github.com/users/ShadowTemplate/followers","following_url":"https://api.github.com/users/ShadowTemplate/following{/other_user}","gists_url":"https://api.github.com/users/ShadowTemplate/gists{/gist_id}","starred_url":"https://api.github.com/users/ShadowTemplate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShadowTemplate/subscriptions","organizations_url":"https://api.github.com/users/ShadowTemplate/orgs","repos_url":"https://api.github.com/users/ShadowTemplate/repos","events_url":"https://api.github.com/users/ShadowTemplate/events{/privacy}","received_events_url":"https://api.github.com/users/ShadowTemplate/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-11-08T12:29:03Z","updated_at":"2018-11-08T15:44:36Z","closed_at":"2018-11-08T14:59:35Z","author_association":"NONE","body":"Hi! I'm a new mypy user and I hope this issue is not related to my inexperience. I've noticed some inconsistencies related to Optional. \r\nThe following example does not produce any error with mypy 0.641 and mypy-extensions 0.4.1:\r\n```python\r\nfrom typing import List, Optional, Union\r\n\r\nclass A:\r\n    def __init__(self, foo):\r\n        self.my_list: List[Optional[Union[A]]] = 2 * [None]\r\n```\r\nBut as soon as I specify the type for the argument _foo_, things change:\r\n```python\r\nfrom typing import List, Optional, Union\r\n\r\nclass A:\r\n    def __init__(self, foo: int):\r\n        self.my_list: List[Optional[Union[A]]] = 2 * [None]\r\n```\r\n> error: Incompatible types in assignment (expression has type \"List[None]\", variable has type \"List[Optional[A]]\")\r\n\r\nThe attribute _my_list_ isn't related to _foo_, so I can't see why the output should change.\r\nThanks a lot for your attention."},"comment":{"url":"https://api.github.com/repos/python/typeshed/issues/comments/437042491","html_url":"https://github.com/python/typeshed/issues/2591#issuecomment-437042491","issue_url":"https://api.github.com/repos/python/typeshed/issues/2591","id":437042491,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzA0MjQ5MQ==","user":{"login":"ShadowTemplate","id":8094369,"node_id":"MDQ6VXNlcjgwOTQzNjk=","avatar_url":"https://avatars2.githubusercontent.com/u/8094369?v=4","gravatar_id":"","url":"https://api.github.com/users/ShadowTemplate","html_url":"https://github.com/ShadowTemplate","followers_url":"https://api.github.com/users/ShadowTemplate/followers","following_url":"https://api.github.com/users/ShadowTemplate/following{/other_user}","gists_url":"https://api.github.com/users/ShadowTemplate/gists{/gist_id}","starred_url":"https://api.github.com/users/ShadowTemplate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShadowTemplate/subscriptions","organizations_url":"https://api.github.com/users/ShadowTemplate/orgs","repos_url":"https://api.github.com/users/ShadowTemplate/repos","events_url":"https://api.github.com/users/ShadowTemplate/events{/privacy}","received_events_url":"https://api.github.com/users/ShadowTemplate/received_events","type":"User","site_admin":false},"created_at":"2018-11-08T15:44:36Z","updated_at":"2018-11-08T15:44:36Z","author_association":"NONE","body":"Oh, I see! Thanks a lot for your help and your work.\r\nHave a nice day!"}}
{"actor":{"display_login":"ShadowTemplate"}}