◐ Shell
clean mode source ↗

gh-111178: Fix function signatures in codeobject.c by vstinner · Pull Request #125180 · python/cpython

Choose a reason for hiding this comment

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

I don't really like macros like this.
While they may save a few lines of code, they add cognitive load.

If I see PyCodeObject *co = _PyCode_CAST(self); I can guess what it does, but I don't know unless I look up the macro.

But, if I see

     assert(PyCode_Check(self));
     co = (PyCodeObject *)self;

I know what it does immediately.