mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Ensure super() lookup of descriptor from classmethod works (SF #743627)
This commit is contained in:
parent
2786d90617
commit
91a968af76
2 changed files with 22 additions and 1 deletions
|
@ -2064,6 +2064,20 @@ def supers():
|
|||
vereq(dd.x, "hello")
|
||||
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..."
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue