]> granicus.if.org Git - python/commit
Provide __module__ attributes for functions defined in C and Python.
authorJeremy Hylton <jeremy@alum.mit.edu>
Fri, 31 Jan 2003 18:33:18 +0000 (18:33 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Fri, 31 Jan 2003 18:33:18 +0000 (18:33 +0000)
commit4f0dcc9a9a4629607d4fff79912e8d0c86cd3914
treebba33e033f6a51fec1c01a79a5f6e931f65e44f2
parent8f24cdc0d5e30e2f924ed2e8a71400fa87a70983
Provide __module__ attributes for functions defined in C and Python.

__module__ is the string name of the module the function was defined
in, just like __module__ of classes.  In some cases, particularly for
C functions, the __module__ may be None.

Change PyCFunction_New() from a function to a macro, but keep an
unused copy of the function around so that we don't change the binary
API.

Change pickle's save_global() to use whichmodule() if __module__ is
None, but add the __module__ logic to whichmodule() since it might be
used outside of pickle.
Include/funcobject.h
Include/methodobject.h
Lib/pickle.py
Lib/test/test_funcattrs.py
Objects/funcobject.c
Objects/methodobject.c
Python/exceptions.c
Python/modsupport.c