Title: Conformance Tests directives_type_ignore should probably allow Mypy-like type ignores · Issue #2126 · python/typing · GitHub
Open Graph Title: Conformance Tests directives_type_ignore should probably allow Mypy-like type ignores · Issue #2126 · python/typing
X Title: Conformance Tests directives_type_ignore should probably allow Mypy-like type ignores · Issue #2126 · python/typing
Description: The conformance test directives_type_ignore feels a bit weird since it disallows the Mypy syntax: z: int = "" # type: ignore[
Open Graph Description: The conformance test directives_type_ignore feels a bit weird since it disallows the Mypy syntax: z: int = "" # type: ignore[
X Description: The conformance test directives_type_ignore feels a bit weird since it disallows the Mypy syntax: z: int = "" # type: ignore[<some-error-code>] # It has the following line where the...
Opengraph URL: https://github.com/python/typing/issues/2126
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Conformance Tests directives_type_ignore should probably allow Mypy-like type ignores","articleBody":"The conformance test `directives_type_ignore` feels a bit weird since it disallows the Mypy syntax:\n\n```\nz: int = \"\" # type: ignore[\u003csome-error-code\u003e]\n# It has the following line where the violation should be suppressed:\nz: int = \"\" # type: ignore[additional_stuff]\n```\n\nThe [documentation](https://typing.python.org/en/latest/spec/directives.html#type-ignore-comments) says:\n\n\u003e In some cases, linting tools or other comments may be needed on the same line as a type comment. In these cases, the type comment should be before other comments and linting markers:\n\u003e \n\u003e ``` # type: ignore # \u003ccomment or other marker\u003e ```\n\nI feel it is therefore not really clear if the conformance tests are correct or not and I would really like to avoid adding a flag to Zuban with the name `--make-conformance-tests-pass`. ` # type: ignore[misc]` can also be found in numerous places in Typeshed.\n\nI would just suggest allowing an error there.\n\n----\n\nThere's also this line that should be ignored to the conformance tests:\n\n```\ny: int = \"\" # type: ignore - additional stuff\n```\n\nwhere I'm not sure if it's better to allow an error there, but I don't have an opinion there really. It might be useful to generate an error that the ` - additional stuff` is not conformant with the spec that says we should use an additional comment. Mypy for example has the error `Invalid \"type: ignore\" comment [syntax]`. I'm however totally fine if the conformance tests disallow this.\n\ncc @erictraut since you wrote these tests AFAIK.","author":{"url":"https://github.com/davidhalter","@type":"Person","name":"davidhalter"},"datePublished":"2025-12-09T22:49:39.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/2126/typing/issues/2126"}
| 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:72b83804-81ae-7795-4903-d83073ad7934 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C7AE:E8713:22303E:2EDE8D:696F2C71 |
| html-safe-nonce | 2c5b344de30e31e37dee567d1a7e0ea328938a65cee1604eaac2477a63d53285 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDN0FFOkU4NzEzOjIyMzAzRToyRURFOEQ6Njk2RjJDNzEiLCJ2aXNpdG9yX2lkIjoiNTE5Mjc3OTkwODM0MDcyMjgwMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 86ff311d8f5d62a0b35100e35064492d37f925cd9403132adc76590493439cda |
| hovercard-subject-tag | issue:3712913353 |
| 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/typing/2126/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c26c5936f7fd8e2164b3c213ca62e3fcc27b7034d5f33fec414edcd972bb5958/python/typing/issues/2126 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c26c5936f7fd8e2164b3c213ca62e3fcc27b7034d5f33fec414edcd972bb5958/python/typing/issues/2126 |
| og:image:alt | The conformance test directives_type_ignore feels a bit weird since it disallows the Mypy syntax: z: int = "" # type: ignore[ |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | davidhalter |
| hostname | github.com |
| expected-hostname | github.com |
| None | b278ad162d35332b6de714dfb005de04386c4d92df6475522bef910f491a35ee |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typing git https://github.com/python/typing.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 24604008 |
| octolytics-dimension-repository_nwo | python/typing |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24604008 |
| octolytics-dimension-repository_network_root_nwo | python/typing |
| 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 | 39aed5006635ab6f45e6b77d23e73b08a00272a3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width