]> granicus.if.org Git - python/commitdiff
Since we had a bug with multiplication of dynamic long subclasses, add a
authorTim Peters <tim.peters@gmail.com>
Sat, 15 Sep 2001 06:35:55 +0000 (06:35 +0000)
committerTim Peters <tim.peters@gmail.com>
Sat, 15 Sep 2001 06:35:55 +0000 (06:35 +0000)
little test to make sure it doesn't come back.

Lib/test/test_descr.py

index 3b3a34e54de4feff95443697ed90775023e7db34..401489d6edf9deb225ff75c8375a087a7538e6b8 100644 (file)
@@ -901,13 +901,18 @@ def dynamics():
         __dynamic__ = 1
     verify("a"*I(2) == "aa")
     verify(I(2)*"a" == "aa")
+    verify(2*I(3) == 6)
+    verify(I(3)*2 == 6)
+    verify(I(3)*I(2) == 6)
 
     # Test handling of long*seq and seq*long
     class L(long):
         __dynamic__ = 1
     verify("a"*L(2L) == "aa")
     verify(L(2L)*"a" == "aa")
-    
+    verify(2*L(3) == 6)
+    verify(L(3)*2 == 6)
+    verify(L(3)*L(2) == 6)
 
 def errors():
     if verbose: print "Testing errors..."