HypothesisWorks / HypothesisWorks/hypothesis
Rename some internals for clarity
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 9k
- Forks
- 675
- Avg merge
- 4d 5h
- Merged PRs (30d)
- 8
Description
Naming things is famously, uh, less easy than we might hope. This issue tracks two renames I'd like to do at some point:
-
Rename the
conjecture.data.Exampleclass toSpan, as suggested in #4164. The word "example" is pretty badly overloaded in our codebase, and so using a short and distinct word should help - I think it's also more indicative of what this subsystem does. We'll wait for the IR changes to settle down first though. -
Rename the "primary" and "secondary" database keys to indicate that they store minimal and non-minimal failing examples respectively. This has caused confusion before, see e.g. #4155, and should smooth out interoperability with e.g. HypoFuzz. I'm inclined to come up with canonical names + keys for covering examples (including un/shrunk, and location-vs-set-of-locations), and likely provide a helper function to compute said keys.
-
ChoiceNode.kwargstoChoiceNode.constraints, and see if we can find more-specific names for "kwargs" anywhere else -
Consider renaming the
labelargument inDataStrategy.draw, which has different meaning than the similarly named argument inConjectureData.draw. Or rename the latter, which is more inconvenient but avoids public API change. (There's also.calc_label(), which relates to theConjectureDatasemantics (?))
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with hypothesis-python/src/hypothesis/internal/conjecture/data.py and inspect the remaining references to the database keys, DataStrategy.draw, ConjectureData.draw, and calc_label(). Done means the unchecked naming decisions are resolved and affected symbols and references use consistent names.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100