Skip to content

Commit 7cb9389

Browse files
committed
lint and flatmap
1 parent 5b112b7 commit 7cb9389

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

hypothesis-python/src/hypothesis/strategies/_internal/core.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383
from hypothesis.internal.conjecture.data import ConjectureData
8484
from hypothesis.internal.conjecture.utils import (
8585
calc_label_from_callable,
86-
calc_label_from_cls,
8786
calc_label_from_hash,
8887
check_sample,
8988
combine_labels,
@@ -1061,7 +1060,7 @@ def calc_label(self) -> int:
10611060
self.class_label,
10621061
calc_label_from_callable(self.target),
10631062
*[strat.label for strat in self.args],
1064-
*[calc_label_from_hash(k) for k in self.kwargs.keys()],
1063+
*[calc_label_from_hash(k) for k in self.kwargs],
10651064
*[strat.label for strat in self.kwargs.values()],
10661065
)
10671066

hypothesis-python/src/hypothesis/strategies/_internal/flatmapped.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from typing import Callable, Generic, TypeVar
1212

1313
from hypothesis.internal.conjecture.data import ConjectureData
14+
from hypothesis.internal.conjecture.utils import calc_label_from_callable, combine_labels
1415
from hypothesis.internal.reflection import get_pretty_function_description
1516
from hypothesis.strategies._internal.strategies import (
1617
RecurT,
@@ -35,6 +36,13 @@ def __init__(
3536
def calc_is_empty(self, recur: RecurT) -> bool:
3637
return recur(self.base)
3738

39+
def calc_label(self) -> int:
40+
return combine_labels(
41+
self.class_label,
42+
self.base.label,
43+
calc_label_from_callable(self.expand),
44+
)
45+
3846
def __repr__(self) -> str:
3947
if not hasattr(self, "_cached_repr"):
4048
self._cached_repr = (

hypothesis-python/src/hypothesis/strategies/_internal/numbers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
from hypothesis.control import reject
1717
from hypothesis.errors import InvalidArgument
18-
from hypothesis.internal.conjecture.utils import calc_label_from_hash, combine_labels
1918
from hypothesis.internal.conjecture.data import ConjectureData
19+
from hypothesis.internal.conjecture.utils import calc_label_from_hash, combine_labels
2020
from hypothesis.internal.filtering import (
2121
get_float_predicate_bounds,
2222
get_integer_predicate_bounds,

0 commit comments

Comments
 (0)