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

err: tweak names, inlining and docs #2026

Merged
merged 1 commit into from
Nov 27, 2021

Conversation

davidhewitt
Copy link
Member

@davidhewitt davidhewitt commented Nov 25, 2021

This PR cleans up a bunch of naming on the PyErr type:

  • make get_type, value and traceback as per Better names for PyErr::ptype, PyErr::pvalue and PyErr::ptraceback #1987
  • replace all mentions of "instance" with "value" for consistency (into_instance -> into_value and from_instance -> from_value).
  • improve docs on these methods a little
  • add #[inline] in a couple of places where it looked like it made sense. According to bench_err this has made a slight improvement.

PyErr::into_instance (now PyErr::into_value) actually had a memory leak in it, which is now also fixed.

Closes #1987

@davidhewitt davidhewitt force-pushed the err-method-names branch 2 times, most recently from 0985dfb to 3c5046a Compare November 25, 2021 22:56
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.

Better names for PyErr::ptype, PyErr::pvalue and PyErr::ptraceback
2 participants