Title: Add comments parsing flag to ast.parse · Issue #101494 · python/cpython · GitHub
Open Graph Title: Add comments parsing flag to ast.parse · Issue #101494 · python/cpython
X Title: Add comments parsing flag to ast.parse · Issue #101494 · python/cpython
Description: Feature or enhancement Add a flag to ast.parse that signals it to parse comments for directives given to various static analysis tools like PyRight, MyPy, Pylint, etc. Pitch Currently, ast.parse produces directives for type: ignore only,...
Open Graph Description: Feature or enhancement Add a flag to ast.parse that signals it to parse comments for directives given to various static analysis tools like PyRight, MyPy, Pylint, etc. Pitch Currently, ast.parse pr...
X Description: Feature or enhancement Add a flag to ast.parse that signals it to parse comments for directives given to various static analysis tools like PyRight, MyPy, Pylint, etc. Pitch Currently, ast.parse pr...
Opengraph URL: https://github.com/python/cpython/issues/101494
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add comments parsing flag to ast.parse","articleBody":"# Feature or enhancement\r\n\r\nAdd a flag to `ast.parse` that signals it to parse comments for directives given to various static analysis tools like PyRight, MyPy, Pylint, etc.\r\n\r\n# Pitch\r\n\r\nCurrently, `ast.parse` produces directives for `type: ignore` only, which all type checkers respond to. PyRight reacts to its own special `pyright: ignore` flag to disambiguate type errors that are specific to it. MyPy cannot easily implement a similar flag since it depends on `ast.parse`. Yet a `mypy: ignore` directive is [needed](https://github.com/python/mypy/issues/12358).\r\n\r\nA concrete interface is proposed [here](https://github.com/python/mypy/issues/12358#issuecomment-1071505566) by @jab.\r\n\r\n# Previous discussion\r\n\r\nDiscussion [here](https://discuss.python.org/t/add-comments-parsing-flag-to-ast-parse/23461). Guido suggests a passing a list of namespaces the caller is interested in. This would make the function output easier to parse, and possibly more efficient.","author":{"url":"https://github.com/NeilGirdhar","@type":"Person","name":"NeilGirdhar"},"datePublished":"2023-02-01T13:35:19Z","url":"https://github.com/python/cpython/issues/101494"}
| 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:7ff11994-e988-ffd9-8dbd-949a52486840 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 905C:1BD385:B2ADE:FBDA2:6B005224 |
| html-safe-nonce | bd0c26eb5ee680834bd84b226d078bddb9da4bf648222a59694d42d364dd885e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDVDOjFCRDM4NTpCMkFERTpGQkRBMjo2QjAwNTIyNCIsInZpc2l0b3JfaWQiOiI4MDk2Mjg3NjgyOTA2MzEzMjUyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | fba03b7993db409242631409e6d82d8aaa52eb0270219497bccb46c82eee493c |
| hovercard-subject-tag | issue:1566129103 |
| 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/101494/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1faff2de5d4424b509e2875e14a7f84be9b6dd1848ef6d0240ef5e3a86970a6c/python/cpython/issues/101494 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1faff2de5d4424b509e2875e14a7f84be9b6dd1848ef6d0240ef5e3a86970a6c/python/cpython/issues/101494 |
| og:image:alt | Feature or enhancement Add a flag to ast.parse that signals it to parse comments for directives given to various static analysis tools like PyRight, MyPy, Pylint, etc. Pitch Currently, ast.parse pr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | NeilGirdhar |
| hostname | github.com |
| expected-hostname | github.com |
| None | f420f4996e6b1ff1ccd6d7683f8134f4b5f0f8a50124c210dbfe7490e5644abb |
| 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 | 26e00df917aba0f128135dc073ea0c5e33a70d40 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width