-
Notifications
You must be signed in to change notification settings - Fork 578
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
Improve handling of self-referential strategies #2794
Comments
As an API design principle, any strategy should be acceptable wherever a strategy is needed - so I'd much rather make this work than specifically disallow some strategies. That wouldn't technically be a breaking change since it's never worked before, but IMO it should have worked. Fortunately I think it should be reasonably easy to make the capping logic work for self-referential strategies; just remove the assertion and ensure we only un-set the cap if it was added by this draw (not an outer draw). Plus some tests to make me confident that I'm right 😅 |
As mentioned in #2783, the following strategy is not explicitly forbidden but fails with an
AssertionError
:There is an alternative strategy that produces the same data, but doesn't fail the same way:
I am not sure if all self-referential strategies can be rewritten like this, but probably we can either explicitly forbid such strategies or revisit our drawing approach for them.
Here is my reasoning from #2783
The text was updated successfully, but these errors were encountered: