Skip to content

Conversation

@rolandwalker
Copy link
Contributor

@rolandwalker rolandwalker commented Oct 26, 2025

Description

  • Optional can be replaced by | None in modern Pythons
  • Tuple can be replaced by lowercase tuple in modern Pythons
  • variable cur has a type of pymysql.cursors.Cursor
  • typehint contextlib variable redirect
  • change exit code to int(e.code or 0), a semantic change
  • split build_command_tree() using an inner _build_command_tree() to simplify the return type
  • don't pass mutable COMMAND_TREE as an argument default
  • typehint almost all function arguments
  • typehint all return types
  • remove a needless return statement
  • reformat many parameter lists as vertical

Checklist

  • I've added this contribution to the changelog.md.
  • I've added my name to the AUTHORS file (or it's already there).
  • I ran uv run ruff check && uv run ruff format && uv run mypy --install-types . to lint and format the code.

@rolandwalker rolandwalker self-assigned this Oct 26, 2025
@rolandwalker rolandwalker requested a review from amjith October 26, 2025 00:23
@rolandwalker rolandwalker changed the title Refine typehints in special/llm.py Refine typehints in special/llm.py Oct 26, 2025
 * "Optional" can be replaced by "| None" in modern Pythons
 * "Tuple" can be replaced by lowercase "tuple" in modern Pythons
 * variable "cur" has a type of pymysql.cursors.Cursor
 * typehint contextlib variable "redirect"
 * change exit code to "int(e.code or 0)", a semantic change
 * split build_command_tree() using an inner _build_command_tree() to
   simplify the return type
 * don't pass mutable COMMAND_TREE as an argument default
 * typehint almost all function arguments
 * typehint all return types
 * remove a needless "return" statement
 * reformat many parameter lists as vertical
@rolandwalker rolandwalker force-pushed the RW/refine-llm-py-typehinting branch from e3b59bc to eb8b3b0 Compare October 27, 2025 10:59
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