Title: mypy duplicates `reveal_type` notes with partial types · Issue #18511 · python/mypy · GitHub
Open Graph Title: mypy duplicates `reveal_type` notes with partial types · Issue #18511 · python/mypy
X Title: mypy duplicates `reveal_type` notes with partial types · Issue #18511 · python/mypy
Description: Bug Report There's two notes from a single reveal_type with a partial type in a loop. To Reproduce def main() -> None: x = None while True: reveal_type(x) x = "" (the outer function is only necessary to make sure a transition to --local-...
Open Graph Description: Bug Report There's two notes from a single reveal_type with a partial type in a loop. To Reproduce def main() -> None: x = None while True: reveal_type(x) x = "" (the outer function is only necessa...
X Description: Bug Report There's two notes from a single reveal_type with a partial type in a loop. To Reproduce def main() -> None: x = None while True: reveal_type(x) x = "" (the outer functio...
Opengraph URL: https://github.com/python/mypy/issues/18511
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"mypy duplicates `reveal_type` notes with partial types","articleBody":"\u003c!--\r\nIf you're not sure whether what you're experiencing is a mypy bug, please see the \"Question and Help\" form instead.\r\nPlease consider:\r\n\r\n- checking our common issues page: https://mypy.readthedocs.io/en/stable/common_issues.html\r\n- searching our issue tracker: https://github.com/python/mypy/issues to see if it's already been reported\r\n- asking on gitter chat: https://gitter.im/python/typing\r\n--\u003e\r\n\r\n**Bug Report**\r\n\r\n\u003c!--\r\nIf you're reporting a problem with a specific library function, the typeshed tracker is better suited for this report: https://github.com/python/typeshed/issues\r\n\r\nIf the project you encountered the issue in is open source, please provide a link to the project.\r\n--\u003e\r\n\r\nThere's two notes from a single `reveal_type` with a partial type in a loop.\r\n\r\n**To Reproduce**\r\n\r\n```python\r\ndef main() -\u003e None:\r\n x = None\r\n while True:\r\n reveal_type(x)\r\n x = \"\"\r\n```\r\n\r\n(the outer function is only necessary to make sure a transition to `--local-partial-types` doesn't render this test case useless)\r\n\r\n**Expected Behavior**\r\n\r\n```\r\nmain.py:4: note: Revealed type is \"Union[builtins.str, None]\"\r\nSuccess: no issues found in 1 source file\r\n```\r\n\r\n**Actual Behavior**\r\n\r\n```\r\nmain.py:4: note: Revealed type is \"None\"\r\nmain.py:4: note: Revealed type is \"Union[builtins.str, None]\"\r\nSuccess: no issues found in 1 source file\r\n```\r\n\r\n**Your Environment**\r\n\r\nI assume this was caused by https://github.com/python/mypy/pull/18180. Checked on mypy playground.\r\n\r\n- Mypy version used: master\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.12\r\n\r\n\u003c!-- You can freely edit this text, please remove all the lines you believe are unnecessary. --\u003e\r\n","author":{"url":"https://github.com/A5rocks","@type":"Person","name":"A5rocks"},"datePublished":"2025-01-22T23:53:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/18511/mypy/issues/18511"}
| 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:34b692a0-05c0-a59a-cd03-364a973a025b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 933E:3081D4:116DD17:169BB9D:6A5C4ACE |
| html-safe-nonce | 99b81e4649bba2268014a5c3a5e9df9f1198e6ec69c8be8a8c972c16bfef5e2a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzNFOjMwODFENDoxMTZERDE3OjE2OUJCOUQ6NkE1QzRBQ0UiLCJ2aXNpdG9yX2lkIjoiMzk4NjIxODYzMDIwNDExNTY2MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 22768bb90b9bda1b3728512eba457be680e5120e62af613a8b396ab57888c2d6 |
| hovercard-subject-tag | issue:2805571870 |
| 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/18511/issue_layout |
| twitter:image | https://opengraph.githubassets.com/34b26dc001562f9ed2bd0d18e7f99e031b9add9bfd1dfd610846ed1fe3435c6a/python/mypy/issues/18511 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/34b26dc001562f9ed2bd0d18e7f99e031b9add9bfd1dfd610846ed1fe3435c6a/python/mypy/issues/18511 |
| og:image:alt | Bug Report There's two notes from a single reveal_type with a partial type in a loop. To Reproduce def main() -> None: x = None while True: reveal_type(x) x = "" (the outer function is only necessa... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | A5rocks |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| 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 | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width