Xiang Zhang added the comment: > The cleanest way to refactor and fix this that comes to mind would be to make > static _get_object_name() and _add_methods_to_object() functions in > moduleobject.c (which omit any strict type checks), and then call those from > PyModule_GetNameObject and PyModule_AddFunctions with the explicit typecheck.
That's one solution. How about loosing PyModule_GetNameObject's constraint? Let it accept non-ModuleType objects? Actually without the constraint of PyModule_GetNameObject, PyModule_AddFunctions can handle non-ModuleType objects. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27782> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com