[Python-checkins] CVS: python/dist/src/Objects funcobject.c,2.37.4.10,2.37.4.11

Guido van Rossum gvanrossum@users.sourceforge.net
2001年7月13日 14:02:08 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv9773
Modified Files:
 Tag: descr-branch
	funcobject.c 
Log Message:
func_descr_get(): When obj is None, replace it with NULL, so this
returns an unbound method, not something bound to None!
(Note: I wonder if there should be two separate types, bound method
and unbound method, rather than the single method type that we have
now that can deal with both. Also, it should be defined here rather
than in classobject.c, since it is no longer specific to classic
classes.)
Index: funcobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/funcobject.c,v
retrieving revision 2.37.4.10
retrieving revision 2.37.4.11
diff -C2 -r2.37.4.10 -r2.37.4.11
*** funcobject.c	2001年07月04日 00:13:58	2.37.4.10
--- funcobject.c	2001年07月13日 21:02:06	2.37.4.11
***************
*** 333,336 ****
--- 333,338 ----
 func_descr_get(PyObject *func, PyObject *obj, PyObject *type)
 {
+ 	if (obj == Py_None)
+ 		obj = NULL;
 	return PyMethod_New(func, obj, type);
 }

AltStyle によって変換されたページ (->オリジナル) /