[Python-checkins] python/dist/src/Lib/test test_descr.py, 1.200, 1.201

pje at users.sourceforge.net pje at users.sourceforge.net
Wed Mar 24 21:19:36 EST 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3103/Lib/test

Modified Files:
	test_descr.py 
Log Message:
Ensure super() lookup of descriptor from classmethod works (SF #743627)


Index: test_descr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v
retrieving revision 1.200
retrieving revision 1.201
diff -C2 -d -r1.200 -r1.201
*** test_descr.py	12 Feb 2004 17:35:11 -0000	1.200
--- test_descr.py	25 Mar 2004 02:19:34 -0000	1.201
***************
*** 2065,2068 ****
--- 2065,2082 ----
      vereq(super(DDsub, dd).x, 42)
  
+     # Ensure that super() lookup of descriptor from classmethod
+     # works (SF ID# 743627)
+ 
+     class Base(object):
+         aProp = property(lambda self: "foo")
+ 
+     class Sub(Base):
+         def test(klass):
+             return super(Sub,klass).aProp
+         test = classmethod(test)
+ 
+     veris(Sub.test(), Base.aProp)
+ 
+ 
  def inherits():
      if verbose: print "Testing inheritance from basic types..."




More information about the Python-checkins mailing list