Better method to ensure __module__ is set consistently.
PyFunction_New() and type_new() both simply lookup the __name__ of the global scope in which a function or class is defined in order to determine its __module__. So we can do a better job of ensuring __module__ is set correctly by simply overriding __name__ before defining any functions or classes. Works identically in Python 3.pull/35/head
parent
9cd9f1fec2
commit
961a9549bd
Loading…
Reference in New Issue