Title: Extend operator-typo SyntaxError suggestions (`=<`, `=>`, `=!`) to `if/while` other conditions · Issue #154970 · python/cpython · GitHub
Open Graph Title: Extend operator-typo SyntaxError suggestions (`=<`, `=>`, `=!`) to `if/while` other conditions · Issue #154970 · python/cpython
X Title: Extend operator-typo SyntaxError suggestions (`=<`, `=>`, `=!`) to `if/while` other conditions · Issue #154970 · python/cpython
Description: Follow-up #151375 In that PR we added helpful SyntaxError messages for common operator typos: =< suggests <=, => suggests >=, and =! suggests !=. These suggestions currently only work when the typo appears in a plain statement. like 'a =...
Open Graph Description: Follow-up #151375 In that PR we added helpful SyntaxError messages for common operator typos: =< suggests <=, => suggests >=, and =! suggests !=. These suggestions currently only work when the typo...
X Description: Follow-up #151375 In that PR we added helpful SyntaxError messages for common operator typos: =< suggests <=, => suggests >=, and =! suggests !=. These suggestions currently only work w...
Opengraph URL: https://github.com/python/cpython/issues/154970
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Extend operator-typo SyntaxError suggestions (`=\u003c`, `=>`, `=!`) to `if/while` other conditions","articleBody":"Follow-up #151375 \n\nIn that PR we added helpful `SyntaxError` messages for common operator typos: `=\u003c` suggests `\u003c=`, `=>` suggests `>=`, and `=!` suggests `!=`.\n\nThese suggestions currently only work when the typo appears in a plain statement. like\n> 'a => b' invalid syntax. Maybe you meant '>=' instead of '=>'?\n\nSo this is for extending in `if, while`, or other conditions:\n\n> These only fire for bare statements, so `if a => b:` still gives the generic error, no? That is probably fine for a first iteration (the `= \u003c` tokenization makes it look like an assignment), but maybe we should add a test documenting it or a follow-up issue for the `if`/`while` case.\n\n_Originally posted by @pablogsal in https://github.com/python/cpython/pull/151375#discussion_r3683730462_\n\n*I'm planning to work on this and submit a PR shortly after the follow up merged, please avoid PR in this*","author":{"url":"https://github.com/Aniketsy","@type":"Person","name":"Aniketsy"},"datePublished":"2026-07-31T06:26:28Z","url":"https://github.com/python/cpython/issues/154970"}
| 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:72a410cd-f8ab-09d5-b80c-b5f102e98c69 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D5D0:19B6A2:1E36298:27D2E37:6B022F8B |
| html-safe-nonce | 70e2965e45ee7754f59bc6fe53f37faa2f4b532827910bfb8037c74b41112b5f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENUQwOjE5QjZBMjoxRTM2Mjk4OjI3RDJFMzc6NkIwMjJGOEIiLCJ2aXNpdG9yX2lkIjoiNzk1OTc4NDc2NjAxNjk5MTExNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e290da21f4557751b3835a678f8b1ffe955671fbb5a01188fcaa771244c56d6a |
| hovercard-subject-tag | issue:5027058009 |
| 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/cpython/154970/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7818e28f0f3641ebd3c31d7061eacebbc8864b8d948bc53657fac4b95677879e/python/cpython/issues/154970 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7818e28f0f3641ebd3c31d7061eacebbc8864b8d948bc53657fac4b95677879e/python/cpython/issues/154970 |
| og:image:alt | Follow-up #151375 In that PR we added helpful SyntaxError messages for common operator typos: =< suggests <=, => suggests >=, and =! suggests !=. These suggestions currently only work when the typo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Aniketsy |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width