Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Nov 16, 2019

PyInterpreterState.eval_frame (PEP 523) now requires a new mandatory
tstate parameter (PyThreadState*).

https://bugs.python.org/issue38818

PyInterpreterState.eval_frame (PEP 523) now requires a new mandatory tstate parameter (PyThreadState*).
@vstinner
Copy link
Member Author

This change is backward incompatible and changes the PEP 523. I would prefer to have it carefully reviewed ;-)

@shihai1991
Copy link
Member

This change is backward incompatible and changes the PEP 523. I would prefer to have it carefully reviewed ;-)

In order to keep backward compatibility, can we use a new function to do this action?

@vstinner
Copy link
Member Author

In order to keep backward compatibility, can we use a new function to do this action?

PyInterpreterState.eval_frame is a structure field. What do you mean?

Copy link
Member

@corona10 corona10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shihai1991

It can happen from the contributors who are not familiar with the codebase.
@shihai1991 I think that the snippet I attach links below will help your future contribution.

typedef struct _is PyInterpreterState;

_PyFrameEvalFunction eval_frame;

@vstinner
Looks good to me.

@shihai1991
Copy link
Member

In order to keep backward compatibility, can we use a new function to do this action?

PyInterpreterState.eval_frame is a structure field. What do you mean?

Sorry, i didn't express cleary. I just worried about whether we have external user use _PyEval_EvalFrameDefault(struct _frame *f, int exc)(although it's a inner function).

@vstinner
Copy link
Member Author

frame_eval is specified by https://www.python.org/dev/peps/pep-0523/

The question if it should be public or not is discussed at https://bugs.python.org/issue38500

At least, the API (frame_eval) is used by PyCharm to implement their debugger ;-)

@brettcannon
Copy link
Member

brettcannon commented Nov 18, 2019

I don't think this should go in until bpo-38500 is resolved.

@vstinner
Copy link
Member Author

I included this change into PR #17340. I close this PR.

@vstinner vstinner closed this Mar 10, 2020
@vstinner vstinner deleted the eval_frame_tstate branch March 10, 2020 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

6 participants