diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-05-09 02:07:04 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-05-09 02:07:04 (GMT) |
commit | 809e22543f8bafd2df66fbe116ad49bbca5793f3 (patch) | |
tree | c301fd6cd73eda018a1b9c5b8ae1cf9ac5e108c5 /Lib/test/test_descr.py | |
parent | 84ad84e0bb15e7c64109e88060afdcb60ae7b740 (diff) | |
download | cpython-809e22543f8bafd2df66fbe116ad49bbca5793f3.zip cpython-809e22543f8bafd2df66fbe116ad49bbca5793f3.tar.gz cpython-809e22543f8bafd2df66fbe116ad49bbca5793f3.tar.bz2 |
lookup __reversed__ correctly as a special method
Diffstat (limited to 'Lib/test/test_descr.py')
-rw-r--r-- | Lib/test/test_descr.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 2b00ce9..fe4eaea 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -1676,12 +1676,15 @@ order (MRO) for bases """ return self def hello(self): return "hello" + def empty_seq(self): + return [] # It would be nice to have every special method tested here, but I'm # only listing the ones I can remember outside of typeobject.c, since it # does it right. specials = [ ("__unicode__", unicode, hello), + ("__reversed__", reversed, empty_seq), # These two fail because the compiler generates LOAD_ATTR to look # them up. We'd have to add a new opcode to fix this, and it's # probably not worth it. |