-
Notifications
You must be signed in to change notification settings - Fork 24
Introduce type hint #138
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
Introduce type hint #138
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds comprehensive type hints (PEP 484) to the td-client-python library, improving development experience with static type checkers. The changes include:
- Addition of type annotations to all public APIs and internal methods
- Creation of
tdclient/types.pymodule with type aliases and TypedDict classes - Addition of
py.typedmarker file for PEP 561 compliance - Configuration for pyright type checker and updates to pre-commit hooks
Reviewed Changes
Copilot reviewed 34 out of 38 changed files in this pull request and generated 64 comments.
Show a summary per file
| File | Description |
|---|---|
| tdclient/types.py | New module defining type aliases and TypedDict classes for common patterns |
| tdclient/py.typed | PEP 561 marker file for type stub support |
| tdclient/util.py | Added type hints to utility functions for CSV parsing and data processing |
| tdclient/client.py | Added comprehensive type hints to the main Client class |
| tdclient/api.py | Added type hints to HTTP API methods and request handling |
| tdclient/*_api.py | Added type hints to all API endpoint classes |
| tdclient/*_model.py | Added type hints to model classes |
| tdclient/cursor.py | Added type hints to cursor implementation |
| tdclient/connection.py | Added type hints to connection implementation |
| tdclient/errors.py | Added docstrings to exception classes |
| pyproject.toml | Added typing-extensions dependency and pyright configuration |
| .pre-commit-config.yaml | Updated hooks and added pyright check |
| .github/workflows/pythontest.yml | Added pyright execution to CI pipeline |
| README.rst | Added documentation about type hints feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tung-vu-td
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Uh oh!
There was an error while loading. Please reload this page.