Repository navigation
[atheris] Add FuzzedDataProvider and re-export the public API from atheris - #16610
Merged
Merged
Conversation
Add `atheris/native.pyi` (where `FuzzedDataProvider`, `Setup`, `Fuzz`, `Mutate` and `ALL_REMAINING` live at runtime) and re-export the public names from `atheris/__init__.pyi`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
srittau
requested changes
Nov 18, 2026
srittau
left a comment
Collaborator
There was a problem hiding this comment.
One nit below.
Also, per our new policy, please use float | int in argument types where both types are accepted/possible. (The same for return types, where both are potentially returned, but that has always been the case.)
|
|
||
| def Setup( | ||
| args: Sequence[str], | ||
| test_one_input: Callable[[bytes], None], |
Collaborator
There was a problem hiding this comment.
I know this is copied from before, but I assume the return type of test_one_input calls is just ignored? In this case object is preferred over None.
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.
Contributor
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
srittau
approved these changes
Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
atheris.FuzzedDataProviderwas missing, andatheris.instrument_imports/instrument_func/instrument_all/enabled_hookswere not re-exported fromatheris/__init__.pyi, so all ofthem were reported as missing attributes (cf. google/atheris#110).
This adds
atheris/native.pyi(whereFuzzedDataProvider,Setup,Fuzz,MutateandALL_REMAININGlive at runtime) and re-exports the public names fromatheris.Notes:
and the C++ declarations; unnamed pybind11 arguments are positional-only (
ConsumeUnicodeisthe only one bound with
py::arg("count")).PickValueInListtakeslist[_T]: the binding ispy::list, and tuples are rejected at runtime.Setup/Mutatebecome positional-only, matching the runtime (keyword calls raiseTypeError).FuzzedDataProviderispybind11_builtins.pybind11_type; allowlisted as forhnswlib.Index.Upstream: bindings,
declarations,
docs.
Prepared with Claude Code (Claude Opus 5.5).
🤖 Generated with Claude Code