[pypy-svn] r68850 - pypy/trunk/pypy/interpreter/test
cfbolz at codespeak.net
cfbolz at codespeak.net
Thu Oct 29 16:51:01 CET 2009
Author: cfbolz
Date: Thu Oct 29 16:51:01 2009
New Revision: 68850
Modified:
pypy/trunk/pypy/interpreter/test/test_function.py
Log:
A test that checks that using a builtin function as a special method works as
expected (e.g. the builtin function is not bound to the object before being
called).
Modified: pypy/trunk/pypy/interpreter/test/test_function.py
==============================================================================
--- pypy/trunk/pypy/interpreter/test/test_function.py (original)
+++ pypy/trunk/pypy/interpreter/test/test_function.py Thu Oct 29 16:51:01 2009
@@ -228,6 +228,14 @@
a = A()
assert a.ord('a') == 97
+ def test_builtin_as_special_method_is_not_bound(self):
+ class A(object):
+ __getattr__ = len
+ a = A()
+ assert a.a == 1
+ assert a.ab == 2
+ assert a.abcdefghij == 10
+
def test_call_builtin(self):
s = 'hello'
raises(TypeError, len)
More information about the Pypy-commit
mailing list