Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type hints to strategies.py #4259

Merged
merged 6 commits into from
Feb 3, 2025
Merged

Add type hints to strategies.py #4259

merged 6 commits into from
Feb 3, 2025

Conversation

tybug
Copy link
Member

@tybug tybug commented Feb 1, 2025

No description provided.

hypothesis-python/src/hypothesis/stateful.py Show resolved Hide resolved
Comment on lines +270 to +272
@property
def has_reusable_values(self) -> Any:
return recursive_property(self, "has_reusable_values", True)
Copy link
Member Author

@tybug tybug Feb 1, 2025

Choose a reason for hiding this comment

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

using explicit @property for mypyc, but I think it's also cleaner

Comment on lines +190 to +204
count = 0
seen = set()
while needs_update:
count += 1
# If we seem to be taking a really long time to stabilize we
# start tracking seen values to attempt to detect an infinite
# loop. This should be impossible, and most code will never
# hit the count, but having an assertion for it means that
# testing is easier to debug and we don't just have a hung
# test.
# Note: This is actually covered, by test_very_deep_deferral
# in tests/cover/test_deferred_strategies.py. Unfortunately it
# runs into a coverage bug. See
# https://github.com/nedbat/coveragepy/issues/605
# for details.
Copy link
Member

Choose a reason for hiding this comment

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

A check for an impossible case, which nonetheless has a test, except also a nocover pragma, due to an intractable upstream bug? Classic Hypothesis experience, nothing to see here...

@tybug
Copy link
Member Author

tybug commented Feb 2, 2025

I've tacked a bugfix on to this pull and fixed CI errors 👍

@Zac-HD Zac-HD closed this Feb 3, 2025
@Zac-HD Zac-HD reopened this Feb 3, 2025
hypothesis-python/RELEASE.rst Outdated Show resolved Hide resolved
@tybug tybug enabled auto-merge February 3, 2025 05:13
@tybug tybug merged commit dfd0fc3 into HypothesisWorks:master Feb 3, 2025
50 checks passed
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