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

Guido van Rossum gvanrossum@users.sourceforge.net
Fri, 17 Aug 2001 06:40:50 -0700


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

Modified Files:
	test_descr.py 
Log Message:
classic(), methods(): add another test relating to unbound methods:
when an unbound method of class A is stored as a class variable of
class B, and class B is *not* a subclass of class A, that method
should *not* get bound to B instances.


Index: test_descr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** test_descr.py	2001/08/17 11:55:58	1.16
--- test_descr.py	2001/08/17 13:40:47	1.17
***************
*** 761,764 ****
--- 761,767 ----
      verify(d.foo(1) == (d, 1))
      verify(D.foo(d, 1) == (d, 1))
+     class E: # *not* subclassing from C
+         foo = C.foo
+     verify(E().foo == C.foo) # i.e., unbound
  
  def compattr():
***************
*** 902,905 ****
--- 905,911 ----
      verify(d2.boo() == 2)
      verify(d2.goo() == 1)
+     class E(object):
+         foo = C.foo
+     verify(E().foo == C.foo) # i.e., unbound
  
  def specials():