Skip to content
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

chore: some refurb suggestions and cleanup old Python 2-3.6 stuff #657

Merged
merged 1 commit into from Oct 8, 2022

Conversation

henryiii
Copy link
Collaborator

@henryiii henryiii commented Oct 7, 2022

I tried running refurb, and it had a few good suggestions, I also found some old Python workarounds (for 3.6.1 and before) that could be cleaned up.

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@@ -14,33 +14,8 @@

from __future__ import annotations

__all__ = ["TYPE_CHECKING", "ClassVar", "NoReturn", "Python"]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TYPE_CHECKING was added in 3.5.2, ClassVar in 3.5.3, and NoReturn in 3.5.4/3.6.2. All are now always present.

Copy link
Collaborator

@DiddiLeija DiddiLeija left a comment

Choose a reason for hiding this comment

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

Sounds great to me! Thanks for the cleanup @henryiii!

@FollowTheProcess
Copy link
Collaborator

Looks great 👍🏻 Side note: what's reverb? The only thing I can find on PyPI is a regex library

@henryiii henryiii changed the title chore: some reverb suggestions and cleanup old Python 2-3.6 stuff chore: some refurb suggestions and cleanup old Python 2-3.6 stuff Oct 8, 2022
@henryiii
Copy link
Collaborator Author

henryiii commented Oct 8, 2022

Ahh, mistyped. Refurb.

@henryiii
Copy link
Collaborator Author

henryiii commented Oct 8, 2022

It's a linter built using some of the mypy internals. So I'm therory it can do a few checks that other linters would have trouble getting. It's focused on "modernizing", a bit like pyupgrade, but willing to make suggestions that pyupgrade would not implement (like try/except pass for contextlib.suppress - pyupgrade can't add an import). I've found some of the suggestions helpful, and it's really easy to pipx run refurb <src> and just see what it suggests.

@FollowTheProcess
Copy link
Collaborator

Ahh nice, I'll check that out!

@FollowTheProcess FollowTheProcess merged commit 15013bd into wntrblm:main Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants