Title: pyqtProperty setter always raises an error · Issue #9911 · python/mypy · GitHub
Open Graph Title: pyqtProperty setter always raises an error · Issue #9911 · python/mypy
X Title: pyqtProperty setter always raises an error · Issue #9911 · python/mypy
Description: Bug Report It seems that Mypy is not enjoying pyqtProperty setters. Someone already asked on the Qt mailing-list. To Reproduce from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal class FeatureModel(QObject): stateChanged = pyqtSig...
Open Graph Description: Bug Report It seems that Mypy is not enjoying pyqtProperty setters. Someone already asked on the Qt mailing-list. To Reproduce from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal class Featu...
X Description: Bug Report It seems that Mypy is not enjoying pyqtProperty setters. Someone already asked on the Qt mailing-list. To Reproduce from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal class Featu...
Opengraph URL: https://github.com/python/mypy/issues/9911
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"pyqtProperty setter always raises an error","articleBody":"**Bug Report**\r\n\r\nIt seems that Mypy is not enjoying `pyqtProperty` setters. Someone already asked on the [Qt mailing-list](http://python.6.x6.nabble.com/Reconciling-pyqtProperty-and-mypy-td5279775.html).\r\n\r\n**To Reproduce**\r\n\r\n```python\r\nfrom PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal\r\n\r\n\r\nclass FeatureModel(QObject):\r\n\r\n stateChanged = pyqtSignal()\r\n\r\n def __init__(self, enabled: bool, /) -> None:\r\n super().__init__()\r\n self._enabled = enabled\r\n\r\n @pyqtProperty(bool, notify=stateChanged)\r\n def enabled(self):\r\n return self._enabled\r\n\r\n @enabled.setter\r\n def enabled(self, enabled):\r\n self._enabled = enabled\r\n self.stateChanged.emit()\r\n```\r\n\r\n**Expected Behavior**\r\n\r\nMypy should be happy.\r\n\r\n**Actual Behavior**\r\n\r\n```shell\r\n$ python -m mypy file.py\r\nfile.py:16: error: Name 'enabled' already defined on line 12\r\nFound 1 error in 1 file (checked 1 source file)\r\n```\r\n\r\n**Your Environment**\r\n\r\n- Mypy version used: 0.790\r\n- Mypy command-line flags: None\r\n- Mypy configuration options from `mypy.ini` (and other config files): None\r\n- Python version used: 3.8.6\r\n- Operating system and version: macOS Big Sur (arm64) and Windows 10.","author":{"url":"https://github.com/BoboTiG","@type":"Person","name":"BoboTiG"},"datePublished":"2021-01-14T16:24:43Z","url":"https://github.com/python/mypy/issues/9911"}
| 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:577ef2e9-a1d7-2368-a4e5-daa96d9c2059 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AB4E:12476C:13A3E3E:19A0FBE:6B0005CA |
| html-safe-nonce | 8ddee7f836ffefe3265a1b6130656a3359ea0c5c54963be8f9005e0e4032a934 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjRFOjEyNDc2QzoxM0EzRTNFOjE5QTBGQkU6NkIwMDA1Q0EiLCJ2aXNpdG9yX2lkIjoiMzI5Mzk4Mjk0NTYzODg3NjYxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3da79a0bf68d3305cd2775910b43667d685526d9323f13ddb89793837c4de117 |
| hovercard-subject-tag | issue:786128307 |
| 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/9911/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7712e728ab9eebe2cb15552d26e8601410943dc6ccdcbd177319ccf5f606de70/python/mypy/issues/9911 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7712e728ab9eebe2cb15552d26e8601410943dc6ccdcbd177319ccf5f606de70/python/mypy/issues/9911 |
| og:image:alt | Bug Report It seems that Mypy is not enjoying pyqtProperty setters. Someone already asked on the Qt mailing-list. To Reproduce from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal class Featu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | BoboTiG |
| 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