Skip to content

Update documentation to reflect type:ignore changes#3121

Merged
charliermarsh merged 1 commit intomainfrom
micha/document-type-ignore-changes
Mar 24, 2026
Merged

Update documentation to reflect type:ignore changes#3121
charliermarsh merged 1 commit intomainfrom
micha/document-type-ignore-changes

Conversation

@MichaReiser
Copy link
Copy Markdown
Member

Summary

Update the documentation to reflect the changes introduced in astral-sh/ruff#24096

@MichaReiser MichaReiser added the documentation Improvements or additions to documentation label Mar 24, 2026
line before any Python code:

```python
# ty: ignore[invalid-argument-type]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it critical here that there's a blank line between this and any Python code? Like is this different than:

# ty: ignore[invalid-argument-type]
sum_three_numbers(3, 2, "1")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, as long as there is nothing before it, it's a file-wide suppression comment either way. And we don't support previous-line suppression comments.

I suspect this formatting is just to emphasize that it's not a previous-line suppression comment. It's a bit unfortunate how easily it could look like one, though in real code it's probably not an issue, since there will likely be new lines, an import block, etc.

line before any Python code:

```python
# ty: ignore[invalid-argument-type]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, as long as there is nothing before it, it's a file-wide suppression comment either way. And we don't support previous-line suppression comments.

I suspect this formatting is just to emphasize that it's not a previous-line suppression comment. It's a bit unfortunate how easily it could look like one, though in real code it's probably not an issue, since there will likely be new lines, an import block, etc.

@charliermarsh charliermarsh merged commit db65b3e into main Mar 24, 2026
13 checks passed
@charliermarsh charliermarsh deleted the micha/document-type-ignore-changes branch March 24, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants