Skip to content

Conversation

@Avasam
Copy link
Collaborator

@Avasam Avasam commented Feb 29, 2024

Extracted from #11496

@github-actions

This comment has been minimized.

Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

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

Thanks, suggested two other changes while we're here

def json_body(self, environ: WSGIEnvironment) -> str: ...
def generate_response(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ...
@property
def wsgi_response(self) -> Self: ... # type:ignore[override]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def wsgi_response(self) -> Self: ... # type:ignore[override]
def wsgi_response(self) -> Self: ... # type: ignore[override]

Copy link
Collaborator Author

@Avasam Avasam Feb 29, 2024

Choose a reason for hiding this comment

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

I've seen (and done) that often. Idk if it's just outside a formatter's purview (Ruff formatter/black). Maybe Ruff linting and/or flake8-pyi could check for this stylistic issue.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, this could be a good lint rule.

Copy link
Collaborator Author

@Avasam Avasam Feb 29, 2024

Choose a reason for hiding this comment

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

There's 40 instances of type:ignore in the code. I could fix them all at once here if you'd like. It's not too far off the original scope of this PR anyway

Copy link
Member

Choose a reason for hiding this comment

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

Sure!

@property
def wsgi_response(self) -> Self: ... # type:ignore[override]
def __str__(self) -> str: ... # type:ignore[override] # noqaY029
def __str__(self) -> str: ... # type:ignore[override] # noqa: Y029
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def __str__(self) -> str: ... # type:ignore[override] # noqa: Y029
def __str__(self) -> str: ... # type: ignore[override] # noqa: Y029

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@JelleZijlstra JelleZijlstra merged commit c75ecf0 into python:main Feb 29, 2024
@Avasam Avasam deleted the noqa-comments-fixes branch February 29, 2024 07:09
danieleades pushed a commit to danieleades/typeshed that referenced this pull request Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants