Skip to content

Update signatures of loads and parse to include return types#108

Merged
dpranke merged 3 commits intodpranke:mainfrom
jonathandung:patch-1
Apr 7, 2026
Merged

Update signatures of loads and parse to include return types#108
dpranke merged 3 commits intodpranke:mainfrom
jonathandung:patch-1

Conversation

@jonathandung
Copy link
Copy Markdown
Contributor

Fixes #107.

@dpranke
Copy link
Copy Markdown
Owner

dpranke commented Apr 5, 2026

Thanks for the fix! I admit I'm a bit surprised that I hadn't already done (or caught this), so it's appreciated.

One thing, though: the package still supports 3.9, so I don't think you can use | to indicate a union type (you can see the failure in this test run . Can you change line 225 to Union[tuple[...], tuple[...]]?

@jonathandung
Copy link
Copy Markdown
Contributor Author

Sure. Done

@dpranke
Copy link
Copy Markdown
Owner

dpranke commented Apr 6, 2026

Argh, sorry, that needs to be typing.Tuple (or just Tuple) instead of tuple, for 3.8. I can change that for you in a separate commit, if you'd prefer?

@jonathandung
Copy link
Copy Markdown
Contributor Author

I'll do it myself

@jonathandung
Copy link
Copy Markdown
Contributor Author

While I'm at it, should I type the helper functions as well? (_convert and such)

@dpranke
Copy link
Copy Markdown
Owner

dpranke commented Apr 6, 2026

Sure, feel free to add types to anything in lib.py that is missing them.

@dpranke dpranke merged commit 4d57adb into dpranke:main Apr 7, 2026
7 checks passed
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.

Annotate load/loads/parse return value as Any

2 participants