-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
chore: More modern types #150
Conversation
boa/test/strategies.py
Outdated
@@ -43,7 +43,9 @@ def __repr__(self): | |||
|
|||
|
|||
def _exclude_filter(fn: Callable) -> Callable: | |||
def wrapper(*args: Tuple, exclude: Any = None, **kwargs: int) -> SearchStrategy: | |||
def wrapper( | |||
*args: tuple[Any, ...], exclude: Any = None, **kwargs: int |
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.
i think this can just be *args: tuple, ...
boa/test/strategies.py
Outdated
@@ -62,7 +64,7 @@ def wrapper(*args: Tuple, exclude: Any = None, **kwargs: int) -> SearchStrategy: | |||
|
|||
def _check_numeric_bounds( | |||
type_str: str, min_value: NumberType, max_value: NumberType | |||
) -> Tuple: | |||
) -> tuple[int | float, int | float]: |
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.
i don't think this type signature is even right. it should return some kind of hypothesis strategy.
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.
oops, missed some hidden lines. this seems fine, although i think we can get more specific. either tuple[NumberType, NumberType]
or tuple[int, int]
Get rid of
List
andTuple
. Uselist
andtuple
instead.