Title: import of constraints fails if done before subtypes · Issue #6329 · python/mypy · GitHub
Open Graph Title: import of constraints fails if done before subtypes · Issue #6329 · python/mypy
X Title: import of constraints fails if done before subtypes · Issue #6329 · python/mypy
Description: Are you reporting a bug, or opening a feature request? bug Please insert below the code you are checking with mypy, or a mock-up repro if the source is private. We would appreciate if you try to simplify your case to a minimal repro. imp...
Open Graph Description: Are you reporting a bug, or opening a feature request? bug Please insert below the code you are checking with mypy, or a mock-up repro if the source is private. We would appreciate if you try to si...
X Description: Are you reporting a bug, or opening a feature request? bug Please insert below the code you are checking with mypy, or a mock-up repro if the source is private. We would appreciate if you try to si...
Opengraph URL: https://github.com/python/mypy/issues/6329
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"import of constraints fails if done before subtypes","articleBody":"* Are you reporting a bug, or opening a feature request?\r\n\r\nbug\r\n\r\n* Please insert below the code you are checking with mypy,\r\n or a mock-up repro if the source is private. We would appreciate\r\n if you try to simplify your case to a minimal repro.\r\n```\r\nimport mypy.constraints\r\n```\r\n\r\n\r\n* What is the actual behavior/output?\r\n\r\n\r\n```\r\n(mypy) clint@clint-ThinkPad-X1-Carbon-6th:~$ pip install mypy\r\nCollecting mypy\r\n Downloading https://files.pythonhosted.org/packages/fc/4b/b2376fffd1416b76da0708dd8c8ab46c80cd2364c42212059587ae92f1d8/mypy-0.660-py3-none-any.whl (1.4MB)\r\n 100% |████████████████████████████████| 1.4MB 11.5MB/s \r\nCollecting mypy-extensions\u003c0.5.0,>=0.4.0 (from mypy)\r\n Using cached https://files.pythonhosted.org/packages/4d/72/8d54e2b296631b9b14961d583e56e90d9d7fba8a240d5ce7f1113cc5e887/mypy_extensions-0.4.1-py2.py3-none-any.whl\r\nCollecting typed-ast\u003c1.3.0,>=1.2.0 (from mypy)\r\n Downloading https://files.pythonhosted.org/packages/52/6c/57ecbb2ecb80274b7f2b7f95d0937de310aa2e66839d7ae9436881525b23/typed_ast-1.2.0-cp36-cp36m-manylinux1_x86_64.whl (724kB)\r\n 100% |████████████████████████████████| 727kB 10.9MB/s \r\nInstalling collected packages: mypy-extensions, typed-ast, mypy\r\nSuccessfully installed mypy-0.660 mypy-extensions-0.4.1 typed-ast-1.2.0\r\n(mypy) clint@clint-ThinkPad-X1-Carbon-6th:~$ python3\r\nPython 3.6.7 (default, Oct 22 2018, 11:32:17) \r\n[GCC 8.2.0] on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import mypy.constraints\r\nTraceback (most recent call last):\r\n File \"\u003cstdin>\", line 1, in \u003cmodule>\r\n File \"/home/clint/v/mypy/lib/python3.6/site-packages/mypy/constraints.py\", line 11, in \u003cmodule>\r\n import mypy.subtypes\r\n File \"/home/clint/v/mypy/lib/python3.6/site-packages/mypy/subtypes.py\", line 971, in \u003cmodule>\r\n return_constraint_direction: int = mypy.constraints.SUBTYPE_OF,\r\nAttributeError: module 'mypy' has no attribute 'constraints'\r\n>>> \r\n```\r\n\r\n* What is the behavior/output you expect?\r\n\r\nimports of public modules should not cause AttributeErrors.\r\n\r\n* What are the versions of mypy and Python you are using?\r\n\r\nmypy 0.660\r\npython 3.6.7\r\n\r\n Do you see the same issue after installing mypy from Git master?\r\n\r\nNo\r\n```\r\nPython 3.6.7 (default, Oct 22 2018, 11:32:17) \r\n[GCC 8.2.0] on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import mypy.constraints\r\nTraceback (most recent call last):\r\n File \"\u003cstdin>\", line 1, in \u003cmodule>\r\n File \"/home/clint/src/misc/mypy/mypy/constraints.py\", line 11, in \u003cmodule>\r\n import mypy.subtypes\r\n File \"/home/clint/src/misc/mypy/mypy/subtypes.py\", line 971, in \u003cmodule>\r\n return_constraint_direction: int = mypy.constraints.SUBTYPE_OF,\r\nAttributeError: module 'mypy' has no attribute 'constraints'\r\n>>> \r\n```","author":{"url":"https://github.com/SpamapS","@type":"Person","name":"SpamapS"},"datePublished":"2019-02-04T19:08:08Z","url":"https://github.com/python/mypy/issues/6329"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c432d108-e911-23dd-3c01-5083e718f5cb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E7CA:B1603:30F39FC:40D4806:6B002F3F |
| html-safe-nonce | 1e47beddf137887e5c592060f11efdff65dbb063000798b5d2749988fa5068ae |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFN0NBOkIxNjAzOjMwRjM5RkM6NDBENDgwNjo2QjAwMkYzRiIsInZpc2l0b3JfaWQiOiI3MDc1MzMzNzYzMzE5ODQ3MDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | bf2b160ac2c136f6756450fbcd90923db4cda46ce4b55dd591cd4131ec7f90bd |
| hovercard-subject-tag | issue:406474392 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/mypy/6329/issue_layout |
| twitter:image | https://opengraph.githubassets.com/81f949ebd0346d5bdb949470b2d16d1f4f87c96db3ef4718861f7ead63553da0/python/mypy/issues/6329 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/81f949ebd0346d5bdb949470b2d16d1f4f87c96db3ef4718861f7ead63553da0/python/mypy/issues/6329 |
| og:image:alt | Are you reporting a bug, or opening a feature request? bug Please insert below the code you are checking with mypy, or a mock-up repro if the source is private. We would appreciate if you try to si... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SpamapS |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/mypy git https://github.com/python/mypy.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 7053637 |
| octolytics-dimension-repository_nwo | python/mypy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7053637 |
| octolytics-dimension-repository_network_root_nwo | python/mypy |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width