Skip to content

Commit 62198d3

Browse files
committed
[atheris] Accept any callback result and ints for float ranges
The test_one_input callback is held as std::function<void(py::bytes)>, so its result is discarded: object rather than None. The ConsumeFloat*InRange bounds are doubles, which pybind11 converts from int: float | int.
1 parent ba6b8cd commit 62198d3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎stubs/atheris/atheris/native.pyi‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ALL_REMAINING: Final[int] # undocumented
77

88
def Setup(
99
args: Sequence[str],
10-
test_one_input: Callable[[bytes], None],
10+
test_one_input: Callable[[bytes], object],
1111
/,
1212
**kwargs: bool | Callable[[bytes, int, int], str | bytes] | Callable[[bytes, bytes, int, int], str | bytes] | None,
1313
) -> list[str]: ...
@@ -28,11 +28,11 @@ class FuzzedDataProvider:
2828
def ConsumeFloat(self) -> float: ...
2929
def ConsumeRegularFloat(self) -> float: ...
3030
def ConsumeProbability(self) -> float: ...
31-
def ConsumeFloatInRange(self, min: float, max: float, /) -> float: ...
31+
def ConsumeFloatInRange(self, min: float | int, max: float | int, /) -> float: ...
3232
def ConsumeFloatList(self, count: int, /) -> list[float]: ...
3333
def ConsumeRegularFloatList(self, count: int, /) -> list[float]: ...
3434
def ConsumeProbabilityList(self, count: int, /) -> list[float]: ...
35-
def ConsumeFloatListInRange(self, count: int, min: float, max: float, /) -> list[float]: ...
35+
def ConsumeFloatListInRange(self, count: int, min: float | int, max: float | int, /) -> list[float]: ...
3636
def PickValueInList(self, values: list[_T], /) -> _T: ...
3737
def ConsumeBool(self) -> bool: ...
3838
def remaining_bytes(self) -> int: ... # undocumented

0 commit comments

Comments
 (0)