Skip to content

Add type hinting support for the biothings-client#45

Merged
newgene merged 12 commits intomasterfrom
type_hints
Mar 26, 2026
Merged

Add type hinting support for the biothings-client#45
newgene merged 12 commits intomasterfrom
type_hints

Conversation

@ctrl-schaff
Copy link
Copy Markdown
Contributor

No description provided.

newgene and others added 7 commits March 12, 2026 15:43
This is a very small difference, given TypedDict is viewed
as a Dict at runtime. TypedDict is has contraints on what the types
of the keys are for the dictionary, but given the way we're using
it is deprecated in python 3.13 and will be removed by python 3.15,
I think it's better to be more generic in what we assert is in the
dictionary for backwards compatibility

https://docs.python.org/3/library/typing.html#typing.TypedDict
https://typing.python.org/en/latest/spec/typeddict.html#
typing.Literal only got added in python 3.8, so we
using this extension for python 3.7
@ctrl-schaff
Copy link
Copy Markdown
Contributor Author

@newgene I've added the py.typed file to the package. From my testing it appears to be automatically picked up in the package upon pip install. I've also conditionally gated the packages by python version for the type backporting

@newgene newgene merged commit 188924a into master Mar 26, 2026
20 of 21 checks passed
@newgene newgene deleted the type_hints branch March 26, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants