Skip to content

Conversation

@jorenham
Copy link
Contributor

For some reason this is causing stubtest to crash when running it on the numpy codebase while hypothesis is installed. I'm not saying this is your fault or anything, and I'll report this issue at mypy later today, But even so, there are some other reasons for removing these decorators, so I figured I might as well clean it up.
Decorating a function has a (slight) inpact on import time, so by removing these redundant decorators, importing this module will be slightly faster.
There are also some other obvious reasons, such as readability, maintainability, seeing as it's more "DRY" this way.

@jorenham
Copy link
Contributor Author

Oh woops, vscode seems to have messed up the formatting; sorry about that.

@Liam-DeVoe
Copy link
Member

(./build.sh format to make it CI-compliant; we should document that in the CI job error message so it's easy for new contributors)

@jorenham jorenham force-pushed the @overload-decorators branch from 5a0eef2 to 3162024 Compare October 14, 2025 14:53
@jorenham
Copy link
Contributor Author

Does this require a release note?

@Liam-DeVoe
Copy link
Member

Liam-DeVoe commented Oct 14, 2025

yeah, since we cut a release on every merged PR*. You can put something as simple as "clean up internal @overload type annotations"

*with source code changes

@Liam-DeVoe
Copy link
Member

Thanks Joren, this looks great! I'll be curious to follow along on the mypy issue for the root cause, though it's not too surprising they assumed users wouldn't apply weird transformations on top of @overload 😄

I think CI is still a bit flaky, it's not your fault.

@Liam-DeVoe
Copy link
Member

Liam-DeVoe commented Oct 14, 2025

re: https://github.com/HypothesisWorks/hypothesis/actions/runs/18502481240/job/52723140081?pr=4564

ForwardRef.__forward_value__ was removed in 3.14: python/cpython#129465.

Not sure why it only errors on our free-threading CI job. I'll fix this soon

Copy link
Member

@Liam-DeVoe Liam-DeVoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm I think fixing that will be nontrivial. I'll open an issue and get to it later. Thanks again!

@Liam-DeVoe Liam-DeVoe merged commit f2f87c1 into HypothesisWorks:master Oct 14, 2025
80 of 81 checks passed
@jorenham
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants