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

Improve type hint #1226

Merged
merged 4 commits into from
Jun 21, 2023
Merged

Improve type hint #1226

merged 4 commits into from
Jun 21, 2023

Conversation

pamelafox
Copy link
Contributor

Thanks to a new test in main, I discovered that the return type of get_or_404 should not be Optional. I had chosen Optional since it can raise exceptions, but I've now learnt that Python typing does not document exception raising.

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • Add or update relevant docs, in the docs folder and in code.
  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • Add .. versionchanged:: entries in any relevant code docs.
  • Run pre-commit hooks and fix any issues.
  • Run pytest and tox, no tests failed.

@pamelafox pamelafox added this to the 3.0.5 milestone Jun 20, 2023
@pamelafox
Copy link
Contributor Author

@tonybaloney Can you review, since you reviewed the last one? One liner!

@tonybaloney
Copy link

LGTM 👍🏻 (I can't give an official approval on this repo)

@davidism
Copy link
Member

@tonybaloney thanks for reviewing PRs! I sent you an invite so you can add official reviews 👍

@pamelafox pamelafox merged commit 72cbae3 into 3.0.x Jun 21, 2023
@pamelafox pamelafox deleted the better-type branch June 21, 2023 16:16
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants