rdflib
rdflib copied to clipboard
Term improvements
Summary of changes
Rebase of #3169 against 7-maintenance.
All these changes should have no impact at runtime, they're purely to improve UX through static analysis.
- Convert
Termto a typedNamedTuplefrom anamedtuple. This makes static analysis easier in that your IDE and type checker can understand which fields are present on the type, the type of each field, and give each field its own documentation - Document the meaning of each field in
Termfor usability - Move the type definition of
Contextfields into the class body. This is also for static analysis and allows the user to get tab completion etc when using these fields.
My long term goal is to make this context API usage as a public API, so that I can generate and interact with contexts programmatically instead of just by defining these in JSON.
Checklist
- [x] Checked that there aren't other open pull requests for the same change.
- [x] Checked that all tests and type checking passes.
- [x] Considered granting push permissions to the PR branch, so maintainers can fix minor issues and keep your PR up to date.
Check the deploy log for errors here: https://app.netlify.com/sites/fundamental-react/deploys
| Name | Link |
|---|---|
| Latest commit | 581ee2c43a51e3bd278c24ed703c7d3f95044a03 |
| Latest deploy log | https://app.netlify.com/projects/fundamental-react/deploys/691cbf13cb447b00082b1387 |