-
Notifications
You must be signed in to change notification settings - Fork 794
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
Better names for PyErr::ptype
, PyErr::pvalue
and PyErr::ptraceback
#1987
Comments
|
I mean while technically possible, I don't think I want that 😅 |
Maybe |
Some people resort to |
Yes, I used |
|
Yes I think I'm quite happy with Maybe |
I personally like traceback(py) and value(py) more than using get_. I think having to pass Python as an arg already makes clear it's a getter and that it's more than just reading from a struct. While the inconsistency is a little weird, I don't think it's the end of the world. And not every call site will use all 3 (I think pants only needed traceback) |
If we're going for familiarity to Python programmers, this is (I think) the only thing that emits a helpful compiler error when |
True, but we already have |
I keep thinking I'd like to give nicer names for
PyErr::ptype
,PyErr::pvalue
, andPyErr::ptraceback
.As far as I'm aware the "p" prefix is a hangover from C hungarian notation; it feels very out of place here as we're not even returning raw pointers from these methods.
I would love to have just
.type
,.value
and.traceback
buttype
is a reserved keyword.Could potentially be
.get_type
,.value
, and.traceback
(inspired byPyAny::get_type
which is presumably trying to solve the same problem). Orget_
prefix for all three, but that feels slightly more verbose than it needs to be.Any ideas welcome.
The text was updated successfully, but these errors were encountered: