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 documentation about type hints #1751

Merged
merged 4 commits into from Mar 15, 2022

Conversation

aucampia
Copy link
Member

This explains why type hints matter, how they are being added, what are
considered correct type hints and what changes can occur to type hints.

Any suggestions/changes/recommendations welcome.

@aucampia aucampia force-pushed the iwana-20220227T2010-doc_type_hints branch 2 times, most recently from 8ab6132 to e6372dc Compare February 27, 2022 23:02
@aucampia
Copy link
Member Author

@ajnelson-nist please have a look when you have time and see if there is anything more that should be addressed or if something is unclear.

@ajnelson-nist
Copy link
Contributor

RDFLib more or less adheres to semver 2.0, and for type hints we aim to do the same. This being said, we will not consider corrections to type hints as changes in interface. Corrections to type hints will be considered bug fixes and thus will only necessitate a change in patch version under semver 2.0.

I'm squinting a bit at this passage, in light of gradual typing noted two sections back.

A correction to a type hint, I agree, would be a bug fix. There might be some new type review errors induced for downstream consumers, e.g. those who use mypy --strict. I would personally be fine with this.

Does the documentation need to clarify that the addition of type signatures would be reserved for SEMVER minor releases? These are more likely to induce significant downstream work, because the removal of a # type: ignore can reveal surprising behaviors in existing code that had previously stepped around an unimplemented type signature.

That's my only concern with the documentation as written. Thank you kindly for asking me.

@aucampia aucampia force-pushed the iwana-20220227T2010-doc_type_hints branch from e6372dc to 9b3be45 Compare March 2, 2022 22:14
@aucampia
Copy link
Member Author

aucampia commented Mar 2, 2022

@ajnelson-nist thanks for the feedback, rewrote the last section and added one before it ("Public Type Aliases"), I think this should address your concerns, but let me know what you think if you have a moment to check it.

This explains why type hints matter, how they are being added, what are
considered correct type hints and what changes can occur to type hints.
@aucampia aucampia force-pushed the iwana-20220227T2010-doc_type_hints branch from 9b3be45 to 54cabef Compare March 2, 2022 22:24
docs/type_hints.rst Outdated Show resolved Hide resolved
docs/type_hints.rst Outdated Show resolved Hide resolved
docs/type_hints.rst Outdated Show resolved Hide resolved
docs/type_hints.rst Outdated Show resolved Hide resolved
docs/type_hints.rst Outdated Show resolved Hide resolved
@ajnelson-nist
Copy link
Contributor

@aucampia , please feel free to resolve or reply to my review threads.

@aucampia
Copy link
Member Author

aucampia commented Mar 3, 2022

@aucampia , please feel free to resolve or reply to my review threads.

Thanks for the review and the good suggestions @ajnelson-nist

@nicholascar nicholascar self-requested a review March 13, 2022 01:53
@aucampia aucampia merged commit 961ca4e into RDFLib:master Mar 15, 2022
@aucampia aucampia deleted the iwana-20220227T2010-doc_type_hints branch April 9, 2022 14:12
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.

None yet

3 participants