diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-06-05 00:32:50 +0000 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-06-05 00:32:50 +0000 |
commit | 2aa6c38237535cbcfbf7ab079c960322c9a7f2c3 (patch) | |
tree | fc6764d3e2195dbd1ba6955d80351d292ec88bbb /Lib/test/test_descr.py | |
parent | e7e505ba6e2ba1768ba81e9dde652b6aff34c386 (diff) | |
download | cpython-git-2aa6c38237535cbcfbf7ab079c960322c9a7f2c3.tar.gz |
properly lookup the __format__ 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 d450eed585..2fdd62fc4f 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -1697,6 +1697,8 @@ order (MRO) for bases """ def some_number(self_, key): self.assertEqual(key, "hi") return 4 + def format_impl(self, spec): + return "hello" # 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 @@ -1715,6 +1717,7 @@ order (MRO) for bases """ ("__enter__", run_context, iden, set(), {"__exit__" : swallow}), ("__exit__", run_context, swallow, set(), {"__enter__" : iden}), ("__complex__", complex, complex_num, set(), {}), + ("__format__", format, format_impl, set(), {}), ] class Checker(object): |