Skip to content

fix: mypy type checking for AsyncResearchClient#176

Open
chindris-mihai-alexandru wants to merge 1 commit into
exa-labs:masterfrom
chindris-mihai-alexandru:fix/issue-115-mypy-type-checking
Open

fix: mypy type checking for AsyncResearchClient#176
chindris-mihai-alexandru wants to merge 1 commit into
exa-labs:masterfrom
chindris-mihai-alexandru:fix/issue-115-mypy-type-checking

Conversation

@chindris-mihai-alexandru

Copy link
Copy Markdown

Summary

Fix mypy type checking errors for AsyncResearchClient class. Resolves 14+ type errors by using status-based type narrowing and adding proper type annotations.

Changes

  • Use status-based type narrowing in AsyncResearchTyped.__init__ instead of hasattr() checks
  • Add explicit type annotations for TypeAdapter instances
  • Fix overload signatures to match implementation signatures
  • Add minimal type ignore comments where union type handling is complex

Impact

  • Developers can now use mypy strict mode with async_client.py without errors
  • Better IDE autocomplete and type safety
  • No runtime behavior changes

Testing

  • Mypy strict mode passes with 0 errors
  • Python syntax validation passes
  • No breaking changes to existing API

Fixes #115

- Use status-based type narrowing instead of hasattr() checks
- Add type annotations for TypeAdapter instances
- Fix overload signatures to match implementation
- Add type ignore comments for union type handling

Fixes exa-labs#115
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.

Mypy fails to type check AsyncResearchClient

1 participant