Skip to content

Update Unused and __exit__ parameters in stdlib #9519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jan 17, 2023

Conversation

Avasam
Copy link
Collaborator

@Avasam Avasam commented Jan 13, 2023

Follow up to #9475

  • Use of Unused type alias for unused params.
  • Removed an allowlist entry uuid.getnode by correctly typing an undocumented/unused param
  • Properly(?) typed asyncio.runners.Runner.__exit__ and sqlite3.dbapi2.Blob.__exit__ using type[BaseException] | None, BaseException | None, TracebackType | None instead of objects. I couldn't check the source for these two, so I'm not sure if the params are meant to be unsued.

There's also 4 object | None in stdlib, should I change those to object as well?

@github-actions

This comment has been minimized.

@Avasam
Copy link
Collaborator Author

Avasam commented Jan 13, 2023

Random CI failure, you can re-run just that job

@AlexWaygood
Copy link
Member

Hmm, while support for arbitrary aliases in flake8-pyi is unrealistic, we could certainly add some special-casing for the _typeshed.Unused alias specifically. I think I'd prefer to do that rather than add a bajillion # noqa comments :)

@AlexWaygood
Copy link
Member

Hmm, while support for arbitrary aliases in flake8-pyi is unrealistic, we could certainly add some special-casing for the _typeshed.Unused alias specifically. I think I'd prefer to do that rather than add a bajillion # noqa comments :)

Are you interested in working on a flake8-pyi PR for this? If not, I can take a look at adding special-casing

@Avasam
Copy link
Collaborator Author

Avasam commented Jan 14, 2023

Are you interested in working on a flake8-pyi PR for this? If not, I can take a look at adding special-casing

Sure. If I"m stuck I"ll let you know

@github-actions

This comment has been minimized.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Mostly looks good, but a few points below! Also, you have a fair few unused noqa comments following the new flake8-pyi release ;)

@Avasam
Copy link
Collaborator Author

Avasam commented Jan 17, 2023

Thanks for looking into the methods I was uncertain about.

I still have one unanswered question left:

There's also 4 object | None in stdlib, should I change those to object as well?

@github-actions

This comment has been minimized.

@AlexWaygood
Copy link
Member

I still have one unanswered question left:

There's also 4 object | None in stdlib, should I change those to object as well?

Sure, why not!

@Avasam Avasam requested a review from AlexWaygood January 17, 2023 15:25
@github-actions
Copy link
Contributor

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

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Thanks!

@AlexWaygood AlexWaygood merged commit c70d303 into python:main Jan 17, 2023
@Avasam Avasam deleted the unused-param-stdlib branch January 17, 2023 15:41
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