When working on bringing protpardelle into SW, I ran into the following type of listing error:
UP047 Generic function `require_boltz` should use type parameters
--> src/sampleworks/utils/imports.py:57:5
|
56 | @overload
57 | def require_boltz(message: F) -> F: ...
| ^^^^^^^^^^^^^^^^^^^^^^^^^
58 | @overload
59 | def require_boltz(message: str | None = None) -> Callable[[F], F]: ...
|
help: Use type parameters
F in this case is a TypeVar: F = TypeVar("F", bound=Callable[..., Any]). The newer way to do this is, I think:
def require_boltz[F: Callable[..., Any]](message: F) -> F
There are 11 such errors in imports.py, and presumably we can use this elsewhere as well. We should check that it is actually compatible with our version of Python.
For now I've just added # ruff: noqa: UP047 to that file.
When working on bringing protpardelle into SW, I ran into the following type of listing error:
F in this case is a
TypeVar:F = TypeVar("F", bound=Callable[..., Any]). The newer way to do this is, I think:There are 11 such errors in imports.py, and presumably we can use this elsewhere as well. We should check that it is actually compatible with our version of Python.
For now I've just added
# ruff: noqa: UP047to that file.