8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
bf0394d
23877ec
381f3d3
c2b141e
8b73d0d
7cb3dad
79b6d11
039b14d
c33abbf
d105cac
e7c4bf2
c080089
1b177e3
243e441
a79e36b
7392593
17b453a
baa1009
44d3f47
06330b0
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I have a question about gi_iframe. Below (L31) it is defined as an array of length 1 of object pointers. But everywhere it's used, it is cast to InterpreterFrame *. That's not an object or object pointer AFAICT. So what's going on here? Is the declaration wrong? An intentional lie?
InterpreterFrame *
Sorry, something went wrong.
It is a lie.
We don't want to expose InterpreterFrame in public headers, so we can't do the sensible thing and declare gi_frame as:
InterpreterFrame
gi_frame
InterpreterFrame gi_frame;
as C won't allow incomplete types in structs, even as the last member.
We could improve this by breaking up the header, so the public API sees a different definition. Still a lie, but a more elegant one. Public header:
typedef struct { _PyGenObject_HEAD(gi) } PyGenObject;
Private header:
typedef struct { _PyGenObject_HEAD(gi) InterpreterFrame gi_frame; } PyGenObject;
Probably best done in a different PR, though.
Gotcha. Any type other than PyObject* would be better though :-). And if you replace the casts with a macro it’s easier to fix later. I have an idea for the macro but it’s too painful to type on a phone.
The first field of InterpreterFrame is PyFunctionObject * and the first few fields are all PyObject *, so declaring gi_frame as PyObject * gi_frame[1] seemed safe. Do let me know what your macro is, once you at a PC.
PyFunctionObject *
PyObject *
PyObject * gi_frame[1]
Do let me know what your macro is, once you at a PC.
See https://bugs.python.org/issue40120#msg365465
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.