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

Update the type aliases used by the DeviceManager add/get methods to return TypeVars with default values that are bound to the appropriate device type #162

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

nfelt14
Copy link
Collaborator

@nfelt14 nfelt14 commented Mar 11, 2024

Proposed changes

refactor: Update the type aliases used by the DeviceManager add/get methods to return TypeVars with default values that are bound to the appropriate device type.

This should provide a better user experience without needing to use typing.cast or ignore comments for type checkers like mypy or pyright.

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply

  • Functionality update (non-breaking change which updates or changes existing functionality)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have followed the guidelines in the CONTRIBUTING document
  • I have signed the CLA
  • I have checked to ensure there aren't other open Pull Requests for the same update/change
  • I have performed a self-review of my code
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • Basic linting passes locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have added necessary documentation (if appropriate)
  • I have updated the Changelog with a brief description of my changes

… methods to return `TypeVar`s with default values that are bound to the appropriate device type.

This should provide a better user experience without needing to use `typing.cast` or ignore comments for type checkers like `mypy` or `pyright`.
@nfelt14 nfelt14 requested review from a team as code owners March 11, 2024 21:20
Copy link

codecov bot commented Mar 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (6370cca) to head (8f21f02).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #162   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          170       170           
  Lines         3792      3801    +9     
  Branches       643       643           
=========================================
+ Hits          3792      3801    +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nfelt14 nfelt14 enabled auto-merge (squash) March 11, 2024 21:33
@nfelt14 nfelt14 merged commit 8ebbf90 into main Mar 11, 2024
39 checks passed
@nfelt14 nfelt14 deleted the nfelt14/typevar-with-defaults branch March 11, 2024 22:42
v12ganesh pushed a commit to v12ganesh/tm_devices that referenced this pull request Mar 28, 2024
… methods to return `TypeVar`s with default values that are bound to the appropriate device type. (tektronix#162)

This should provide a better user experience without needing to use `typing.cast` or ignore comments for type checkers like `mypy` or `pyright`.
Signed-off-by: v12ganesh [email protected]
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