[Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.88,2.89

Guido van Rossum gvanrossum@users.sourceforge.net
Thu, 04 Oct 2001 12:46:08 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv13410/Objects

Modified Files:
	typeobject.c 
Log Message:
Make new classes dynamic by default.

Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.88
retrieving revision 2.89
diff -C2 -d -r2.88 -r2.89
*** typeobject.c	2001/10/04 05:43:02	2.88
--- typeobject.c	2001/10/04 19:46:06	2.89
***************
*** 760,766 ****
  	   2) in the module dict (globals)
  	   The first variable that is an int >= 0 is used.
! 	   Otherwise, a default is calculated from the base classes:
! 	   if any base class is dynamic, this class is dynamic; otherwise
! 	   it is static. */
  	dynamic = -1; /* Not yet determined */
  	/* Look in the class */
--- 760,764 ----
  	   2) in the module dict (globals)
  	   The first variable that is an int >= 0 is used.
! 	   Otherwise, the default is dynamic. */
  	dynamic = -1; /* Not yet determined */
  	/* Look in the class */
***************
*** 784,800 ****
  	}
  	if (dynamic < 0) {
! 		/* Make a new class dynamic if any of its bases is
! 		   dynamic.  This is not always the same as inheriting
! 		   the __dynamic__ class attribute! */
! 		dynamic = 0;
! 		for (i = 0; i < nbases; i++) {
! 			tmptype = (PyTypeObject *)
! 				PyTuple_GET_ITEM(bases, i);
! 			if (tmptype->tp_flags &
! 			    Py_TPFLAGS_DYNAMICTYPE) {
! 				dynamic = 1;
! 				break;
! 			}
! 		}
  	}
  
--- 782,788 ----
  	}
  	if (dynamic < 0) {
! 		/* Default to dynamic */
! 		dynamic = 1;
! 
  	}