Skip to content

Conversation

@Avasam
Copy link
Collaborator

@AvasamAvasam 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
CollaboratorAuthor

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
CollaboratorAuthor

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

@AlexWaygoodAlexWaygood 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
CollaboratorAuthor

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!

@github-actions
Copy link
Contributor

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

Copy link
Member

@AlexWaygoodAlexWaygood left a comment

Choose a reason for hiding this comment

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

Thanks!

@AlexWaygoodAlexWaygood merged commit c70d303 into python:mainJan 17, 2023
@AvasamAvasam deleted the unused-param-stdlib branch January 17, 2023 15:41
Sign up for freeto 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

@Avasam@AlexWaygood