bpo-42800: add audit hooks for f_code and tb_frame by lunixbochs · Pull Request #24182 · python/cpython

I tried that, and IMO it makes the audit event table look worse due to the way it only references these docs via unlabeled footnotes in the object.__getattr__ section, and it scrambles the order of the footnotes so the first object.__getattr__ footnote no longer points at object, it points at one of the specific attributes.

My longer reasoning is here: https://bugs.python.org/msg384749

I think a better answer would be for someone who understands the sphinx table generator to add a directive that inserts labeled cross-references for each attribute below the object.__getattr__ row.

Right now when you add cross-references for all of the attributes the table row looks something like this:

object.__getattr__ | description | [1] [2] [3] [4] [5]

But would be actually useful with a structure like this that actually labels the references:

event description references
object.__getattr__ description [1]
attr traceback.tb_frame description [1]
attr code.f_code description [1]