[issue43181] Python macros don’t shield arguments

2021-02-19 Thread Vitaliy
Vitaliy added the comment: Thanks for the fix, it works for my use case. (btw that was #define U(...) __VA_ARGS__ and not what I wrote). > I don't think that PR 24533 should be backported to Python 3.8 and Python > 3.9. I prefer to avoid any risk of regression, and so only ch

[issue43181] Python macros don’t shield arguments

2021-02-09 Thread Vitaliy
New submission from Vitaliy : There is a lot of macros like: #define PyObject_TypeCheck(ob, tp) \ (Py_IS_TYPE(ob, tp) || PyType_IsSubtype(Py_TYPE(ob), (tp))) These work fine until an argument happen to contain a comma. That’s possible as a result of other macro’s expansion. E.g. if U(x