[issue41167] Add new formats to PyArg_ParseTuple for "str or None"

2020-06-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it is more common to use the general "O" format. In any case you need to write separate code for None and str in the body of function. -- nosy: +serhiy.storchaka ___ Python tracker

[issue41167] Add new formats to PyArg_ParseTuple for "str or None"

2020-06-30 Thread Inada Naoki
New submission from Inada Naoki : PyArg_ParseTuple has 'U' format for getting Unicode as PyObject*. But when user want accept "str or None", they are forced to use 'O&' and write a custom converter. It is not convenient. I am proposing to add 'U?' for "str or None" variants of 'U'. Does it mak