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

bot, ip: fix minor type issues #2393

Merged
merged 2 commits into from
Jan 5, 2023
Merged

Conversation

Exirel
Copy link
Contributor

@Exirel Exirel commented Jan 4, 2023

Description

After upgrading mypy, I discovered two small problems to fix:

  • a missing Optional for an optional argument in sopel.bot
  • a simplification that was missed when cleaning imports in the ip built-in plugin

Note about the ip plugin: I didn't change the code or its formatting beside removing the unnecessary elif/else and removing one level of indentation. So if anything is wrong in this block of code, sorry I didn't check.

Checklist

  • I have read CONTRIBUTING.md
  • I can and do license this contribution under the EFLv2
  • No issues are reported by make qa (runs make quality and make test)
  • I have tested the functionality of the things this change touches

@Exirel Exirel added the Housekeeping Code cleanup, removal of deprecated stuff, etc. label Jan 4, 2023
@dgw dgw added this to the 8.0.0 milestone Jan 4, 2023
sopel/modules/ip.py Outdated Show resolved Hide resolved
@Exirel Exirel requested a review from dgw January 4, 2023 23:01
Copy link
Member

@dgw dgw left a comment

Choose a reason for hiding this comment

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

And this time I will wait for you to squash, unlike the last merge. 🙊

In a previous version, Sopel was not guarantee to have the retrieve
function, that may come from different imports based on the Python
version.

Now that everything is running with Python 3+, the function always
exists, so `elif retrieve:` was always true, becoming an irrelevant
condition.

`mypy` complained, rightfully so, about it.

Co-authored-by: dgw <dgw@technobabbl.es>
@Exirel
Copy link
Contributor Author

Exirel commented Jan 5, 2023

Done, ready to merge.

@dgw dgw merged commit 2bdf7cb into sopel-irc:master Jan 5, 2023
@Exirel Exirel deleted the mypy-type-fix-bot-and-ip branch April 8, 2023 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Housekeeping Code cleanup, removal of deprecated stuff, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants