-
Notifications
You must be signed in to change notification settings - Fork 576
Term improvements #3201
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
base: 7.x
Are you sure you want to change the base?
Term improvements #3201
Conversation
Co-authored-by: Daan de Schepper <d.de.schepper@rijksmuseum.nl>
* test: fix failing webtest Fixes RDFLib#3192 * Revert "remove old hacks against 2to3 (RDFLib#3076)" (RDFLib#3195) This reverts commit b74c657.
* Specify `Optional` parameters in `Graph.triples_choices` The two non-list parameters can be `None`, but this is not reflected in the type hint. Also introduces a type alias to simplify method signatures. * style: remove unused imports --------- Co-authored-by: Nicholas Car <nick@kurrawong.net> Co-authored-by: Edmond Chuc <37032744+edmondchuc@users.noreply.github.com> Co-authored-by: Edmond Chuc <edmond@kurrawong.ai>
pre-commit.ci run |
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
…b#3197) * feat: canonicalization with longturtle serializer now optional Fixes RDFLib#3196 * docs: fix docs build error by removing py obj reference to canon
Thanks for rebasing this @multimeric. I think the tests are currently failing due to some dependency bumps in the lockfile. Any chance we can roll those back? |
Done |
Great, thanks for following up and making those changes. The CI is now showig a few mypy/type errors. Would you mind having a look and seeing if you can address those as well? |
Just an FYI, I'm targeting the |
Thanks. The type errors are a bit annoying because it's making me fix everything in the JSON-LD parser, including things that I didn't change. I'll try to do so but it might not be soon. |
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.
Term
to a typedNamedTuple
from 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 documentationTerm
for usabilityContext
fields 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
the same change.
so maintainers can fix minor issues and keep your PR up to date.