Title: `-2` and `--python-version 2.7` arguments differ in behaviour · Issue #5576 · python/mypy · GitHub
Open Graph Title: `-2` and `--python-version 2.7` arguments differ in behaviour · Issue #5576 · python/mypy
X Title: `-2` and `--python-version 2.7` arguments differ in behaviour · Issue #5576 · python/mypy
Description: This is on mypy 0.620 on Python 3.6. My understanding is that the command arguments -2 and --python-version 2.7 are supposed to do the same thing. But in infer_python_version_and_executable() python_version is different on the given opti...
Open Graph Description: This is on mypy 0.620 on Python 3.6. My understanding is that the command arguments -2 and --python-version 2.7 are supposed to do the same thing. But in infer_python_version_and_executable() pytho...
X Description: This is on mypy 0.620 on Python 3.6. My understanding is that the command arguments -2 and --python-version 2.7 are supposed to do the same thing. But in infer_python_version_and_executable() pytho...
Opengraph URL: https://github.com/python/mypy/issues/5576
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`-2` and `--python-version 2.7` arguments differ in behaviour","articleBody":"This is on mypy 0.620 on Python 3.6.\r\n\r\nMy understanding is that the command arguments `-2` and `--python-version 2.7` are\r\nsupposed to do the same thing. But in `infer_python_version_and_executable()`\r\npython_version is different on the given options and I think this affects how it finds a\r\nvalue for `python_executable`.\r\n\r\nIf I'm understanding this correctly, I think it might be an issue with the arguments\r\nhaving different `dest` values? `-2` sets a constant on the wrong namespace?\r\n\r\n```\r\n> python3 -m pdb (which mypy) -2 .\r\n> /home/sqwishy/.local/bin/mypy(4)\u003cmodule>()\r\n-> import re\r\n(Pdb) b mypy/main.py:278\r\nBreakpoint 1 at /home/sqwishy/.local/lib/python3.6/site-packages/mypy/main.py:278\r\n(Pdb) c\r\n> /home/sqwishy/.local/lib/python3.6/site-packages/mypy/main.py(278)infer_python_version_and_executable()\r\n-> if special_opts.python_executable is not None and special_opts.python_version is not None:\r\n(Pdb) pp vars(special_opts)\r\n...\r\n 'python_executable': None,\r\n 'python_version': None,\r\n 'silent_imports': False,\r\n...\r\n```\r\n```\r\n> python3 -m pdb (which mypy) --python-version 2.7 .\r\n> /home/sqwishy/.local/bin/mypy(4)\u003cmodule>()\r\n-> import re\r\n(Pdb) b mypy/main.py:278\r\nBreakpoint 1 at /home/sqwishy/.local/lib/python3.6/site-packages/mypy/main.py:278\r\n(Pdb) c\r\n> /home/sqwishy/.local/lib/python3.6/site-packages/mypy/main.py(278)infer_python_version_and_executable()\r\n-> if special_opts.python_executable is not None and special_opts.python_version is not None:\r\n(Pdb) pp vars(special_opts)\r\n...\r\n 'python_executable': None,\r\n 'python_version': (2, 7),\r\n 'silent_imports': False,\r\n...\r\n```\r\n\r\nI would expect `special_opts.python_version` to be the same in both cases.","author":{"url":"https://github.com/sqwishy","@type":"Person","name":"sqwishy"},"datePublished":"2018-09-05T18:40:06Z","url":"https://github.com/python/mypy/issues/5576"}
| 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:1c0ac72f-9bcf-a992-3888-01c909ba41b7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EC9C:34D604:17938C5:1F20230:6B0022B9 |
| html-safe-nonce | 666ef2edf97315bfcb2184691eef8babdd1d233d444e63be546140052ca1fa9a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzlDOjM0RDYwNDoxNzkzOEM1OjFGMjAyMzA6NkIwMDIyQjkiLCJ2aXNpdG9yX2lkIjoiNzAzOTAzODcwOTQxNjYwMDI0OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6e11456c5120e432f3cb56a824f947991647cfeeec2d1fc4268e94958a362f05 |
| hovercard-subject-tag | issue:357354128 |
| 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/5576/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cbebb96957106615ff5f244d360356357e6630ad33ab52008e1e05e830072820/python/mypy/issues/5576 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cbebb96957106615ff5f244d360356357e6630ad33ab52008e1e05e830072820/python/mypy/issues/5576 |
| og:image:alt | This is on mypy 0.620 on Python 3.6. My understanding is that the command arguments -2 and --python-version 2.7 are supposed to do the same thing. But in infer_python_version_and_executable() pytho... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sqwishy |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| 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 | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width