diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2000-10-30 17:15:20 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2000-10-30 17:15:20 (GMT) |
commit | 6b4ec5135b72eddcb7ed062bb5b466a92795f911 (patch) | |
tree | 187dccda3de56b1e2f592f40194eb9142dfafe5e /Lib/test | |
parent | 5942b439b366b83880a2678793d36b931acef75b (diff) | |
download | cpython-6b4ec5135b72eddcb7ed062bb5b466a92795f911.zip cpython-6b4ec5135b72eddcb7ed062bb5b466a92795f911.tar.gz cpython-6b4ec5135b72eddcb7ed062bb5b466a92795f911.tar.bz2 |
Fix for SF bug #117241
When a method is called with no regular arguments and * args, defer
the first arg is subclass check until after the * args have been
expanded.
N.B. The CALL_FUNCTION implementation is getting really hairy; should
review it to see if it can be simplified.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_extcall.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/test/test_extcall.py b/Lib/test/test_extcall.py index 10e4d6c..7dddabc 100644 --- a/Lib/test/test_extcall.py +++ b/Lib/test/test_extcall.py @@ -144,3 +144,21 @@ for i in range(512): d[key] = i a, b = f2(1, *(2, 3), **d) print len(a), len(b), b == d + +class Foo: + def method(self, arg1, arg2): + return arg1 + arg2 + +x = Foo() +print Foo.method(*(x, 1, 2)) +print Foo.method(x, *(1, 2)) +try: + print Foo.method(*(1, 2, 3)) +except TypeError, err: + print err +try: + print Foo.method(1, *(2, 3)) +except TypeError, err: + print err + + |