Skip to content

Commit 9d7777b

Browse files
authored
Merge pull request #212 from honno/fix-composite-return-hint
Fix type hints of `@st.composite` strategies
2 parents c074b81 + 6a6f4cf commit 9d7777b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

array_api_tests/hypothesis_helpers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class OnewayPromotableDtypes(NamedTuple):
109109
@composite
110110
def oneway_promotable_dtypes(
111111
draw, dtypes: Sequence[DataType]
112-
) -> SearchStrategy[OnewayPromotableDtypes]:
112+
) -> OnewayPromotableDtypes:
113113
"""Return a strategy for input dtypes that promote to result dtypes."""
114114
d1, d2 = draw(mutually_promotable_dtypes(dtypes=dtypes))
115115
result_dtype = dh.result_type(d1, d2)
@@ -127,7 +127,7 @@ class OnewayBroadcastableShapes(NamedTuple):
127127

128128

129129
@composite
130-
def oneway_broadcastable_shapes(draw) -> SearchStrategy[OnewayBroadcastableShapes]:
130+
def oneway_broadcastable_shapes(draw) -> OnewayBroadcastableShapes:
131131
"""Return a strategy for input shapes that broadcast to result shapes."""
132132
result_shape = draw(shapes(min_side=1))
133133
input_shape = draw(

array_api_tests/test_creation_functions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ def test_eye(n_rows, n_cols, kw):
377377

378378

379379
@st.composite
380-
def full_fill_values(draw) -> st.SearchStrategy[Union[bool, int, float, complex]]:
380+
def full_fill_values(draw) -> Union[bool, int, float, complex]:
381381
kw = draw(
382382
st.shared(hh.kwargs(dtype=st.none() | xps.scalar_dtypes()), key="full_kw")
383383
)

0 commit comments

Comments
 (0)