I recently discovered pyperf while benchmarking changes for an open-source project, and I want to include performance metrics with my pull request. While using it, I noticed that several functions expose unknown or incomplete types, including seemingly simple parameters. I'm considering contributing improved type annotations and would like to know whether pyperf generally accepts contributions in this area. What would be the best way to propose the work, and which type checkers should I use to verify compatibility? I'm developing on Windows and currently use Pyrefly.
2 Answers
A good first step would be to open an issue describing the typing gaps and ask whether maintainers are interested in adding or improving annotations for the public API. You can also review the project’s existing issue tracker for related tasks and contribution guidelines. If you work on it, check the results with tools such as mypy, ty, and Pyrefly so the changes are broadly compatible.
Improving the typing could be useful, but it may be more involved than it first appears. Python’s type system has edge cases, and no type checker fully agrees on every feature, so some unknown or broad types can be difficult to eliminate completely. Any annotations should be tested with several commonly used checkers rather than only Pyrefly.
That makes sense. My concern is that pyperf sometimes reports unknown types even for straightforward function parameters, so I’d like to investigate whether those cases can be improved. I’ve seen similar, and sometimes worse, typing issues in other libraries where autocomplete barely works.

I can compare the behavior across those type checkers. I’ll start by looking for the project’s contribution instructions and existing issues related to typing before proposing a specific change.