Title: Mypy does not recognize missing method · Issue #6990 · python/mypy · GitHub
Open Graph Title: Mypy does not recognize missing method · Issue #6990 · python/mypy
X Title: Mypy does not recognize missing method · Issue #6990 · python/mypy
Description: In the following example, mypy does not catch that self.meh() does not exist. Is this expected behavior because of the static False? class TestCase: def foo(self) -> bool: return False and self.meh() The original bug in our code base was...
Open Graph Description: In the following example, mypy does not catch that self.meh() does not exist. Is this expected behavior because of the static False? class TestCase: def foo(self) -> bool: return False and self.meh...
X Description: In the following example, mypy does not catch that self.meh() does not exist. Is this expected behavior because of the static False? class TestCase: def foo(self) -> bool: return False and self....
Opengraph URL: https://github.com/python/mypy/issues/6990
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Mypy does not recognize missing method","articleBody":"\r\nIn the following example, mypy does not catch that `self.meh()` does not exist. Is this expected behavior because of the static `False`?\r\n\r\n```python\r\nclass TestCase:\r\n\r\n def foo(self) -> bool:\r\n return False and self.meh()\r\n```\r\n\r\nThe original bug in our code base was harder to spot than this but it boils down to the same reason so I'm wondering if this is expected behavior.\r\n\r\nIf I change the example to \r\n\r\n```python\r\nclass TestCase:\r\n\r\n def foo(self) -> bool:\r\n return True and self.meh()\r\n```\r\n\r\nthen `mypy` does in fact spot the missing `meh` method.\r\n\r\n>mypy_bug.py:5: error: \"TestCase\" has no attribute \"meh\"\r\n","author":{"url":"https://github.com/cburgdorf","@type":"Person","name":"cburgdorf"},"datePublished":"2019-06-13T19:54:00Z","url":"https://github.com/python/mypy/issues/6990"}
| 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:f4af5fcd-22c4-4061-235e-b0740f9d43ee |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DE8E:4D728:2638AE3:31C2D7C:6AFFF854 |
| html-safe-nonce | 6478051f003d83fc729efe8e7c187c3d17e41c8b0ba947301429a07d895f9d0a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERThFOjRENzI4OjI2MzhBRTM6MzFDMkQ3Qzo2QUZGRjg1NCIsInZpc2l0b3JfaWQiOiI3OTc4ODU4MDg3Njg5NzI4ODQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 00b4975b4dfc95daad2b20007b19696582b44567117a620db9bfbe752bdebd71 |
| hovercard-subject-tag | issue:455924388 |
| 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/6990/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ae93f7c0b65bf7af887b9c2dca8004ab0a473fc16e19a7f9131e9cad417d315a/python/mypy/issues/6990 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ae93f7c0b65bf7af887b9c2dca8004ab0a473fc16e19a7f9131e9cad417d315a/python/mypy/issues/6990 |
| og:image:alt | In the following example, mypy does not catch that self.meh() does not exist. Is this expected behavior because of the static False? class TestCase: def foo(self) -> bool: return False and self.meh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cburgdorf |
| 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