This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Mark.Shannon, silverjubleegaming, vstinner
Date 2022-01-12.17:02:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> I don't know how we can stop people from using them though.

The first option is to promote helper functions to abstract access to the PyFrameObject structure.

The second option is to make the whole structure opaque and enforce the usage of helper functions. Before being able to do that, we need to prepare Cython and a few more popular C extensions for that. Right now, Cython still has a lot of code accessing directly PyFrameObject members.

Well, we can discuss that in bpo-40421 ;-)

> If they don't know better than pulling data out of undocumented internal struct, then I'm not sure an underscore prefix is going to help. It won't do any harm, though.

I propose to rename f_back to trigger a build error for existing C extensions which access it directly. So developers have to decide how to handle the change: access the renamed member, or read the doc and use a better way, call PyFrame_GetBack() :-)

I dislike that this incompatible change is "silent" and that developers may only notice the change in production, when it's too late.

Or maybe most C extensions have a a good test suite and will notice the change before it's too late.
Date User Action Args
2022-01-12 17:02:21vstinnersetrecipients: + vstinner, Mark.Shannon, silverjubleegaming
2022-01-12 17:02:21vstinnersetmessageid: <>
2022-01-12 17:02:21vstinnerlinkissue46356 messages
2022-01-12 17:02:21vstinnercreate