[Python-checkins] CVS: python/dist/src/Python ceval.c,2.241.2.3,2.241.2.4

Guido van Rossum gvanrossum@users.sourceforge.net
2001年6月28日 13:32:46 -0700


Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv27097
Modified Files:
 Tag: descr-branch
	ceval.c 
Log Message:
Fix a surprise that botched a demo: overriding __getitem__ in a
subclass of list didn't work. Turns out the inlining version in the
bytecode interpreter was triggered for subclasses of list... That's
what I get for redefining PyList_Check()! :-(
Index: ceval.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v
retrieving revision 2.241.2.3
retrieving revision 2.241.2.4
diff -C2 -r2.241.2.3 -r2.241.2.4
*** ceval.c	2001年06月05日 12:48:11	2.241.2.3
--- ceval.c	2001年06月28日 20:32:44	2.241.2.4
***************
*** 1010,1014 ****
 			w = POP();
 			v = POP();
! 			if (PyList_Check(v) && PyInt_Check(w)) {
 				/* INLINE: list[int] */
 				long i = PyInt_AsLong(w);
--- 1010,1014 ----
 			w = POP();
 			v = POP();
! 			if (v->ob_type == &PyList_Type && PyInt_Check(w)) {
 				/* INLINE: list[int] */
 				long i = PyInt_AsLong(w);

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