{"action":"created","issue":{"url":"https://api.github.com/repos/python/mypy/issues/4175","repository_url":"https://api.github.com/repos/python/mypy","labels_url":"https://api.github.com/repos/python/mypy/issues/4175/labels{/name}","comments_url":"https://api.github.com/repos/python/mypy/issues/4175/comments","events_url":"https://api.github.com/repos/python/mypy/issues/4175/events","html_url":"https://github.com/python/mypy/issues/4175","id":269243702,"number":4175,"title":"`Cycle in inheritance hierarchy` because items have the same name","user":{"login":"quodlibetor","id":277161,"avatar_url":"https://avatars3.githubusercontent.com/u/277161?v=4","gravatar_id":"","url":"https://api.github.com/users/quodlibetor","html_url":"https://github.com/quodlibetor","followers_url":"https://api.github.com/users/quodlibetor/followers","following_url":"https://api.github.com/users/quodlibetor/following{/other_user}","gists_url":"https://api.github.com/users/quodlibetor/gists{/gist_id}","starred_url":"https://api.github.com/users/quodlibetor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quodlibetor/subscriptions","organizations_url":"https://api.github.com/users/quodlibetor/orgs","repos_url":"https://api.github.com/users/quodlibetor/repos","events_url":"https://api.github.com/users/quodlibetor/events{/privacy}","received_events_url":"https://api.github.com/users/quodlibetor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2017-10-27T21:40:30Z","updated_at":"2018-01-01T22:18:33Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"mypy does not distinguish between different objects with the same name in a file.\r\n\r\nGiven:\r\n\r\n```python\r\nclass same(object):\r\n    pass\r\n\r\nclass same(same):\r\n    pass\r\n```\r\n```\r\n$ mypy /tmp/samesame/supername.py\r\n/tmp/samesame/supername.py:6: error: Name 'same' already defined on line 1\r\n/tmp/samesame/supername.py:6: error: Cycle in inheritance hierarchy\r\n```\r\n\r\nThe first error is a legitimate style nit, but the second item is not technically correct. Worse, it appears that it cannot be silenced by `--follow-imports=silent`:\r\n\r\n```python\r\nfrom dateutil.zoneinfo import tzfile  # type: ignore\r\n```\r\n```\r\n$ MYPYPATH=$VIRTUAL_ENV/lib/python3.6/site-packages mypy --follow-imports=silent /tmp/samesame/other.py\r\n.../lib/python3.6/site-packages/dateutil/zoneinfo/__init__.py:25: error: Cycle in inheritance hierarchy\r\n```\r\n\r\nTo be clear, I don't think that this is an example of good code, but as you can tell it came up for me in dateutil, and, AFAICT it's basically impossible to workaround.\r\n\r\nIf there was a way to have a hard blacklist on modules to treat as Any without importing that would also solve this for me in the short time."},"comment":{"url":"https://api.github.com/repos/python/mypy/issues/comments/354681150","html_url":"https://github.com/python/mypy/issues/4175#issuecomment-354681150","issue_url":"https://api.github.com/repos/python/mypy/issues/4175","id":354681150,"user":{"login":"gvanrossum","id":2894642,"avatar_url":"https://avatars3.githubusercontent.com/u/2894642?v=4","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":"2018-01-01T22:18:33Z","updated_at":"2018-01-01T22:18:33Z","author_association":"OWNER","body":"Yup. (In fact I think many blocking errors can be demoted to \"normal\".)"}}
{"actor":{"display_login":"gvanrossum"}}