diff options
| author | Phillip J. Eby <pje@telecommunity.com> | 2004-03-25 02:19:34 +0000 |
|---|---|---|
| committer | Phillip J. Eby <pje@telecommunity.com> | 2004-03-25 02:19:34 +0000 |
| commit | 91a968af7640348d92011e305127d5968958aff4 (patch) | |
| tree | 43882cd6e010b527a36c4ca92acc193fc59002d7 /Lib | |
| parent | 2786d90617993c5958a477067b20882395de5ac9 (diff) | |
| download | cpython-git-91a968af7640348d92011e305127d5968958aff4.tar.gz | |
Ensure super() lookup of descriptor from classmethod works (SF #743627)
Diffstat (limited to 'Lib')
| -rw-r--r-- | Lib/test/test_descr.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index ccb9fe613b..a224bb90fd 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -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..." |
