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 kj
Recipients Mark.Shannon, kj, vstinner
Date 2022-03-30.13:52:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> tiny inline function obscures the meaning of code

Sadly I have to agree with Mark for that specific case. I've had to debug a segfault before only because the inline function implicitly cast its arguments, and it was accessing a non-existent member. If it were a macro it would access the struct member directly, and the compiler would be able to catch that and warn me before runtime.

However, for the case of _PyCFunctionObject_CAST, I'm not against it. The assert(PyCFunction_Check) pattern has genuinely helped me catch problems in the case of similar macros.
Date User Action Args
2022-03-30 13:52:27kjsetrecipients: + kj, vstinner, Mark.Shannon
2022-03-30 13:52:27kjsetmessageid: <>
2022-03-30 13:52:27kjlinkissue47164 messages
2022-03-30 13:52:27kjcreate