bpo-32296: Implement asyncio.get_event_loop and _get_running_loop in C. by 1st1 · Pull Request #4827 · python/cpython
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure you had a reason for this design but I still cannot figure out why not PyObject* get_running_loop().
The function returns a loop, Py_None if loop not found and NULL on error.
Incref/decref of Py_None is instant and relative rare -- we assume the function is called mostly from coroutines.
The signature looks more native to C Python developer -- almost never API call used pointer for storing result but most of them returns PyObject*.