-
Notifications
You must be signed in to change notification settings - Fork 320
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
4641: Alazar generic output must be input r=jenshnielsen a=jenshnielsen With the upcoming mypy 0.980 mypy will enforce that a generic Typevar output is matched by a generic input such that it can infer the type of the output. This reveals that `acquire` would return an unbound typevar. This fixes that by matching it to the type of the ```acquisition_controller ``` Note that the code is typed to accept acquisition_controller being None but that will actually unconditionally raise. ```python if acquisition_controller is None: raise RuntimeError("Cannot call acquire without an " "acquisition_controller") ``` Also add `from __future__ import annotations` to make types cleaner Co-authored-by: Jens H. Nielsen <Jens.Nielsen@microsoft.com> Co-authored-by: Jens Hedegaard Nielsen <jenshnielsen@gmail.com>
- Loading branch information
Showing
1 changed file
with
42 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters