Skip to content

Fix mypy type annotation for kwargs parameter#57

Merged
StephenCWills merged 1 commit into
diasurgical:mainfrom
skypher:fix/mypy-kwargs-type
Nov 29, 2025
Merged

Fix mypy type annotation for kwargs parameter#57
StephenCWills merged 1 commit into
diasurgical:mainfrom
skypher:fix/mypy-kwargs-type

Conversation

@skypher
Copy link
Copy Markdown
Contributor

@skypher skypher commented Nov 29, 2025

Summary

  • Fix incorrect type annotation for **options parameter in GamebotClient.__init__
  • Change **options: dict[str, Any] to **options: Any since kwargs annotations specify the value type, not the full dict type

Test plan

  • Run mypy on all Python files - passes

Reference: https://typing.python.org/en/latest/spec/callables.html#annotating-args-and-kwargs

@StephenCWills
Copy link
Copy Markdown
Member

  • Update mypy CI workflow to check all Python files (discord_bot.py, bot_db.py, ztapi_client.py)

It was previously pointed out to me (#45 (comment)) that mypy would check local imports, so it shouldn't be necessary to explicitly add bot_db.py or ztapi_client.py. Is that no longer the case?

Change `**options: dict[str, Any]` to `**options: Any` since kwargs
annotations specify the value type, not the full dict type.

See: https://typing.python.org/en/latest/spec/callables.html#annotating-args-and-kwargs
@skypher skypher force-pushed the fix/mypy-kwargs-type branch from 604cb81 to 79bfb7a Compare November 29, 2025 02:23
@skypher
Copy link
Copy Markdown
Contributor Author

skypher commented Nov 29, 2025

  • Update mypy CI workflow to check all Python files (discord_bot.py, bot_db.py, ztapi_client.py)

It was previously pointed out to me (#45 (comment)) that mypy would check local imports, so it shouldn't be necessary to explicitly add bot_db.py or ztapi_client.py. Is that no longer the case?

I've checked this and removed that hunk. Great catch!

@StephenCWills StephenCWills merged commit 6e3941e into diasurgical:main Nov 29, 2025
4 checks passed
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