[Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.78,1.79

Guido van Rossum gvanrossum@users.sourceforge.net
Fri, 28 Sep 2001 17:40:27 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv20318

Modified Files:
	test_descr.py 
Log Message:
Add a few ``__dynamic__ = 0'' lines in classes that need to preserve
staticness when __dynamic__ = 1 becomes the default:

- Some classes which are used to test the difference between static
  and dynamic.

- Subclasses of complex: complex uses old-style numbers and the slot
  wrappers used by dynamic classes only support new-style numbers.
  (Ideally, the complex type should be fixed, but that looks like a
  labor-intensive job.)


Index: test_descr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v
retrieving revision 1.78
retrieving revision 1.79
diff -C2 -d -r1.78 -r1.79
*** test_descr.py	2001/09/28 23:49:45	1.78
--- test_descr.py	2001/09/29 00:40:25	1.79
***************
*** 833,839 ****
      class S1:
          __metaclass__ = type
      verify(S1.__dynamic__ == 0)
      class S(object):
!         pass
      verify(S.__dynamic__ == 0)
      class D(object):
--- 833,840 ----
      class S1:
          __metaclass__ = type
+         __dynamic__ = 0
      verify(S1.__dynamic__ == 0)
      class S(object):
!         __dynamic__ = 0
      verify(S.__dynamic__ == 0)
      class D(object):
***************
*** 1523,1526 ****
--- 1524,1528 ----
  
      class madcomplex(complex):
+         __dynamic__ = 0
          def __repr__(self):
              return "%.17gj%+.17g" % (self.imag, self.real)
***************
*** 1902,1910 ****
          print "Testing rich comparisons..."
      class Z(complex):
!         pass
      z = Z(1)
      verify(z == 1+0j)
      verify(1+0j == z)
      class ZZ(complex):
          def __eq__(self, other):
              try:
--- 1904,1913 ----
          print "Testing rich comparisons..."
      class Z(complex):
!         __dynamic__ = 0
      z = Z(1)
      verify(z == 1+0j)
      verify(1+0j == z)
      class ZZ(complex):
+         __dynamic__ = 0
          def __eq__(self, other):
              try:
***************
*** 1993,1997 ****
      coerce(0L, F(0))
      coerce(0., F(0))
!     class C(complex): pass
      coerce(C(0), 0)
      coerce(C(0), 0L)
--- 1996,2001 ----
      coerce(0L, F(0))
      coerce(0., F(0))
!     class C(complex):
!         __dynamic__ = 0
      coerce(C(0), 0)
      coerce(C(0), 0L)