[Python-checkins] python/dist/src/Lib/test test_funcattrs.py,1.12,1.13
jhylton@users.sourceforge.net
jhylton@users.sourceforge.net
2003年1月31日 10:33:19 -0800
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv18557/Lib/test
Modified Files:
test_funcattrs.py
Log Message:
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.
Index: test_funcattrs.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_funcattrs.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** test_funcattrs.py 30 Jul 2002 23:26:01 -0000 1.12
--- test_funcattrs.py 31 Jan 2003 18:33:17 -0000 1.13
***************
*** 10,13 ****
--- 10,17 ----
pass
+ # __module__ is a special attribute
+ verify(b.__module__ == __name__)
+ verify(verify.__module__ == "test.test_support")
+
# setting attributes on functions
try: