Title: Regression since 0.620: Argument 1 to "__div__" of "int" has incompatible type "float"; expected "int" · Issue #5557 · python/mypy · GitHub
Open Graph Title: Regression since 0.620: Argument 1 to "__div__" of "int" has incompatible type "float"; expected "int" · Issue #5557 · python/mypy
X Title: Regression since 0.620: Argument 1 to "__div__" of "int" has incompatible type "float"; expected "int" · Issue #5557 · python/mypy
Description: Consider: def f(a): # type: (Union[int, float]) -> None a /= 1.1 # <-- Line 10 This looks fine to me, and gives no errors in 0.620 in either Python 2 or Python 3 mode. In the current master it gives this error in Python 2 mode: _.py:10: ...
Open Graph Description: Consider: def f(a): # type: (Union[int, float]) -> None a /= 1.1 # <-- Line 10 This looks fine to me, and gives no errors in 0.620 in either Python 2 or Python 3 mode. In the current master it give...
X Description: Consider: def f(a): # type: (Union[int, float]) -> None a /= 1.1 # <-- Line 10 This looks fine to me, and gives no errors in 0.620 in either Python 2 or Python 3 mode. In the current master i...
Opengraph URL: https://github.com/python/mypy/issues/5557
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Regression since 0.620: Argument 1 to \"__div__\" of \"int\" has incompatible type \"float\"; expected \"int\"","articleBody":"Consider:\r\n```py\r\ndef f(a):\r\n # type: (Union[int, float]) -> None\r\n a /= 1.1 # \u003c-- Line 10\r\n```\r\nThis looks fine to me, and gives no errors in 0.620 in either Python 2 or Python 3 mode. In the current master it gives this error in Python 2 mode:\r\n```\r\n_.py:10: error: Argument 1 to \"__div__\" of \"int\" has incompatible type \"float\"; expected \"int\"\r\n_.py:10: note: __rdiv__ will not be called when evaluating 'float / float': must define __div__\r\n```\r\nIn Python 3 it gives this error:\r\n```\r\n_.py:10: error: Unsupported operand types for / (likely involving Union)\r\n_.py:10: note: __rtruediv__ will not be called when evaluating 'float / float': must define __truediv__\r\n```\r\n@Michael0x2a IIRC you did something with operators recently?","author":{"url":"https://github.com/gvanrossum","@type":"Person","name":"gvanrossum"},"datePublished":"2018-09-01T23:27:39Z","url":"https://github.com/python/mypy/issues/5557"}
| 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:7c664725-d0ca-f689-587a-2cc42f502037 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D678:1FBEEF:14BAE53:1B0BAB8:6B00095C |
| html-safe-nonce | 95b4266c15c812a26e62ca86612a4fde3cbcb881585ec1a280898b776b7df500 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENjc4OjFGQkVFRjoxNEJBRTUzOjFCMEJBQjg6NkIwMDA5NUMiLCJ2aXNpdG9yX2lkIjoiMTIyNDk1NDY1Nzc4MTA1Nzg4NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d56349afae3578245cb3af4a20a1016f066dc98440acda604227829a27586b9b |
| hovercard-subject-tag | issue:356239826 |
| 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/5557/issue_layout |
| twitter:image | https://opengraph.githubassets.com/39373e5afc0aeb25ee96edcbbbaacfc1825b0b2f9cb0ccc6f10236d955fadac2/python/mypy/issues/5557 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/39373e5afc0aeb25ee96edcbbbaacfc1825b0b2f9cb0ccc6f10236d955fadac2/python/mypy/issues/5557 |
| og:image:alt | Consider: def f(a): # type: (Union[int, float]) -> None a /= 1.1 # <-- Line 10 This looks fine to me, and gives no errors in 0.620 in either Python 2 or Python 3 mode. In the current master it give... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gvanrossum |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| 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 | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width