]> granicus.if.org Git - python/commitdiff
classic(),metods(): add tests to verify that a bound method without a
authorGuido van Rossum <guido@python.org>
Fri, 17 Aug 2001 13:58:31 +0000 (13:58 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 17 Aug 2001 13:58:31 +0000 (13:58 +0000)
class has a correct repr().

Lib/test/test_descr.py

index e40e003486095f262e645cc05284247c51c88a59..361af58f85251d594c8246c108b53f226b42aa82 100644 (file)
@@ -763,6 +763,7 @@ def classic():
     class E: # *not* subclassing from C
         foo = C.foo
     verify(E().foo == C.foo) # i.e., unbound
+    verify(repr(C.foo.__get__(C())).startswith("<bound method "))
 
 def compattr():
     if verbose: print "Testing computed attributes..."
@@ -907,6 +908,7 @@ def methods():
     class E(object):
         foo = C.foo
     verify(E().foo == C.foo) # i.e., unbound
+    verify(repr(C.foo.__get__(C(1))).startswith("<bound method "))
 
 def specials():
     # Test operators like __hash__ for which a built-in default exists